Skip to content

Commit

Permalink
MORE fixes
Browse files Browse the repository at this point in the history
Better locate for end cities, better sotrage block list, added a joke to rainbow color.java, and some other miwsc changes
  • Loading branch information
Julieisbaka committed Aug 31, 2024
1 parent 40b73d8 commit 771fa38
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ public class LocateCommand extends Command {
Blocks.PURPUR_SLAB,
Blocks.PURPUR_STAIRS,
Blocks.END_STONE_BRICKS,
Blocks.END_ROD
Blocks.END_ROD,
Blocks.MAGENTA_STAINED_GLASS
);

public LocateCommand() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,19 @@

package meteordevelopment.meteorclient.commands.commands;

import java.io.FileWriter;
import java.io.IOException;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.mojang.brigadier.arguments.StringArgumentType;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import com.mojang.brigadier.exceptions.DynamicCommandExceptionType;
import com.mojang.brigadier.exceptions.SimpleCommandExceptionType;

import meteordevelopment.meteorclient.MeteorClient;
import meteordevelopment.meteorclient.commands.Command;
import meteordevelopment.meteorclient.commands.arguments.NotebotSongArgumentType;
Expand All @@ -25,14 +34,6 @@
import net.minecraft.text.Text;
import net.minecraft.util.Util;

import java.io.FileWriter;
import java.io.IOException;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class NotebotCommand extends Command {
private final static SimpleCommandExceptionType INVALID_SONG = new SimpleCommandExceptionType(Text.literal("Invalid song."));
private final static DynamicCommandExceptionType INVALID_PATH = new DynamicCommandExceptionType(object -> Text.literal("'%s' is not a valid path.".formatted(object)));
Expand Down Expand Up @@ -162,20 +163,19 @@ private void saveRecording(Path path) {
try {
MeteorClient.EVENT_BUS.unsubscribe(this);

FileWriter file = new FileWriter(path.toFile());
for (var entry : song.entrySet()) {
int tick = entry.getKey();
List<Note> notes = entry.getValue();
try (FileWriter file = new FileWriter(path.toFile())) {
for (var entry : song.entrySet()) {
int tick = entry.getKey();
List<Note> notes = entry.getValue();

for (var note : notes) {
NoteBlockInstrument instrument = note.getInstrument();
int noteLevel = note.getNoteLevel();
for (var note : notes) {
NoteBlockInstrument instrument = note.getInstrument();
int noteLevel = note.getNoteLevel();

file.write(String.format("%d:%d:%d\n", tick, noteLevel, instrument.ordinal()));
file.write(String.format("%d:%d:%d\n", tick, noteLevel, instrument.ordinal()));
}
}
}

file.close();
info("Song saved.");
} catch (IOException e) {
info("Couldn't create the file.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

public class ToggleCommand extends Command {
public ToggleCommand() {
super("toggle", "Toggles a module.", "t");
super("toggle", "Toggles a module on or off.", "t");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public EnchantmentListSetting(String name, String description, Set<RegistryKey<E
public void resetImpl() {
value = new ObjectOpenHashSet<>(defaultValue);
}

//ench means enchantment.
@Override
protected Set<RegistryKey<Enchantment>> parseImpl(String str) {
String[] values = str.split(",");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public class StorageBlockListSetting extends Setting<List<BlockEntityType<?>>> {
BlockEntityType.SHULKER_BOX,
BlockEntityType.SMOKER,
BlockEntityType.TRAPPED_CHEST,
BlockEntityType.Lectern,
};

public static final Registry<BlockEntityType<?>> REGISTRY = new SRegistry();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This file is part of the Meteor Client distribution (https://github.com/MeteorDevelopment/meteor-client).
* Copyright (c) Meteor Development.
*/

//jeb_
package meteordevelopment.meteorclient.utils.render.color;

public class RainbowColor extends Color {
Expand Down

0 comments on commit 771fa38

Please sign in to comment.