diff options
author | Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> | 2023-10-11 15:10:56 -0400 |
---|---|---|
committer | Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> | 2023-10-11 16:16:34 -0400 |
commit | 4fbcf1b2a4790f3033e97c55cab344abdfaea8d2 (patch) | |
tree | b2bdbb1bc96655191a4b8de9df6b2e28c18ef376 /src/main/java/de/hysky/skyblocker/skyblock/item | |
parent | e4a8417403e2e4b32c76199b951d49a6244e4881 (diff) | |
download | Skyblocker-4fbcf1b2a4790f3033e97c55cab344abdfaea8d2.tar.gz Skyblocker-4fbcf1b2a4790f3033e97c55cab344abdfaea8d2.tar.bz2 Skyblocker-4fbcf1b2a4790f3033e97c55cab344abdfaea8d2.zip |
Remove optionals
Diffstat (limited to 'src/main/java/de/hysky/skyblocker/skyblock/item')
-rw-r--r-- | src/main/java/de/hysky/skyblocker/skyblock/item/CustomArmorDyeColors.java | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/item/CustomArmorDyeColors.java b/src/main/java/de/hysky/skyblocker/skyblock/item/CustomArmorDyeColors.java index 8fba8df8..1496c90f 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/item/CustomArmorDyeColors.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/item/CustomArmorDyeColors.java @@ -40,27 +40,27 @@ public class CustomArmorDyeColors { if (Utils.isOnSkyblock() && heldItem != null) { if (heldItem.getItem() instanceof DyeableItem) { - String itemUuid = ItemUtils.getItemUuid(heldItem); + String itemUuid = ItemUtils.getItemUuid(heldItem); - if (!itemUuid.isEmpty()) { - Object2IntOpenHashMap<String> customDyeColors = SkyblockerConfigManager.get().general.customDyeColors; + if (!itemUuid.isEmpty()) { + Object2IntOpenHashMap<String> customDyeColors = SkyblockerConfigManager.get().general.customDyeColors; - if (hex == null) { - if (customDyeColors.containsKey(itemUuid)) { - customDyeColors.removeInt(itemUuid); - SkyblockerConfigManager.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()); - SkyblockerConfigManager.save(); - source.sendFeedback(Text.translatable("skyblocker.customDyeColors.added")); - } - } else { - source.sendError(Text.translatable("skyblocker.customDyeColors.noItemUuid")); - } + if (hex == null) { + if (customDyeColors.containsKey(itemUuid)) { + customDyeColors.removeInt(itemUuid); + SkyblockerConfigManager.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()); + SkyblockerConfigManager.save(); + source.sendFeedback(Text.translatable("skyblocker.customDyeColors.added")); + } + } else { + source.sendError(Text.translatable("skyblocker.customDyeColors.noItemUuid")); + } } else { source.sendError(Text.translatable("skyblocker.customDyeColors.notDyeable")); return Command.SINGLE_SUCCESS; |