Skip to content

Commit

Permalink
v2.0.1: Fix missing commands
Browse files Browse the repository at this point in the history
  • Loading branch information
0KepOnline committed Jun 18, 2024
1 parent c34846b commit 72acceb
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 79 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ minecraft_version=1.20
loader_version=0.15.6

# Mod Properties
mod_version=2.0
mod_version=2.0.1
maven_group=net.scenariopla
mod_id=nbtexporter
mod_name=NBT Exporter
Expand Down
10 changes: 8 additions & 2 deletions src/main/java/net/scenariopla/nbtexporter/NBTExporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,27 @@
import net.fabricmc.loader.api.FabricLoader;

import net.scenariopla.nbtexporter.command.ExportItemStackCommand;
import net.scenariopla.nbtexporter.command.ExportItemStackGiveCommand;
import net.scenariopla.nbtexporter.command.ExportItemStackNBTCommand;
import net.scenariopla.nbtexporter.command.ExportStringifiedItemStackCommand;
import net.scenariopla.nbtexporter.command.ExportStringifiedItemStackNBTCommand;
import net.scenariopla.nbtexporter.command.ICommand;
import net.scenariopla.nbtexporter.init.DirectoryInit;

public class NBTExporter implements ClientModInitializer {
public class Reference {
public static final String MOD_ID = "nbtexporter";
public static final String NAME = "NBT Exporter";
public static final String VERSION = "2.0";
public static final String VERSION = "2.0.1";

public static final String MOD_DIRECTORY = MOD_ID;

public static final ICommand[] MOD_CLIENT_COMMANDS = {
new ExportItemStackCommand(),
new ExportItemStackNBTCommand(),
new ExportItemStackCommand()
new ExportStringifiedItemStackCommand(),
new ExportStringifiedItemStackNBTCommand(),
new ExportItemStackGiveCommand()
};

public static final FabricLoader MINECRAFT = FabricLoader.getInstance();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public String getMessageKey() {
}

public void register(CommandDispatcher<FabricClientCommandSource> dispatcher) {
dispatcher.register(literal("exportnbtstr")
dispatcher.register(literal("exportstackstr")
.executes(context -> {
return execute(context, getFilename());
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@

import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.NbtIo;
import net.minecraft.network.chat.ClickEvent;
import net.minecraft.network.chat.Component;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;

import net.scenariopla.nbtexporter.NBTExporter;
import net.scenariopla.nbtexporter.NBTExporter.Reference;
import net.scenariopla.nbtexporter.util.NBTFileWriter;
import static net.scenariopla.nbtexporter.command.NBTExporterCommandExceptions.ExceptionCollection;
import static net.scenariopla.nbtexporter.command.NBTExporterCommandExceptions.exception;

Expand Down Expand Up @@ -134,7 +134,7 @@ protected static File writeToFile(File file,
ByteArrayOutputStream byteArrayOutputStream = null;
try {
byteArrayOutputStream = new ByteArrayOutputStream();
NBTFileWriter.writeCompoundGZIP(tag, byteArrayOutputStream);
NbtIo.writeCompressed(tag, byteArrayOutputStream);
return writeToFile(file, byteArrayOutputStream.toByteArray());
} catch (IOException e) {
e.printStackTrace();
Expand Down
73 changes: 0 additions & 73 deletions src/main/java/net/scenariopla/nbtexporter/util/NBTFileWriter.java

This file was deleted.

0 comments on commit 72acceb

Please sign in to comment.