From f9d0c70107eb6b384b4c16ae11368e181774cc1d Mon Sep 17 00:00:00 2001 From: My-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com> Date: Sun, 6 Dec 2020 12:53:58 -0500 Subject: Add stop salvaging starred items --- src/main/java/me/Danker/DankersSkyblockMod.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src/main/java/me/Danker/DankersSkyblockMod.java') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 0ef8ccc..e43a405 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -2896,7 +2896,24 @@ public class DankersSkyblockMod ItemStack item = mouseSlot.getStack(); String inventoryName = inventory.getDisplayName().getUnformattedText(); - if (inventoryName.endsWith(" Chest") && item != null && item.getDisplayName().contains("Open Reward Chest")) { + if(ToggleCommand.stopSalvageStarredToggled && inventoryName.startsWith("Salvage")) { + if(item == null) return; + boolean inSalvageGui = false; + if(item.getDisplayName().contains("Salvage") || item.getDisplayName().contains("Essence")) { + ItemStack salvageItem = inventory.getStackInSlot(13); + if(salvageItem == null) return; + item = salvageItem; + inSalvageGui = true; + } + if (item.getDisplayName().contains("✪") && (mouseSlot.slotNumber > 53 || inSalvageGui)) { + Minecraft.getMinecraft().thePlayer.playSound("note.bass", 1, 0.5f); + Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(ERROR_COLOUR + "Danker's Skyblock Mod has stopped you from salvaging that item!")); + event.setCanceled(true); + return; + } + } + + if (inventoryName.endsWith(" Chest") && item != null && item.getDisplayName().contains("Open Reward Chest")) { List tooltip = item.getTooltip(Minecraft.getMinecraft().thePlayer, Minecraft.getMinecraft().gameSettings.advancedItemTooltips); for (String lineUnclean : tooltip) { String line = StringUtils.stripControlCodes(lineUnclean); -- cgit