Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to storage blocks and strucutre blocks #4875

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ logs
.idea/*
!.idea/copyright/*
!.idea/scopes/*

.fake
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ archives_base_name=meteor-client
# Dependency Versions

# Baritone (https://github.com/MeteorDevelopment/baritone)
baritone_version=1.21
baritone_version=1.21.1

# Sodium (https://github.com/CaffeineMC/sodium-fabric)
sodium_version=mc1.21-0.6.0-beta.1-fabric
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public String getDescription() {
public List<String> getAliases() {
return aliases;
}

@override
public String toString() {
return Config.get().prefix.get() + name;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@

package meteordevelopment.meteorclient.commands.commands;

import baritone.api.BaritoneAPI;
import java.util.List;

import org.jetbrains.annotations.Nullable;

import com.mojang.brigadier.builder.LiteralArgumentBuilder;

import baritone.api.BaritoneAPI;
import meteordevelopment.meteorclient.MeteorClient;
import meteordevelopment.meteorclient.commands.Command;
import meteordevelopment.meteorclient.events.packets.PacketEvent;
Expand Down Expand Up @@ -34,9 +39,6 @@
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
import org.jetbrains.annotations.Nullable;

import java.util.List;

public class LocateCommand extends Command {
private Vec3d firstStart;
Expand All @@ -47,7 +49,8 @@ public class LocateCommand extends Command {
private final List<Block> netherFortressBlocks = List.of(
Blocks.NETHER_BRICKS,
Blocks.NETHER_BRICK_FENCE,
Blocks.NETHER_WART
Blocks.NETHER_WART,
Blocks.CRACKED_NETHER_BRICKS
);

private final List<Block> monumentBlocks = List.of(
Expand All @@ -66,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 @@ -35,8 +35,8 @@ public void render(WWidget widget, MatrixStack matrices) {
private void renderWidget(WWidget widget) {
lineBox(widget.x, widget.y, widget.width, widget.height, WIDGET_COLOR);

if (widget instanceof WContainer) {
for (Cell<?> cell : ((WContainer) widget).cells) {
if (widget instanceof WContainer wContainer) {
for (Cell<?> cell : wContainer.cells) {
lineBox(cell.x, cell.y, cell.width, cell.height, CELL_COLOR);
renderWidget(cell.widget());
}
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