From 282edacaaa4a4369ab4bcb91cf2c84a06c4e10b1 Mon Sep 17 00:00:00 2001 From: etianl <115842502+etianl@users.noreply.github.com> Date: Sun, 4 Feb 2024 04:15:13 -0800 Subject: [PATCH] Delete src/main/java/pwn/noobs/trouserstreak/commands/GetNbtCommand.java --- .../trouserstreak/commands/GetNbtCommand.java | 51 ------------------- 1 file changed, 51 deletions(-) delete mode 100644 src/main/java/pwn/noobs/trouserstreak/commands/GetNbtCommand.java diff --git a/src/main/java/pwn/noobs/trouserstreak/commands/GetNbtCommand.java b/src/main/java/pwn/noobs/trouserstreak/commands/GetNbtCommand.java deleted file mode 100644 index 76e4a0a83..000000000 --- a/src/main/java/pwn/noobs/trouserstreak/commands/GetNbtCommand.java +++ /dev/null @@ -1,51 +0,0 @@ -package pwn.noobs.trouserstreak.commands; - -import com.mojang.brigadier.builder.LiteralArgumentBuilder; -import meteordevelopment.meteorclient.commands.Command; -import meteordevelopment.meteorclient.utils.player.ChatUtils; -import net.minecraft.command.CommandSource; -import net.minecraft.text.Text; -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Paths; - -import static com.mojang.brigadier.Command.SINGLE_SUCCESS; -import static meteordevelopment.meteorclient.MeteorClient.mc; - -public class GetNbtCommand extends Command { - public GetNbtCommand() { - super("viewnbt", "Tells you the nbt data of the item in your main hand."); - } - @Override - public void build(LiteralArgumentBuilder builder) { - builder.executes(ctx -> { - if (!mc.player.getMainHandStack().isEmpty()) - ChatUtils.sendMsg(Text.of(mc.player.getMainHandStack().getNbt().toString())); - else error("No item in main hand."); - return SINGLE_SUCCESS; - }); - builder.then(literal("Save").executes(ctx -> { - if (!mc.player.getMainHandStack().isEmpty()) - ChatUtils.sendMsg(Text.of(mc.player.getMainHandStack().getNbt().toString())); - else error("No item in main hand."); - if (!Files.exists(Paths.get("SavedNBT/ViewedNBTData.txt"))){ - File file = new File("SavedNBT/ViewedNBTData.txt"); - try { - file.createNewFile(); - } catch (IOException e) {} - } - try { - new File("SavedNBT/").mkdirs(); - FileWriter writer = new FileWriter("SavedNBT/ViewedNBTData.txt", true); - writer.write(String.valueOf(mc.player.getMainHandStack().getNbt().toString())); - writer.write("\r\n"); // write new line - writer.close(); - } catch (IOException e) { - e.printStackTrace(); - } - return SINGLE_SUCCESS; - })); - } -} \ No newline at end of file