From 79ba1ed6fc133bacf64ee8e3a5d1454d1eadde2f Mon Sep 17 00:00:00 2001 From: Aaron <51387595+AzureAaron@users.noreply.github.com> Date: Tue, 8 Aug 2023 20:28:24 -0400 Subject: Add Item Renaming --- .../skyblocker/skyblock/item/ItemRenaming.java | 66 ++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 src/main/java/me/xmrvizzy/skyblocker/skyblock/item/ItemRenaming.java (limited to 'src/main/java/me/xmrvizzy/skyblocker/skyblock') diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/ItemRenaming.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/ItemRenaming.java new file mode 100644 index 00000000..db672803 --- /dev/null +++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/ItemRenaming.java @@ -0,0 +1,66 @@ +package me.xmrvizzy.skyblocker.skyblock.item; + +import java.util.Map; + +import com.mojang.brigadier.Command; +import com.mojang.brigadier.CommandDispatcher; + +import me.xmrvizzy.skyblocker.config.SkyblockerConfig; +import me.xmrvizzy.skyblocker.utils.Utils; +import net.fabricmc.fabric.api.client.command.v2.ClientCommandManager; +import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback; +import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource; +import net.minecraft.client.MinecraftClient; +import net.minecraft.command.CommandRegistryAccess; +import net.minecraft.command.argument.TextArgumentType; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NbtCompound; +import net.minecraft.text.Text; + +public class ItemRenaming { + + public static void init() { + ClientCommandRegistrationCallback.EVENT.register(ItemRenaming::registerCommands); + } + + private static void registerCommands(CommandDispatcher dispatcher, CommandRegistryAccess registryAccess) { + dispatcher.register(ClientCommandManager.literal("skyblocker") + .then(ClientCommandManager.literal("renameItem") + .executes(context -> renameItem(context.getSource(), null)) + .then(ClientCommandManager.argument("textComponent", TextArgumentType.text()) + .executes(context -> renameItem(context.getSource(), context.getArgument("textComponent", Text.class)))))); + } + + private static int renameItem(FabricClientCommandSource source, Text text) { + MinecraftClient client = source.getClient(); + ItemStack heldItem = client.player.getMainHandStack(); + NbtCompound nbt = (heldItem != null) ? heldItem.getNbt() : null; + + if (Utils.isOnSkyblock() && nbt != null && nbt.contains("ExtraAttributes")) { + NbtCompound extraAttributes = nbt.getCompound("ExtraAttributes"); + String itemUuid = extraAttributes.contains("uuid") ? extraAttributes.getString("uuid") : null; + + if (itemUuid != null) { + Map customItemNames = SkyblockerConfig.get().general.customItemNames; + + if (text == null) { + //Remove custom item name when the text argument isn't passed + customItemNames.remove(itemUuid); + SkyblockerConfig.save(); + source.sendFeedback(Text.translatable("skyblocker.customItemNames.removed")); + } else { + //If the text is provided then set the item's custom name to it + customItemNames.put(itemUuid, text); + SkyblockerConfig.save(); + source.sendFeedback(Text.translatable("skyblocker.customItemNames.added")); + } + } else { + source.sendError(Text.translatable("skyblocker.customItemNames.noItemUuid")); + } + } else { + source.sendError(Text.translatable("skyblocker.customItemNames.unableToSetName")); + } + + return Command.SINGLE_SUCCESS; + } +} -- cgit From a629801cc3ffa5913bc07af173e8a01673a70681 Mon Sep 17 00:00:00 2001 From: Aaron <51387595+AzureAaron@users.noreply.github.com> Date: Wed, 9 Aug 2023 20:01:18 -0400 Subject: Custom Armour Dye Colours --- .../skyblock/item/CustomArmorDyeColors.java | 87 ++++++++++++++++++++++ .../skyblocker/skyblock/item/CustomItemNames.java | 69 +++++++++++++++++ .../skyblocker/skyblock/item/ItemRenaming.java | 66 ---------------- 3 files changed, 156 insertions(+), 66 deletions(-) create mode 100644 src/main/java/me/xmrvizzy/skyblocker/skyblock/item/CustomArmorDyeColors.java create mode 100644 src/main/java/me/xmrvizzy/skyblocker/skyblock/item/CustomItemNames.java delete mode 100644 src/main/java/me/xmrvizzy/skyblocker/skyblock/item/ItemRenaming.java (limited to 'src/main/java/me/xmrvizzy/skyblocker/skyblock') diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/CustomArmorDyeColors.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/CustomArmorDyeColors.java new file mode 100644 index 00000000..dd5614d1 --- /dev/null +++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/CustomArmorDyeColors.java @@ -0,0 +1,87 @@ +package me.xmrvizzy.skyblocker.skyblock.item; + +import com.mojang.brigadier.Command; +import com.mojang.brigadier.CommandDispatcher; +import com.mojang.brigadier.arguments.StringArgumentType; + +import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; +import me.xmrvizzy.skyblocker.config.SkyblockerConfig; +import me.xmrvizzy.skyblocker.utils.Utils; +import net.fabricmc.fabric.api.client.command.v2.ClientCommandManager; +import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback; +import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource; +import net.minecraft.client.MinecraftClient; +import net.minecraft.command.CommandRegistryAccess; +import net.minecraft.item.DyeableArmorItem; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NbtCompound; +import net.minecraft.text.Text; + +public class CustomArmorDyeColors { + + public static void init() { + ClientCommandRegistrationCallback.EVENT.register(CustomArmorDyeColors::registerCommands); + } + + private static void registerCommands(CommandDispatcher dispatcher, CommandRegistryAccess registryAccess) { + dispatcher.register(ClientCommandManager.literal("skyblocker") + .then(ClientCommandManager.literal("dyeColor") + .executes(context -> customizeDyeColor(context.getSource(), null)) + .then(ClientCommandManager.argument("hexCode", StringArgumentType.string()) + .executes(context -> customizeDyeColor(context.getSource(), StringArgumentType.getString(context, "hexCode")))))); + } + + private static int customizeDyeColor(FabricClientCommandSource source, String hex) { + MinecraftClient client = source.getClient(); + ItemStack heldItem = client.player.getMainHandStack(); + NbtCompound nbt = (heldItem != null) ? heldItem.getNbt() : null; + + if (hex != null && !isHexadecimalColor(hex)) { + source.sendError(Text.translatable("skyblocker.customDyeColors.invalidHex")); + return Command.SINGLE_SUCCESS; + } + + if (Utils.isOnSkyblock() && heldItem != null && heldItem.getItem() instanceof DyeableArmorItem) { + if (nbt != null && nbt.contains("ExtraAttributes")) { + NbtCompound extraAttributes = nbt.getCompound("ExtraAttributes"); + String itemUuid = extraAttributes.contains("uuid") ? extraAttributes.getString("uuid") : null; + + if (itemUuid != null) { + Object2IntOpenHashMap customDyeColors = SkyblockerConfig.get().general.customDyeColors; + + if (hex == null) { + if (customDyeColors.containsKey(itemUuid)) { + customDyeColors.removeInt(itemUuid); + SkyblockerConfig.save(); + source.sendFeedback(Text.translatable("skyblocker.customDyeColors.removed")); + } else { + source.sendFeedback(Text.translatable("skyblocker.customDyeColors.neverHad")); + } + } else { + customDyeColors.put(itemUuid, Integer.decode("0x" + hex.replace("#", "")).intValue()); + SkyblockerConfig.save(); + source.sendFeedback(Text.translatable("skyblocker.customDyeColors.added")); + } + } else { + source.sendError(Text.translatable("skyblocker.customDyeColors.noItemUuid")); + } + } + } else { + if (!(heldItem.getItem() instanceof DyeableArmorItem)) { + source.sendError(Text.translatable("skyblocker.customDyeColors.notDyeable")); + return Command.SINGLE_SUCCESS; + } else { + source.sendError(Text.translatable("skyblocker.customDyeColors.unableToSetColor")); + } + } + + return Command.SINGLE_SUCCESS; + } + + private static boolean isHexadecimalColor(String s) { + s = s.replace("#", ""); + + return s.chars() + .allMatch(c -> "0123456789ABCDEFabcdef".indexOf(c) >= 0) && s.length() == 6; + } +} diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/CustomItemNames.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/CustomItemNames.java new file mode 100644 index 00000000..4ecff508 --- /dev/null +++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/CustomItemNames.java @@ -0,0 +1,69 @@ +package me.xmrvizzy.skyblocker.skyblock.item; + +import com.mojang.brigadier.Command; +import com.mojang.brigadier.CommandDispatcher; + +import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; +import me.xmrvizzy.skyblocker.config.SkyblockerConfig; +import me.xmrvizzy.skyblocker.utils.Utils; +import net.fabricmc.fabric.api.client.command.v2.ClientCommandManager; +import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback; +import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource; +import net.minecraft.client.MinecraftClient; +import net.minecraft.command.CommandRegistryAccess; +import net.minecraft.command.argument.TextArgumentType; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NbtCompound; +import net.minecraft.text.Text; + +public class CustomItemNames { + + public static void init() { + ClientCommandRegistrationCallback.EVENT.register(CustomItemNames::registerCommands); + } + + private static void registerCommands(CommandDispatcher dispatcher, CommandRegistryAccess registryAccess) { + dispatcher.register(ClientCommandManager.literal("skyblocker") + .then(ClientCommandManager.literal("renameItem") + .executes(context -> renameItem(context.getSource(), null)) + .then(ClientCommandManager.argument("textComponent", TextArgumentType.text()) + .executes(context -> renameItem(context.getSource(), context.getArgument("textComponent", Text.class)))))); + } + + private static int renameItem(FabricClientCommandSource source, Text text) { + MinecraftClient client = source.getClient(); + ItemStack heldItem = client.player.getMainHandStack(); + NbtCompound nbt = (heldItem != null) ? heldItem.getNbt() : null; + + if (Utils.isOnSkyblock() && nbt != null && nbt.contains("ExtraAttributes")) { + NbtCompound extraAttributes = nbt.getCompound("ExtraAttributes"); + String itemUuid = extraAttributes.contains("uuid") ? extraAttributes.getString("uuid") : null; + + if (itemUuid != null) { + Object2ObjectOpenHashMap customItemNames = SkyblockerConfig.get().general.customItemNames; + + if (text == null) { + if (customItemNames.containsKey(itemUuid)) { + //Remove custom item name when the text argument isn't passed + customItemNames.remove(itemUuid); + SkyblockerConfig.save(); + source.sendFeedback(Text.translatable("skyblocker.customItemNames.removed")); + } else { + source.sendFeedback(Text.translatable("skyblocker.customItemNames.neverHad")); + } + } else { + //If the text is provided then set the item's custom name to it + customItemNames.put(itemUuid, text); + SkyblockerConfig.save(); + source.sendFeedback(Text.translatable("skyblocker.customItemNames.added")); + } + } else { + source.sendError(Text.translatable("skyblocker.customItemNames.noItemUuid")); + } + } else { + source.sendError(Text.translatable("skyblocker.customItemNames.unableToSetName")); + } + + return Command.SINGLE_SUCCESS; + } +} diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/ItemRenaming.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/ItemRenaming.java deleted file mode 100644 index db672803..00000000 --- a/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/ItemRenaming.java +++ /dev/null @@ -1,66 +0,0 @@ -package me.xmrvizzy.skyblocker.skyblock.item; - -import java.util.Map; - -import com.mojang.brigadier.Command; -import com.mojang.brigadier.CommandDispatcher; - -import me.xmrvizzy.skyblocker.config.SkyblockerConfig; -import me.xmrvizzy.skyblocker.utils.Utils; -import net.fabricmc.fabric.api.client.command.v2.ClientCommandManager; -import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback; -import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource; -import net.minecraft.client.MinecraftClient; -import net.minecraft.command.CommandRegistryAccess; -import net.minecraft.command.argument.TextArgumentType; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NbtCompound; -import net.minecraft.text.Text; - -public class ItemRenaming { - - public static void init() { - ClientCommandRegistrationCallback.EVENT.register(ItemRenaming::registerCommands); - } - - private static void registerCommands(CommandDispatcher dispatcher, CommandRegistryAccess registryAccess) { - dispatcher.register(ClientCommandManager.literal("skyblocker") - .then(ClientCommandManager.literal("renameItem") - .executes(context -> renameItem(context.getSource(), null)) - .then(ClientCommandManager.argument("textComponent", TextArgumentType.text()) - .executes(context -> renameItem(context.getSource(), context.getArgument("textComponent", Text.class)))))); - } - - private static int renameItem(FabricClientCommandSource source, Text text) { - MinecraftClient client = source.getClient(); - ItemStack heldItem = client.player.getMainHandStack(); - NbtCompound nbt = (heldItem != null) ? heldItem.getNbt() : null; - - if (Utils.isOnSkyblock() && nbt != null && nbt.contains("ExtraAttributes")) { - NbtCompound extraAttributes = nbt.getCompound("ExtraAttributes"); - String itemUuid = extraAttributes.contains("uuid") ? extraAttributes.getString("uuid") : null; - - if (itemUuid != null) { - Map customItemNames = SkyblockerConfig.get().general.customItemNames; - - if (text == null) { - //Remove custom item name when the text argument isn't passed - customItemNames.remove(itemUuid); - SkyblockerConfig.save(); - source.sendFeedback(Text.translatable("skyblocker.customItemNames.removed")); - } else { - //If the text is provided then set the item's custom name to it - customItemNames.put(itemUuid, text); - SkyblockerConfig.save(); - source.sendFeedback(Text.translatable("skyblocker.customItemNames.added")); - } - } else { - source.sendError(Text.translatable("skyblocker.customItemNames.noItemUuid")); - } - } else { - source.sendError(Text.translatable("skyblocker.customItemNames.unableToSetName")); - } - - return Command.SINGLE_SUCCESS; - } -} -- cgit From 16c6debb1cc90be5815cd188264b16ddf8b76f16 Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Thu, 10 Aug 2023 10:55:45 +0800 Subject: Refactor CustomArmorDyeColors and CustomItemNames --- .../skyblock/item/CustomArmorDyeColors.java | 72 ++++++++++------------ .../skyblocker/skyblock/item/CustomItemNames.java | 21 +++---- 2 files changed, 42 insertions(+), 51 deletions(-) (limited to 'src/main/java/me/xmrvizzy/skyblocker/skyblock') diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/CustomArmorDyeColors.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/CustomArmorDyeColors.java index dd5614d1..9385b4a1 100644 --- a/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/CustomArmorDyeColors.java +++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/CustomArmorDyeColors.java @@ -3,14 +3,12 @@ package me.xmrvizzy.skyblocker.skyblock.item; import com.mojang.brigadier.Command; import com.mojang.brigadier.CommandDispatcher; import com.mojang.brigadier.arguments.StringArgumentType; - import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; import me.xmrvizzy.skyblocker.config.SkyblockerConfig; import me.xmrvizzy.skyblocker.utils.Utils; import net.fabricmc.fabric.api.client.command.v2.ClientCommandManager; import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback; import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource; -import net.minecraft.client.MinecraftClient; import net.minecraft.command.CommandRegistryAccess; import net.minecraft.item.DyeableArmorItem; import net.minecraft.item.ItemStack; @@ -18,11 +16,10 @@ import net.minecraft.nbt.NbtCompound; import net.minecraft.text.Text; public class CustomArmorDyeColors { - public static void init() { ClientCommandRegistrationCallback.EVENT.register(CustomArmorDyeColors::registerCommands); } - + private static void registerCommands(CommandDispatcher dispatcher, CommandRegistryAccess registryAccess) { dispatcher.register(ClientCommandManager.literal("skyblocker") .then(ClientCommandManager.literal("dyeColor") @@ -30,58 +27,55 @@ public class CustomArmorDyeColors { .then(ClientCommandManager.argument("hexCode", StringArgumentType.string()) .executes(context -> customizeDyeColor(context.getSource(), StringArgumentType.getString(context, "hexCode")))))); } - + + @SuppressWarnings("SameReturnValue") private static int customizeDyeColor(FabricClientCommandSource source, String hex) { - MinecraftClient client = source.getClient(); - ItemStack heldItem = client.player.getMainHandStack(); + ItemStack heldItem = source.getPlayer().getMainHandStack(); NbtCompound nbt = (heldItem != null) ? heldItem.getNbt() : null; - + if (hex != null && !isHexadecimalColor(hex)) { source.sendError(Text.translatable("skyblocker.customDyeColors.invalidHex")); return Command.SINGLE_SUCCESS; } - - if (Utils.isOnSkyblock() && heldItem != null && heldItem.getItem() instanceof DyeableArmorItem) { - if (nbt != null && nbt.contains("ExtraAttributes")) { - NbtCompound extraAttributes = nbt.getCompound("ExtraAttributes"); - String itemUuid = extraAttributes.contains("uuid") ? extraAttributes.getString("uuid") : null; - - if (itemUuid != null) { - Object2IntOpenHashMap customDyeColors = SkyblockerConfig.get().general.customDyeColors; - - if (hex == null) { - if (customDyeColors.containsKey(itemUuid)) { - customDyeColors.removeInt(itemUuid); - SkyblockerConfig.save(); - source.sendFeedback(Text.translatable("skyblocker.customDyeColors.removed")); + + if (Utils.isOnSkyblock() && heldItem != null) { + if (heldItem.getItem() instanceof DyeableArmorItem) { + if (nbt != null && nbt.contains("ExtraAttributes")) { + NbtCompound extraAttributes = nbt.getCompound("ExtraAttributes"); + String itemUuid = extraAttributes.contains("uuid") ? extraAttributes.getString("uuid") : null; + + if (itemUuid != null) { + Object2IntOpenHashMap customDyeColors = SkyblockerConfig.get().general.customDyeColors; + + if (hex == null) { + if (customDyeColors.containsKey(itemUuid)) { + customDyeColors.removeInt(itemUuid); + SkyblockerConfig.save(); + source.sendFeedback(Text.translatable("skyblocker.customDyeColors.removed")); + } else { + source.sendFeedback(Text.translatable("skyblocker.customDyeColors.neverHad")); + } } else { - source.sendFeedback(Text.translatable("skyblocker.customDyeColors.neverHad")); + customDyeColors.put(itemUuid, Integer.decode("0x" + hex.replace("#", "")).intValue()); + SkyblockerConfig.save(); + source.sendFeedback(Text.translatable("skyblocker.customDyeColors.added")); } } else { - customDyeColors.put(itemUuid, Integer.decode("0x" + hex.replace("#", "")).intValue()); - SkyblockerConfig.save(); - source.sendFeedback(Text.translatable("skyblocker.customDyeColors.added")); + source.sendError(Text.translatable("skyblocker.customDyeColors.noItemUuid")); } - } else { - source.sendError(Text.translatable("skyblocker.customDyeColors.noItemUuid")); } - } - } else { - if (!(heldItem.getItem() instanceof DyeableArmorItem)) { + } else { source.sendError(Text.translatable("skyblocker.customDyeColors.notDyeable")); return Command.SINGLE_SUCCESS; - } else { - source.sendError(Text.translatable("skyblocker.customDyeColors.unableToSetColor")); } + } else { + source.sendError(Text.translatable("skyblocker.customDyeColors.unableToSetColor")); } - + return Command.SINGLE_SUCCESS; } - + private static boolean isHexadecimalColor(String s) { - s = s.replace("#", ""); - - return s.chars() - .allMatch(c -> "0123456789ABCDEFabcdef".indexOf(c) >= 0) && s.length() == 6; + return s.replace("#", "").chars().allMatch(c -> "0123456789ABCDEFabcdef".indexOf(c) >= 0) && s.replace("#", "").length() == 6; } } diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/CustomItemNames.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/CustomItemNames.java index 4ecff508..5d410947 100644 --- a/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/CustomItemNames.java +++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/CustomItemNames.java @@ -2,14 +2,12 @@ package me.xmrvizzy.skyblocker.skyblock.item; import com.mojang.brigadier.Command; import com.mojang.brigadier.CommandDispatcher; - import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import me.xmrvizzy.skyblocker.config.SkyblockerConfig; import me.xmrvizzy.skyblocker.utils.Utils; import net.fabricmc.fabric.api.client.command.v2.ClientCommandManager; import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback; import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource; -import net.minecraft.client.MinecraftClient; import net.minecraft.command.CommandRegistryAccess; import net.minecraft.command.argument.TextArgumentType; import net.minecraft.item.ItemStack; @@ -17,11 +15,10 @@ import net.minecraft.nbt.NbtCompound; import net.minecraft.text.Text; public class CustomItemNames { - public static void init() { ClientCommandRegistrationCallback.EVENT.register(CustomItemNames::registerCommands); } - + private static void registerCommands(CommandDispatcher dispatcher, CommandRegistryAccess registryAccess) { dispatcher.register(ClientCommandManager.literal("skyblocker") .then(ClientCommandManager.literal("renameItem") @@ -29,19 +26,19 @@ public class CustomItemNames { .then(ClientCommandManager.argument("textComponent", TextArgumentType.text()) .executes(context -> renameItem(context.getSource(), context.getArgument("textComponent", Text.class)))))); } - + + @SuppressWarnings("SameReturnValue") private static int renameItem(FabricClientCommandSource source, Text text) { - MinecraftClient client = source.getClient(); - ItemStack heldItem = client.player.getMainHandStack(); + ItemStack heldItem = source.getPlayer().getMainHandStack(); NbtCompound nbt = (heldItem != null) ? heldItem.getNbt() : null; - + if (Utils.isOnSkyblock() && nbt != null && nbt.contains("ExtraAttributes")) { NbtCompound extraAttributes = nbt.getCompound("ExtraAttributes"); - String itemUuid = extraAttributes.contains("uuid") ? extraAttributes.getString("uuid") : null; - + String itemUuid = extraAttributes.contains("uuid") ? extraAttributes.getString("uuid") : null; + if (itemUuid != null) { Object2ObjectOpenHashMap customItemNames = SkyblockerConfig.get().general.customItemNames; - + if (text == null) { if (customItemNames.containsKey(itemUuid)) { //Remove custom item name when the text argument isn't passed @@ -63,7 +60,7 @@ public class CustomItemNames { } else { source.sendError(Text.translatable("skyblocker.customItemNames.unableToSetName")); } - + return Command.SINGLE_SUCCESS; } } -- cgit