diff options
author | bowser0000 <bowser0000@gmail.com> | 2020-12-17 10:06:19 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-17 10:06:19 -0500 |
commit | d5fcd64708e6f41cdc91e9dbc8b8465099a14a76 (patch) | |
tree | 11ee7a0f36185cdc70e77551915e3da7114811bb /src/main/java/me | |
parent | b0e3055fbe29c4af71927a13726ae4984fb2b500 (diff) | |
parent | 638892cc5fe10a379ae5734b8d6e9e2caff1fa00 (diff) | |
download | SkyblockMod-d5fcd64708e6f41cdc91e9dbc8b8465099a14a76.tar.gz SkyblockMod-d5fcd64708e6f41cdc91e9dbc8b8465099a14a76.tar.bz2 SkyblockMod-d5fcd64708e6f41cdc91e9dbc8b8465099a14a76.zip |
Merge pull request #52 from Quantizr/development
Prevent Placing FoT/Spirit Sceptre on grass/dirt
Diffstat (limited to 'src/main/java/me')
-rw-r--r-- | src/main/java/me/Danker/DankersSkyblockMod.java | 13 | ||||
-rw-r--r-- | src/main/java/me/Danker/commands/DHelpCommand.java | 2 | ||||
-rw-r--r-- | src/main/java/me/Danker/commands/ToggleCommand.java | 11 | ||||
-rw-r--r-- | src/main/java/me/Danker/gui/DankerGui.java | 7 | ||||
-rw-r--r-- | src/main/java/me/Danker/handlers/ConfigHandler.java | 2 |
5 files changed, 32 insertions, 3 deletions
diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index b55131e..86d2087 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -2888,6 +2888,11 @@ public class DankersSkyblockMod Blocks.oak_door, Blocks.skull )); + ArrayList<Block> flowerPlaceable = new ArrayList<>(Arrays.asList( + Blocks.grass, + Blocks.dirt, + Blocks.flower_pot + )); if (Utils.inDungeons) { interactables.add(Blocks.coal_block); interactables.add(Blocks.stained_hardened_clay); @@ -2900,6 +2905,14 @@ public class DankersSkyblockMod event.setCanceled(true); } } + if(flowerPlaceable.contains(block)){ + if (ToggleCommand.flowerWeaponsToggled && item.getDisplayName().contains("Flower of Truth")) { + event.setCanceled(true); + } + if (ToggleCommand.flowerWeaponsToggled && item.getDisplayName().contains("Spirit Sceptre")) { + event.setCanceled(true); + } + } } } diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index b2f6824..f16f598 100644 --- a/src/main/java/me/Danker/commands/DHelpCommand.java +++ b/src/main/java/me/Danker/commands/DHelpCommand.java @@ -34,7 +34,7 @@ public class DHelpCommand extends CommandBase { EnumChatFormatting.GOLD + " Commands, " + EnumChatFormatting.GREEN + " Keybinds.\n" + EnumChatFormatting.GOLD + " /dhelp" + EnumChatFormatting.AQUA + " - Returns this message.\n" + EnumChatFormatting.GOLD + " /dsm" + EnumChatFormatting.AQUA + " - Opens the GUI for Danker's Skyblock Mod.\n" + - EnumChatFormatting.GOLD + " /toggle <gparty/coords/golden/slayercount/rngesusalerts/splitfishing/chatmaddox/spiritbearalerts/aotd/lividdagger/sceptremessages/midasstaffmessages/implosionmessages/healmessages/petcolors/dungeontimer/golemalerts/expertiselore/skill50display/outlinetext/caketimer/lowhealthnotify/lividsolver/stopsalvagestarred/notifyslayerslain/threemanpuzzle/oruopuzzle/blazepuzzle/creeperpuzzle/waterpuzzle/tictactoepuzzle/watchermessage/startswithterminal/selectallterminal/clickinorderterminal/blockwrongterminalclicks/itemframeonsealanterns/ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/list>" + EnumChatFormatting.AQUA + " - Toggles features. /toggle list returns values of every toggle.\n" + + EnumChatFormatting.GOLD + " /toggle <gparty/coords/golden/slayercount/rngesusalerts/splitfishing/chatmaddox/spiritbearalerts/aotd/lividdagger/flowerweapons/sceptremessages/midasstaffmessages/implosionmessages/healmessages/petcolors/dungeontimer/golemalerts/expertiselore/skill50display/outlinetext/caketimer/lowhealthnotify/lividsolver/stopsalvagestarred/notifyslayerslain/threemanpuzzle/oruopuzzle/blazepuzzle/creeperpuzzle/waterpuzzle/tictactoepuzzle/watchermessage/startswithterminal/selectallterminal/clickinorderterminal/blockwrongterminalclicks/itemframeonsealanterns/ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/list>" + EnumChatFormatting.AQUA + " - Toggles features. /toggle list returns values of every toggle.\n" + EnumChatFormatting.GOLD + " /setkey <key>" + EnumChatFormatting.AQUA + " - Sets API key.\n" + EnumChatFormatting.GOLD + " /getkey" + EnumChatFormatting.AQUA + " - Returns key set with /setkey and copies it to your clipboard.\n" + EnumChatFormatting.GOLD + " /loot <zombie/spider/wolf/fishing/catacombs/mythological/> [winter/festival/spooky/f(1-7)/session]" + EnumChatFormatting.AQUA + " - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead.\n" + diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 3b1c04d..dab4ce2 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -39,6 +39,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean stopSalvageStarredToggled; public static boolean watcherReadyToggled; public static boolean swapToPickBlockToggled; + public static boolean flowerWeaponsToggled; public static boolean notifySlayerSlainToggled; // Puzzle Solvers public static boolean threeManToggled; @@ -67,7 +68,7 @@ public class ToggleCommand extends CommandBase implements ICommand { @Override public String getCommandUsage(ICommandSender arg0) { return "/" + getCommandName() + " <gparty/coords/golden/slayercount/rngesusalerts/splitfishing/chatmaddox/spiritbearalert/" + - "aotd/lividdagger/sceptremessages/petcolors/dungeontimer/golemalerts/expertiselore/skill50display/" + + "aotd/lividdagger/flowerweapons/sceptremessages/petcolors/dungeontimer/golemalerts/expertiselore/skill50display/" + "outlinetext/midasstaffmessages/implosionmessages/healmessages/caketimer/lowhealthnotify/" + "lividsolver/stopsalvagestarred/notifyslayerslain/threemanpuzzle/oruopuzzle/blazepuzzle/creeperpuzzle/waterpuzzle/tictactoepuzzle/" + "watchermessage/startswithterminal/selectallterminal/clickinorderterminal/blockwrongterminalclicks/itemframeonsealanterns/ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/list>"; @@ -83,7 +84,7 @@ public class ToggleCommand extends CommandBase implements ICommand { if (args.length == 1) { return getListOfStringsMatchingLastWord(args, "gparty", "coords", "golden", "slayercount", "rngesusalerts", "splitfishing", "chatmaddox", "spiritbearalerts", "aotd", "lividdagger", - "sceptremessages", "petcolors", "dungeontimer", "golemalerts", + "flowerweapons", "sceptremessages", "petcolors", "dungeontimer", "golemalerts", "expertiselore", "skill50display", "outlinetext", "midasstaffmessages", "implosionmessages", "healmessages", "caketimer", "lowhealthnotify", "lividsolver", "stopsalvagestarred", "notifyslayerslain", "threemanpuzzle", "oruopuzzle", "blazepuzzle", @@ -154,6 +155,11 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "LividDagger", lividDaggerToggled); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Block Livid Dagger ability been set to " + DankersSkyblockMod.SECONDARY_COLOUR + lividDaggerToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); break; + case "flowerweapons": + flowerWeaponsToggled = !flowerWeaponsToggled; + ConfigHandler.writeBooleanConfig("toggles", "FlowerWeapons", flowerWeaponsToggled); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Prevent Placing FoT/Spirit Sceptre been set to " + DankersSkyblockMod.SECONDARY_COLOUR + flowerWeaponsToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; case "sceptremessages": sceptreMessages = !sceptreMessages; ConfigHandler.writeBooleanConfig("toggles", "SceptreMessages", sceptreMessages); @@ -326,6 +332,7 @@ public class ToggleCommand extends CommandBase implements ICommand { DankersSkyblockMod.TYPE_COLOUR + " Spirit Bear alerts: " + DankersSkyblockMod.VALUE_COLOUR + spiritBearAlerts + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Block AOTD ability: " + DankersSkyblockMod.VALUE_COLOUR + aotdToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Block Livid Dagger ability: " + DankersSkyblockMod.VALUE_COLOUR + lividDaggerToggled + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Prevent Placing FoT/Spirit Sceptre: " + DankersSkyblockMod.VALUE_COLOUR + flowerWeaponsToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Spirit Sceptre messages: " + DankersSkyblockMod.VALUE_COLOUR + sceptreMessages + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Midas Staff messages: " + DankersSkyblockMod.VALUE_COLOUR + midasStaffMessages + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Implosion messages: " + DankersSkyblockMod.VALUE_COLOUR + implosionMessages + "\n" + diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index ff6d5d0..dbb6c11 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -55,6 +55,7 @@ public class DankerGui extends GuiScreen { private GuiButton lividSolver; private GuiButton stopSalvageStarred; private GuiButton watcherReadyMessage; + private GuiButton flowerWeapons; private GuiButton pickBlock; private GuiButton notifySlayerSlain; @@ -119,6 +120,7 @@ public class DankerGui extends GuiScreen { watcherReadyMessage = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Display Watcher Ready Message: " + Utils.getColouredBoolean(ToggleCommand.watcherReadyToggled)); splitFishing = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Split Fishing Display: " + Utils.getColouredBoolean(ToggleCommand.splitFishing)); notifySlayerSlain = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Notify when Slayer Slain: " + Utils.getColouredBoolean(ToggleCommand.notifySlayerSlainToggled)); + flowerWeapons = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Prevent Placing FoT/Spirit Sceptre: " + Utils.getColouredBoolean(ToggleCommand.flowerWeaponsToggled)); switch (page) { case 1: @@ -169,6 +171,7 @@ public class DankerGui extends GuiScreen { this.buttonList.add(watcherReadyMessage); this.buttonList.add(splitFishing); this.buttonList.add(notifySlayerSlain); + this.buttonList.add(flowerWeapons); this.buttonList.add(backPage); break; } @@ -325,6 +328,10 @@ public class DankerGui extends GuiScreen { ToggleCommand.swapToPickBlockToggled = !ToggleCommand.swapToPickBlockToggled; ConfigHandler.writeBooleanConfig("toggles", "PickBlock", ToggleCommand.swapToPickBlockToggled); pickBlock.displayString = "Auto-Swap to Pick Block: " + Utils.getColouredBoolean(ToggleCommand.swapToPickBlockToggled); + } else if (button == flowerWeapons) { + ToggleCommand.flowerWeaponsToggled = !ToggleCommand.flowerWeaponsToggled; + ConfigHandler.writeBooleanConfig("toggles", "FlowerWeapons", ToggleCommand.flowerWeaponsToggled); + flowerWeapons.displayString = "Prevent Placing FoT/Spirit Sceptre: " + Utils.getColouredBoolean(ToggleCommand.flowerWeaponsToggled); } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 531d631..7bf6ce2 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -194,6 +194,7 @@ public class ConfigHandler { if (!hasKey("toggles", "StopSalvageStarred")) writeBooleanConfig("toggles", "StopSalvageStarred", false); if (!hasKey("toggles", "WatcherReadyMessage")) writeBooleanConfig("toggles", "WatcherReadyMessage", false); if (!hasKey("toggles", "PickBlock")) writeBooleanConfig("toggles", "PickBlock", false); + if (!hasKey("toggles", "FlowerWeapons")) writeBooleanConfig("toggles", "FlowerWeapons", false); if (!hasKey("toggles", "NotifySlayerSlain")) writeBooleanConfig("toggles", "NotifySlayerSlain", false); // Puzzle Solvers if (!hasKey("toggles", "ThreeManPuzzle")) writeBooleanConfig("toggles", "ThreeManPuzzle", false); @@ -462,6 +463,7 @@ public class ConfigHandler { ToggleCommand.watcherReadyToggled = getBoolean("toggles", "WatcherReadyMessage"); ToggleCommand.notifySlayerSlainToggled = getBoolean("toggles", "NotifySlayerSlain"); ToggleCommand.swapToPickBlockToggled = getBoolean("toggles", "PickBlock"); + ToggleCommand.flowerWeaponsToggled = getBoolean("toggles", "FlowerWeapons"); // Puzzle Solvers ToggleCommand.threeManToggled = getBoolean("toggles", "ThreeManPuzzle"); ToggleCommand.oruoToggled = getBoolean("toggles", "OruoPuzzle"); |