aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/Danker/DankersSkyblockMod.java
diff options
context:
space:
mode:
authorMy-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com>2020-12-06 12:53:58 -0500
committerMy-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com>2020-12-06 12:53:58 -0500
commitf9d0c70107eb6b384b4c16ae11368e181774cc1d (patch)
tree602f7fd01eee6a100bb0c809eaf2d046ef285977 /src/main/java/me/Danker/DankersSkyblockMod.java
parent6aa975f84cb8d53717227fb0cb5e28b9d77ae0af (diff)
downloadSkyblockMod-f9d0c70107eb6b384b4c16ae11368e181774cc1d.tar.gz
SkyblockMod-f9d0c70107eb6b384b4c16ae11368e181774cc1d.tar.bz2
SkyblockMod-f9d0c70107eb6b384b4c16ae11368e181774cc1d.zip
Add stop salvaging starred items
Diffstat (limited to 'src/main/java/me/Danker/DankersSkyblockMod.java')
-rw-r--r--src/main/java/me/Danker/DankersSkyblockMod.java19
1 files changed, 18 insertions, 1 deletions
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<String> tooltip = item.getTooltip(Minecraft.getMinecraft().thePlayer, Minecraft.getMinecraft().gameSettings.advancedItemTooltips);
for (String lineUnclean : tooltip) {
String line = StringUtils.stripControlCodes(lineUnclean);