diff options
Diffstat (limited to 'src/main/java')
15 files changed, 646 insertions, 29 deletions
diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 7aceb20..9fb7876 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -102,10 +102,14 @@ public class DankersSkyblockMod { MinecraftForge.EVENT_BUS.register(this); MinecraftForge.EVENT_BUS.register(new AbilityCooldowns()); MinecraftForge.EVENT_BUS.register(new ArachneESP()); + MinecraftForge.EVENT_BUS.register(new ArrowTerminalSolver()); MinecraftForge.EVENT_BUS.register(new AutoAcceptReparty()); MinecraftForge.EVENT_BUS.register(new AutoDisplay()); MinecraftForge.EVENT_BUS.register(new AutoSwapToPickBlock()); MinecraftForge.EVENT_BUS.register(new BlazeSolver()); + MinecraftForge.EVENT_BUS.register(new BlockPlacingFlowers()); + MinecraftForge.EVENT_BUS.register(new BlockWrongSlayer()); + MinecraftForge.EVENT_BUS.register(new BlockWrongTerminalClicks()); MinecraftForge.EVENT_BUS.register(new BonzoMaskTimer()); MinecraftForge.EVENT_BUS.register(new BoulderSolver()); MinecraftForge.EVENT_BUS.register(new CakeTimer()); @@ -187,6 +191,7 @@ public class DankersSkyblockMod { public void preInit(final FMLPreInitializationEvent event) { ClientCommandHandler.instance.registerCommand(new ArmourCommand()); ClientCommandHandler.instance.registerCommand(new BankCommand()); + ClientCommandHandler.instance.registerCommand(new BlockSlayerCommand()); ClientCommandHandler.instance.registerCommand(new CustomMusicCommand()); ClientCommandHandler.instance.registerCommand(new CrystalHollowWaypointCommand()); ClientCommandHandler.instance.registerCommand(new DHelpCommand()); @@ -429,6 +434,9 @@ public class DankersSkyblockMod { case "displaygui": mc.displayGuiScreen(new DisplayGui()); break; + case "onlyslayergui": + mc.displayGuiScreen(new OnlySlayerGui()); + break; case "editlocations": mc.displayGuiScreen(new EditLocationsGui()); break; diff --git a/src/main/java/me/Danker/commands/BlockSlayerCommand.java b/src/main/java/me/Danker/commands/BlockSlayerCommand.java new file mode 100644 index 0000000..9f51be6 --- /dev/null +++ b/src/main/java/me/Danker/commands/BlockSlayerCommand.java @@ -0,0 +1,105 @@ +package me.Danker.commands; + +import me.Danker.DankersSkyblockMod; +import me.Danker.features.BlockWrongSlayer; +import me.Danker.handlers.ConfigHandler; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentText; + +import java.util.List; + +public class BlockSlayerCommand extends CommandBase { + + @Override + public String getCommandName() { + return "onlyslayer"; + } + + @Override + public String getCommandUsage(ICommandSender arg0) { + return "/" + getCommandName() + " <zombie/spider/wolf/enderman> <1/2/3/4/5>"; + } + + public static String usage(ICommandSender arg0) { + return new BlockSlayerCommand().getCommandUsage(arg0); + } + + @Override + public int getRequiredPermissionLevel() { + return 0; + } + + @Override + public List<String> addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { + if (args.length == 1) { + return getListOfStringsMatchingLastWord(args, "zombie", "spider", "wolf", "enderman"); + } else if (args.length == 2) { + return getListOfStringsMatchingLastWord(args, "1", "2", "3", "4", "5"); + } + return null; + } + + @Override + public void processCommand(ICommandSender arg0, String[] arg1) throws CommandException { + final EntityPlayer player = (EntityPlayer)arg0; + + if (arg1.length == 0 || (arg1.length == 1 && !arg1[0].equalsIgnoreCase("off"))) { + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); + return; + } + + switch (arg1[0].toLowerCase()) { + case "zombie": + BlockWrongSlayer.onlySlayerName = "Revenant Horror"; + break; + case "spider": + BlockWrongSlayer.onlySlayerName = "Tarantula Broodfather"; + break; + case "wolf": + BlockWrongSlayer.onlySlayerName = "Sven Packmaster"; + break; + case "off": + BlockWrongSlayer.onlySlayerName = ""; + BlockWrongSlayer.onlySlayerNumber = ""; + ConfigHandler.writeStringConfig("toggles", "BlockSlayer", ""); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Slayer blocking turned off.")); + return; + default: + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); + return; + } + + int slayerNumber = Integer.parseInt(arg1[1]); + // Just manually set to roman numeral, I don't wanna put a whole converter in here + switch (slayerNumber) { + case 1: + BlockWrongSlayer.onlySlayerNumber = "I"; + break; + case 2: + BlockWrongSlayer.onlySlayerNumber = "II"; + break; + case 3: + BlockWrongSlayer.onlySlayerNumber = "III"; + break; + case 4: + BlockWrongSlayer.onlySlayerNumber = "IV"; + break; + case 5: + BlockWrongSlayer.onlySlayerNumber = "V"; + break; + default: + BlockWrongSlayer.onlySlayerName = ""; + BlockWrongSlayer.onlySlayerNumber = ""; + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0))); + return; + } + + ConfigHandler.writeStringConfig("toggles", "BlockSlayer", BlockWrongSlayer.onlySlayerName + " " + BlockWrongSlayer.onlySlayerNumber); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Slayer blocking set to " + DankersSkyblockMod.SECONDARY_COLOUR + BlockWrongSlayer.onlySlayerName + " " + BlockWrongSlayer.onlySlayerNumber)); + } + +} diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java index ea3a5e3..d960237 100644 --- a/src/main/java/me/Danker/commands/DHelpCommand.java +++ b/src/main/java/me/Danker/commands/DHelpCommand.java @@ -53,6 +53,7 @@ public class DHelpCommand extends CommandBase { EnumChatFormatting.GOLD + WeightCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to get weight of a person. If no name is provided, it checks yours. Adding lily uses lily's weight instead of Senither's.\n" + EnumChatFormatting.GOLD + ImportFishingCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Imports your fishing stats from your latest profile to your fishing tracker using the API.\n" + EnumChatFormatting.GOLD + SkyblockPlayersCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to find how many players are on each Skyblock island.\n" + + EnumChatFormatting.GOLD + BlockSlayerCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Stops you from starting a slayer quest other than the one specified.\n" + EnumChatFormatting.GOLD + SkillTrackerCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Text display for skill xp/hour.\n" + EnumChatFormatting.GOLD + LobbyBankCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Uses API to find the average bank total of the lobby, as well the three players with the highest total money in the bank(and purse).\n" + EnumChatFormatting.GOLD + RepartyCommand.usage(arg0) + EnumChatFormatting.AQUA + " - Disbands and reparties all members in the party.\n" + diff --git a/src/main/java/me/Danker/commands/DankerGuiCommand.java b/src/main/java/me/Danker/commands/DankerGuiCommand.java index 0f3b527..0bf82f9 100644 --- a/src/main/java/me/Danker/commands/DankerGuiCommand.java +++ b/src/main/java/me/Danker/commands/DankerGuiCommand.java @@ -57,6 +57,7 @@ public class DankerGuiCommand extends CommandBase { debug.append("[splitfishing][").append(ToggleCommand.splitFishing).append("]\n"); debug.append("[chatmaddox][").append(ToggleCommand.chatMaddoxToggled).append("]\n"); debug.append("[spiritbearalerts][").append(ToggleCommand.spiritBearAlerts).append("]\n"); + debug.append("[flowerweapons][").append(ToggleCommand.flowerWeaponsToggled).append("]\n"); debug.append("[sceptremessages][").append(ToggleCommand.sceptreMessages).append("]\n"); debug.append("[petcolors][").append(ToggleCommand.petColoursToggled).append("]\n"); debug.append("[dungeontimer][").append(ToggleCommand.dungeonTimerToggled).append("]\n"); @@ -92,6 +93,8 @@ public class DankerGuiCommand extends CommandBase { debug.append("[startswithterminal][").append(ToggleCommand.startsWithToggled).append("]\n"); debug.append("[selectallterminal][").append(ToggleCommand.selectAllToggled).append("]\n"); debug.append("[clickinorderterminal][").append(ToggleCommand.clickInOrderToggled).append("]\n"); + debug.append("[blockwrongterminalclicks][").append(ToggleCommand.blockWrongTerminalClicksToggled).append("]\n"); + debug.append("[itemframeonsealanterns][").append(ToggleCommand.itemFrameOnSeaLanternsToggled).append("]\n"); debug.append("[ultrasequencer][").append(ToggleCommand.ultrasequencerToggled).append("]\n"); debug.append("[chronomatron][").append(ToggleCommand.chronomatronToggled).append("]\n"); debug.append("[superpairs][").append(ToggleCommand.superpairsToggled).append("]\n"); diff --git a/src/main/java/me/Danker/commands/ToggleCommand.java b/src/main/java/me/Danker/commands/ToggleCommand.java index 0255915..321458e 100644 --- a/src/main/java/me/Danker/commands/ToggleCommand.java +++ b/src/main/java/me/Danker/commands/ToggleCommand.java @@ -54,12 +54,12 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean cooldownMessages; public static boolean manaMessages; public static boolean killComboMessages; - // Dungeons Messages public static boolean lowHealthNotifyToggled; public static boolean lividSolverToggled; public static boolean stopSalvageStarredToggled; public static boolean watcherReadyToggled; public static boolean swapToPickBlockToggled; + public static boolean flowerWeaponsToggled; public static boolean notifySlayerSlainToggled; public static boolean necronNotificationsToggled; public static boolean bonzoTimerToggled; @@ -79,6 +79,8 @@ public class ToggleCommand extends CommandBase implements ICommand { public static boolean startsWithToggled; public static boolean selectAllToggled; public static boolean clickInOrderToggled; + public static boolean blockWrongTerminalClicksToggled; + public static boolean itemFrameOnSeaLanternsToggled; // Experiments public static boolean ultrasequencerToggled; public static boolean chronomatronToggled; @@ -109,23 +111,11 @@ public class ToggleCommand extends CommandBase implements ICommand { @Override public String getCommandUsage(ICommandSender arg0) { - return "/" + getCommandName() + " <gparty/coords/golden/slayercount/rngesusalerts/splitfishing/ghostdisplay/chatmaddox/spiritbearalert/" + - "sceptremessages/petcolors/dungeontimer/golemalerts/expertiselore/" + //ghosttimer - "skill50display/outlinetext/midasstaffmessages/implosionmessages/healmessages/cooldownmessages/" + - "manamessages/killcombomessages/caketimer/lowhealthnotify/lividsolver/stopsalvagestarred/" + - "notifyslayerslain/necronnotifications/bonzotimer/threemanpuzzle/oruopuzzle/blazepuzzle/" + - "creeperpuzzle/creeperlines/waterpuzzle/tictactoepuzzle/boulderpuzzle/silverfishpuzzle/icewalkpuzzle/watchermessage/" + - "startswithterminal/selectallterminal/clickinorderterminal/" + - "ultrasequencer/chronomatron/superpairs/hidetooltipsinaddons/pickblock/" + - "melodytooltips/highlightslayers/highlightarachne/highlightskeletonmasters/teammatesinradius/" + - "gianthp/hidepetcandy/customcolorednames/endoffarmalert/gemstonelore/crystalhollowwaypoints/crystalautowaypoints/" + - "autoacceptreparty/abilitycooldowns/dungeonbossmusic/bloodroommusic/dungeonmusic/hubmusic/islandmusic/dungeonhubmusic/" + - "farmingislandsmusic/goldminemusic/deepcavernsmusic/crystalhollowsmusic/spidersdenmusic/blazingfortressmusic/endmusic/" + - "parkmusic/list>"; + return "/" + getCommandName() + " <too many to list>"; } public static String usage(ICommandSender arg0) { - return "/toggle <too many to list>"; + return new ToggleCommand().getCommandUsage(arg0); } @Override @@ -137,7 +127,7 @@ public class ToggleCommand extends CommandBase implements ICommand { public List<String> addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { if (args.length == 1) { return getListOfStringsMatchingLastWord(args, "gparty", "coords", "golden", "slayercount", "rngesusalerts", "highlightArachne", - "splitfishing", "chatmaddox", "spiritbearalerts", + "splitfishing", "chatmaddox", "spiritbearalerts", "flowerweapons", "sceptremessages", "petcolors", "dungeontimer", "golemalerts", "expertiselore", "skill50display", "outlinetext", "midasstaffmessages", "implosionmessages", "healmessages", "cooldownmessages", "manamessages", @@ -146,8 +136,8 @@ public class ToggleCommand extends CommandBase implements ICommand { "bonzotimer", "threemanpuzzle", "oruopuzzle", "blazepuzzle", "creeperpuzzle", "creeperlines", "waterpuzzle", "tictactoepuzzle", "boulderpuzzle", "silverfishpuzzle", "icewalkpuzzle", "watchermessage", "startswithterminal", - "selectallterminal", "clickinorderterminal", - "ultrasequencer", "chronomatron", "superpairs", + "selectallterminal", "clickinorderterminal", "blockwrongterminalclicks", + "ultrasequencer", "chronomatron", "superpairs", "itemframeonsealanterns", "hidetooltipsinaddons", "pickblock", "melodytooltips", "highlightslayers", "highlightskeletonmasters", "dungeonbossmusic", "bloodroommusic", "dungeonmusic", "teammatesinradius", "gianthp", "hidepetcandy", "customcolorednames", "endoffarmalert", @@ -219,6 +209,11 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "SceptreMessages", sceptreMessages); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Spirit Sceptre messages have been set to " + DankersSkyblockMod.SECONDARY_COLOUR + sceptreMessages + 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 "midasstaffmessages": midasStaffMessages = !midasStaffMessages; ConfigHandler.writeBooleanConfig("toggles", "MidasStaffMessages", midasStaffMessages); @@ -395,6 +390,16 @@ public class ToggleCommand extends CommandBase implements ICommand { ConfigHandler.writeBooleanConfig("toggles", "ClickInOrderTerminal", clickInOrderToggled); player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Click in order terminal helper has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + selectAllToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); break; + case "blockwrongterminalclicks": + blockWrongTerminalClicksToggled = !blockWrongTerminalClicksToggled; + ConfigHandler.writeBooleanConfig("toggles", "BlockWrongTerminalClicks", blockWrongTerminalClicksToggled); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Block wrong clicks on terminals has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + blockWrongTerminalClicksToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; + case "itemframeonsealanterns": + itemFrameOnSeaLanternsToggled = !itemFrameOnSeaLanternsToggled; + ConfigHandler.writeBooleanConfig("toggles", "IgnoreItemFrameOnSeaLanterns", itemFrameOnSeaLanternsToggled); + player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Ignore item frames on sea lanterns has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + itemFrameOnSeaLanternsToggled + DankersSkyblockMod.MAIN_COLOUR + ".")); + break; case "ultrasequencer": ultrasequencerToggled = !ultrasequencerToggled; ConfigHandler.writeBooleanConfig("toggles", "UltraSequencer", ultrasequencerToggled); @@ -590,6 +595,7 @@ public class ToggleCommand extends CommandBase implements ICommand { DankersSkyblockMod.TYPE_COLOUR + " Split fishing display: " + DankersSkyblockMod.VALUE_COLOUR + splitFishing + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Chat Maddox menu: " + DankersSkyblockMod.VALUE_COLOUR + chatMaddoxToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Spirit Bear alerts: " + DankersSkyblockMod.VALUE_COLOUR + spiritBearAlerts + "\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" + @@ -619,6 +625,7 @@ public class ToggleCommand extends CommandBase implements ICommand { DankersSkyblockMod.TYPE_COLOUR + " Watcher ready message: " + DankersSkyblockMod.VALUE_COLOUR + watcherReadyToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Starts with letter terminal solver: " + DankersSkyblockMod.VALUE_COLOUR + startsWithToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Select all color items terminal solver: " + DankersSkyblockMod.VALUE_COLOUR + selectAllToggled + "\n" + + DankersSkyblockMod.TYPE_COLOUR + " Ignore item frames on sea lanterns: " + DankersSkyblockMod.VALUE_COLOUR + itemFrameOnSeaLanternsToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Ultra sequencer solver: " + DankersSkyblockMod.VALUE_COLOUR + ultrasequencerToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Chronomatron solver: " + DankersSkyblockMod.VALUE_COLOUR + chronomatronToggled + "\n" + DankersSkyblockMod.TYPE_COLOUR + " Superpairs solver: " + DankersSkyblockMod.VALUE_COLOUR + superpairsToggled + "\n" + diff --git a/src/main/java/me/Danker/features/BlockPlacingFlowers.java b/src/main/java/me/Danker/features/BlockPlacingFlowers.java new file mode 100644 index 0000000..580c010 --- /dev/null +++ b/src/main/java/me/Danker/features/BlockPlacingFlowers.java @@ -0,0 +1,45 @@ +package me.Danker.features; + +import me.Danker.commands.ToggleCommand; +import me.Danker.utils.Utils; +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraftforge.event.entity.player.PlayerInteractEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +import java.util.ArrayList; +import java.util.Arrays; + +public class BlockPlacingFlowers { + + ArrayList<Block> flowerPlaceable = new ArrayList<>(Arrays.asList( + Blocks.grass, + Blocks.dirt, + Blocks.flower_pot, + Blocks.tallgrass, + Blocks.double_plant + )); + + @SubscribeEvent + public void onInteract(PlayerInteractEvent event) { + if (!Utils.inSkyblock || Minecraft.getMinecraft().thePlayer != event.entityPlayer) return; + ItemStack item = event.entityPlayer.getHeldItem(); + if (item == null) return; + + if (event.action == PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) { + Block block = Minecraft.getMinecraft().theWorld.getBlockState(event.pos).getBlock(); + + 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/features/BlockWrongSlayer.java b/src/main/java/me/Danker/features/BlockWrongSlayer.java new file mode 100644 index 0000000..4e19053 --- /dev/null +++ b/src/main/java/me/Danker/features/BlockWrongSlayer.java @@ -0,0 +1,42 @@ +package me.Danker.features; + +import me.Danker.DankersSkyblockMod; +import me.Danker.events.ChestSlotClickedEvent; +import net.minecraft.client.Minecraft; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ChatComponentText; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +public class BlockWrongSlayer { + + public static String onlySlayerName = ""; + public static String onlySlayerNumber = ""; + + @SubscribeEvent + public void onSlotClick(ChestSlotClickedEvent event) { + String inventoryName = event.inventoryName; + ItemStack item = event.item; + if (!onlySlayerName.equals("") && item != null) { + if (inventoryName.equals("Slayer")) { + if (!item.getDisplayName().contains("Revenant Horror") && !item.getDisplayName().contains("Tarantula Broodfather") && !item.getDisplayName().contains("Sven Packmaster")) + return; + if (!item.getDisplayName().contains(onlySlayerName)) { + Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Danker's Skyblock Mod has stopped you from starting this quest (Set to " + onlySlayerName + " " + onlySlayerNumber + ")")); + Minecraft.getMinecraft().thePlayer.playSound("note.bass", 1, (float) 0.5); + event.setCanceled(true); + } + } else if (inventoryName.equals("Revenant Horror") || inventoryName.equals("Tarantula Broodfather") || inventoryName.equals("Sven Packmaster") || inventoryName.equals("Voidgloom Seraph")) { + if (item.getDisplayName().contains("Revenant Horror") || item.getDisplayName().contains("Tarantula Broodfather") || item.getDisplayName().contains("Sven Packmaster") || item.getDisplayName().contains("Voidgloom Seraph")) { + // Only check number as they passed the above check + String slayerNumber = item.getDisplayName().substring(item.getDisplayName().lastIndexOf(" ") + 1); + if (!slayerNumber.equals(onlySlayerNumber)) { + Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Danker's Skyblock Mod has stopped you from starting this quest (Set to " + onlySlayerName + " " + onlySlayerNumber + ")")); + Minecraft.getMinecraft().thePlayer.playSound("note.bass", 1, (float) 0.5); + event.setCanceled(true); + } + } + } + } + } + +} diff --git a/src/main/java/me/Danker/features/puzzlesolvers/ArrowTerminalSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/ArrowTerminalSolver.java new file mode 100644 index 0000000..14870f2 --- /dev/null +++ b/src/main/java/me/Danker/features/puzzlesolvers/ArrowTerminalSolver.java @@ -0,0 +1,55 @@ +package me.Danker.features.puzzlesolvers; + +import me.Danker.commands.ToggleCommand; +import me.Danker.events.PacketWriteEvent; +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItemFrame; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.network.play.client.C02PacketUseEntity; +import net.minecraft.util.BlockPos; +import net.minecraftforge.event.entity.player.EntityInteractEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +public class ArrowTerminalSolver { + + @SubscribeEvent + public void onEntityInteract(EntityInteractEvent event) { + Minecraft mc = Minecraft.getMinecraft(); + if (mc.thePlayer != event.entityPlayer) return; + + if (ToggleCommand.itemFrameOnSeaLanternsToggled && Utils.inDungeons && event.target instanceof EntityItemFrame) { + EntityItemFrame itemFrame = (EntityItemFrame) event.target; + ItemStack item = itemFrame.getDisplayedItem(); + if (item == null || item.getItem() != Items.arrow) return; + BlockPos blockPos = Utils.getBlockUnderItemFrame(itemFrame); + if (mc.theWorld.getBlockState(blockPos).getBlock() == Blocks.sea_lantern) { + event.setCanceled(true); + } + } + } + + @SubscribeEvent + public void onPacket(PacketWriteEvent event) { + if (ToggleCommand.itemFrameOnSeaLanternsToggled && Utils.inDungeons && event.packet instanceof C02PacketUseEntity) { + Minecraft mc = Minecraft.getMinecraft(); + C02PacketUseEntity packet = (C02PacketUseEntity) event.packet; + Entity entityHit = packet.getEntityFromWorld(mc.theWorld); + if (entityHit instanceof EntityItemFrame) { + EntityItemFrame itemFrame = (EntityItemFrame) entityHit; + ItemStack item = itemFrame.getDisplayedItem(); + if (item != null && item.getItem() == Items.arrow) { + BlockPos blockPos = Utils.getBlockUnderItemFrame(itemFrame); + if (mc.theWorld.getBlockState(blockPos).getBlock() == Blocks.sea_lantern) { + event.setCanceled(true); + } + } + } + } + + } + +} diff --git a/src/main/java/me/Danker/features/puzzlesolvers/BlockWrongTerminalClicks.java b/src/main/java/me/Danker/features/puzzlesolvers/BlockWrongTerminalClicks.java new file mode 100644 index 0000000..5176e8b --- /dev/null +++ b/src/main/java/me/Danker/features/puzzlesolvers/BlockWrongTerminalClicks.java @@ -0,0 +1,112 @@ +package me.Danker.features.puzzlesolvers; + +import me.Danker.commands.ToggleCommand; +import me.Danker.events.ChestSlotClickedEvent; +import me.Danker.utils.Utils; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.StringUtils; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import org.lwjgl.input.Keyboard; + +public class BlockWrongTerminalClicks { + + @SubscribeEvent + public void onSlotClick(ChestSlotClickedEvent event) { + if (ToggleCommand.blockWrongTerminalClicksToggled && Utils.inDungeons) { + IInventory inventory = event.inventory; + String inventoryName = event.inventoryName; + Slot slot = event.slot; + ItemStack item = event.item; + boolean shouldCancel = false; + + if (item == null) return; + + //most of these are extra but who cares + + switch (inventoryName) { + case "Correct all the panes!": + shouldCancel = !StringUtils.stripControlCodes(item.getDisplayName()).startsWith("Off"); + break; + case "Navigate the maze!": + if (item.getItem() != Item.getItemFromBlock(Blocks.stained_glass_pane)) { + shouldCancel = true; + break; + } + + if (item.getItemDamage() != 0) { + shouldCancel = true; + break; + } + + boolean isValid = false; + + int slotIndex = slot.getSlotIndex(); + + if (slotIndex % 9 != 8 && slotIndex != 53) { + ItemStack itemStack = inventory.getStackInSlot(slotIndex + 1); + if (itemStack != null && itemStack.getItemDamage() == 5) isValid = true; + } + + if (!isValid && slotIndex % 9 != 0 && slotIndex != 0) { + ItemStack itemStack = inventory.getStackInSlot(slotIndex - 1); + if (itemStack != null && itemStack.getItemDamage() == 5) isValid = true; + } + + if (!isValid && slotIndex <= 44) { + ItemStack itemStack = inventory.getStackInSlot(slotIndex + 9); + if (itemStack != null && itemStack.getItemDamage() == 5) isValid = true; + } + + if (!isValid && slotIndex >= 9) { + ItemStack itemStack = inventory.getStackInSlot(slotIndex - 9); + if (itemStack != null && itemStack.getItemDamage() == 5) isValid = true; + } + + shouldCancel = !isValid; + + break; + case "Click in order!": + + if (slot.getSlotIndex() > 35) { + break; + } + + if ((item.getItem() != Item.getItemFromBlock(Blocks.stained_glass_pane))) { + shouldCancel = true; + break; + } + if (item.getItemDamage() != 14) { + shouldCancel = true; + break; + } + int needed = ClickInOrderSolver.terminalNumberNeeded[0]; + if (needed == 0) break; + shouldCancel = needed != -1 && item.stackSize != needed; + break; + } + + if (!shouldCancel) { + if (inventoryName.startsWith("What starts with:")) { + char letter = inventoryName.charAt(inventoryName.indexOf("'") + 1); + shouldCancel = !(StringUtils.stripControlCodes(item.getDisplayName()).charAt(0) == letter); + } else if (inventoryName.startsWith("Select all the")) { + if (SelectAllColourSolver.terminalColorNeeded == null) return; + String itemName = StringUtils.stripControlCodes(item.getDisplayName()).toUpperCase(); + shouldCancel = !(itemName.contains(SelectAllColourSolver.terminalColorNeeded) || + (SelectAllColourSolver.terminalColorNeeded.equals("SILVER") && itemName.contains("LIGHT GRAY")) || + (SelectAllColourSolver.terminalColorNeeded.equals("WHITE") && (itemName.equals("WOOL") || itemName.equals("BONE MEAL"))) || + (SelectAllColourSolver.terminalColorNeeded.equals("BLACK") && itemName.equals("INK SACK")) || + (SelectAllColourSolver.terminalColorNeeded.equals("BLUE") && itemName.equals("LAPIS LAZULI")) || + (SelectAllColourSolver.terminalColorNeeded.equals("BROWN") && itemName.equals("COCOA BEAN"))); + } + } + + event.setCanceled(shouldCancel && !Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) && !Keyboard.isKeyDown(Keyboard.KEY_RCONTROL)); + } + } + +} diff --git a/src/main/java/me/Danker/features/puzzlesolvers/ChronomatronSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/ChronomatronSolver.java index 51ffd0d..52da0ec 100644 --- a/src/main/java/me/Danker/features/puzzlesolvers/ChronomatronSolver.java +++ b/src/main/java/me/Danker/features/puzzlesolvers/ChronomatronSolver.java @@ -15,6 +15,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.StringUtils; import net.minecraftforge.client.event.GuiOpenEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import org.lwjgl.input.Keyboard; import java.util.ArrayList; import java.util.List; @@ -32,10 +33,22 @@ public class ChronomatronSolver { if (ToggleCommand.chronomatronToggled && event.inventoryName.startsWith("Chronomatron (")) { IInventory inventory = event.inventory; ItemStack item = event.item; - if (item == null) return; + + if (item == null) { + if (event.isCancelable() && !Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) && !Keyboard.isKeyDown(Keyboard.KEY_RCONTROL)) { + event.setCanceled(true); + } + return; + } if (inventory.getStackInSlot(49).getDisplayName().startsWith("§7Timer: §a") && (item.getItem() == Item.getItemFromBlock(Blocks.stained_glass) || item.getItem() == Item.getItemFromBlock(Blocks.stained_hardened_clay))) { - chronomatronMouseClicks++; + if (chronomatronPattern.size() > chronomatronMouseClicks && !item.getDisplayName().equals(chronomatronPattern.get(chronomatronMouseClicks))) { + if (event.isCancelable() && !Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) && !Keyboard.isKeyDown(Keyboard.KEY_RCONTROL)) { + event.setCanceled(true); + } + } + } else if (inventory.getStackInSlot(49).getDisplayName().startsWith("§aRemember the pattern!")) { + if (event.isCancelable()) event.setCanceled(true); } } } diff --git a/src/main/java/me/Danker/features/puzzlesolvers/UltrasequencerSolver.java b/src/main/java/me/Danker/features/puzzlesolvers/UltrasequencerSolver.java index a3a97b6..6608555 100644 --- a/src/main/java/me/Danker/features/puzzlesolvers/UltrasequencerSolver.java +++ b/src/main/java/me/Danker/features/puzzlesolvers/UltrasequencerSolver.java @@ -1,17 +1,20 @@ package me.Danker.features.puzzlesolvers; import me.Danker.commands.ToggleCommand; +import me.Danker.events.ChestSlotClickedEvent; import me.Danker.events.GuiChestBackgroundDrawnEvent; import me.Danker.utils.RenderUtils; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.client.gui.inventory.GuiChest; import net.minecraft.inventory.ContainerChest; +import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.util.StringUtils; import net.minecraftforge.client.event.GuiOpenEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; +import org.lwjgl.input.Keyboard; import java.util.List; @@ -50,6 +53,27 @@ public class UltrasequencerSolver { } @SubscribeEvent + public void onSlotClick(ChestSlotClickedEvent event) { + if (ToggleCommand.ultrasequencerToggled && event.inventoryName.startsWith("Ultrasequencer (")) { + IInventory inventory = event.inventory; + if (event.item == null) { + if (event.isCancelable() && !Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) && !Keyboard.isKeyDown(Keyboard.KEY_RCONTROL)) + event.setCanceled(true); + return; + } + if (inventory.getStackInSlot(49).getDisplayName().equals("§aRemember the pattern!")) { + if (event.isCancelable()) event.setCanceled(true); + } else if (inventory.getStackInSlot(49).getDisplayName().startsWith("§7Timer: §a")) { + if (clickInOrderSlots[lastUltraSequencerClicked] != null && event.slot.getSlotIndex() != clickInOrderSlots[lastUltraSequencerClicked].getSlotIndex()) { + if (event.isCancelable() && !Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) && !Keyboard.isKeyDown(Keyboard.KEY_RCONTROL)) { + event.setCanceled(true); + } + } + } + } + } + + @SubscribeEvent public void onGuiRender(GuiChestBackgroundDrawnEvent event) { if (ToggleCommand.ultrasequencerToggled && event.displayName.startsWith("Ultrasequencer (")) { List<Slot> invSlots = event.slots; diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java index 7f407a6..acd997e 100644 --- a/src/main/java/me/Danker/gui/DankerGui.java +++ b/src/main/java/me/Danker/gui/DankerGui.java @@ -37,6 +37,7 @@ public class DankerGui extends GuiScreen { private GuiTextField search; private GuiButton changeDisplay; + private GuiButton onlySlayer; private GuiButton puzzleSolvers; private GuiButton experimentationTableSolvers; private GuiButton skillTracker; @@ -72,6 +73,14 @@ public class DankerGui extends GuiScreen { private GuiButton gemstoneLore; private GuiButton autoAcceptReparty; private GuiButton abilityCooldown; + private GuiButton dungeonTimer; + private GuiButton lowHealthNotify; + private GuiButton lividSolver; + private GuiButton stopSalvageStarred; + private GuiButton watcherReadyMessage; + private GuiButton flowerWeapons; + private GuiButton necronNotifications; + private GuiButton bonzoTimer; // Chat Messages private GuiButton sceptreMessages; private GuiButton midasStaffMessages; @@ -80,14 +89,6 @@ public class DankerGui extends GuiScreen { private GuiButton cooldownMessages; private GuiButton manaMessages; private GuiButton killComboMessages; - // Dungeons - private GuiButton dungeonTimer; - private GuiButton lowHealthNotify; - private GuiButton lividSolver; - private GuiButton stopSalvageStarred; - private GuiButton watcherReadyMessage; - private GuiButton necronNotifications; - private GuiButton bonzoTimer; public DankerGui(int page, String searchText) { this.page = page; @@ -117,6 +118,7 @@ public class DankerGui extends GuiScreen { search = new GuiTextField(0, this.fontRendererObj, width - 202, 5, 200, 20); changeDisplay = new GuiButton(0, 0, 0, "Change Display Settings"); + onlySlayer = new GuiButton(0, 0, 0, "Set Slayer Quest"); puzzleSolvers = new GuiButton(0, 0, 0, "Toggle Dungeons Puzzle Solvers"); experimentationTableSolvers = new GuiButton(0, 0, 0, "Toggle Experimentation Table Solvers"); skillTracker = new GuiButton(0, 0, 0, "Toggle Skill XP/Hour Tracking"); @@ -149,6 +151,7 @@ public class DankerGui extends GuiScreen { dungeonTimer = new FeatureButton("Display Dungeon Timers: " + Utils.getColouredBoolean(ToggleCommand.dungeonTimerToggled), "Displays timing of certain dungeon objectives and other information."); stopSalvageStarred = new FeatureButton("Stop Salvaging Starred Items: " + Utils.getColouredBoolean(ToggleCommand.stopSalvageStarredToggled), "Blocks salvaging starred items."); watcherReadyMessage = new FeatureButton("Display Watcher Ready Message: " + Utils.getColouredBoolean(ToggleCommand.watcherReadyToggled), "Alerts when Watcher finishes spawning mobs."); + flowerWeapons = new FeatureButton("Prevent Placing FoT/Spirit Sceptre: " + Utils.getColouredBoolean(ToggleCommand.flowerWeaponsToggled), "Blocks placing Flower of Truth or Spirit Sceptre."); notifySlayerSlain = new FeatureButton("Notify when Slayer Slain: " + Utils.getColouredBoolean(ToggleCommand.notifySlayerSlainToggled), "Alerts when slayer boss has been slain."); necronNotifications = new FeatureButton("Necron Phase Notifications: " + Utils.getColouredBoolean(ToggleCommand.necronNotificationsToggled), "Creates alert on different phases of the Necron fight."); bonzoTimer = new FeatureButton("Bonzo's Mask Timer: " + Utils.getColouredBoolean(ToggleCommand.bonzoTimerToggled), "Displays cooldown of Bonzo Mask ability."); @@ -168,6 +171,7 @@ public class DankerGui extends GuiScreen { allButtons.clear(); allButtons.add(changeDisplay); + allButtons.add(onlySlayer); allButtons.add(puzzleSolvers); allButtons.add(experimentationTableSolvers); allButtons.add(skillTracker); @@ -200,6 +204,7 @@ public class DankerGui extends GuiScreen { allButtons.add(dungeonTimer); allButtons.add(stopSalvageStarred); allButtons.add(watcherReadyMessage); + allButtons.add(flowerWeapons); allButtons.add(notifySlayerSlain); allButtons.add(necronNotifications); allButtons.add(bonzoTimer); @@ -298,6 +303,8 @@ public class DankerGui extends GuiScreen { } } else if (button == changeDisplay) { DankersSkyblockMod.guiToOpen = "displaygui"; + } else if (button == onlySlayer) { + DankersSkyblockMod.guiToOpen = "onlyslayergui"; } else if (button == puzzleSolvers) { DankersSkyblockMod.guiToOpen = "puzzlesolvers"; } else if (button == experimentationTableSolvers) { @@ -424,6 +431,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); } else if (button == autoSkillTracker) { ToggleCommand.autoSkillTrackerToggled = !ToggleCommand.autoSkillTrackerToggled; ConfigHandler.writeBooleanConfig("toggles", "AutoSkillTracker", ToggleCommand.autoSkillTrackerToggled); diff --git a/src/main/java/me/Danker/gui/OnlySlayerGui.java b/src/main/java/me/Danker/gui/OnlySlayerGui.java new file mode 100644 index 0000000..8d56156 --- /dev/null +++ b/src/main/java/me/Danker/gui/OnlySlayerGui.java @@ -0,0 +1,162 @@ +package me.Danker.gui; + +import me.Danker.DankersSkyblockMod; +import me.Danker.commands.ToggleCommand; +import me.Danker.features.BlockWrongSlayer; +import me.Danker.handlers.ConfigHandler; +import me.Danker.handlers.TextRenderer; +import me.Danker.utils.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.ScaledResolution; + +public class OnlySlayerGui extends GuiScreen { + + private int onlyNumberInt = 4; + private String onlyName = "Revenant Horror"; + + private GuiButton goBack; + private GuiButton off; + private GuiButton zombie; + private GuiButton spider; + private GuiButton wolf; + private GuiButton enderman; + private GuiButton one; + private GuiButton two; + private GuiButton three; + private GuiButton four; + private GuiButton five; + + @Override + public boolean doesGuiPauseGame() { + return false; + } + + @Override + public void initGui() { + super.initGui(); + + ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft()); + int height = sr.getScaledHeight(); + int width = sr.getScaledWidth(); + + onlyName = BlockWrongSlayer.onlySlayerName; + switch (BlockWrongSlayer.onlySlayerNumber) { + case "I": + onlyNumberInt = 1; + break; + case "II": + onlyNumberInt = 2; + break; + case "III": + onlyNumberInt = 3; + break; + case "IV": + default: + onlyNumberInt = 4; + break; + case "V": + onlyNumberInt = 5; + break; + } + + goBack = new GuiButton(0, 2, height - 30, 100, 20, "Go Back"); + off = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Off"); + zombie = new GuiButton(0, width / 2 - 230, (int) (height * 0.4), 100, 20, "Zombie"); + spider = new GuiButton(0, width / 2 - 110, (int) (height * 0.4), 100, 20, "Spider"); + wolf = new GuiButton(0, width / 2 + 10, (int) (height * 0.4), 100, 20, "Wolf"); + enderman = new GuiButton(0, width / 2 + 130, (int) (height * 0.4), 100, 20, "Enderman"); + one = new GuiButton(0, width / 2 - 190, (int) (height * 0.6), 60, 20, "I"); + two = new GuiButton(0, width / 2 - 110, (int) (height * 0.6), 60, 20, "II"); + three = new GuiButton(0, width / 2 - 30, (int) (height * 0.6), 60, 20, "III"); + four = new GuiButton(0, width / 2 + 50, (int) (height * 0.6), 60, 20, "IV"); + five = new GuiButton(0, width / 2 + 130, (int) (height * 0.6), 60, 20, "V"); + + this.buttonList.add(off); + this.buttonList.add(zombie); + this.buttonList.add(spider); + this.buttonList.add(wolf); + this.buttonList.add(enderman); + this.buttonList.add(one); + this.buttonList.add(two); + this.buttonList.add(three); + this.buttonList.add(four); + this.buttonList.add(five); + this.buttonList.add(goBack); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + this.drawDefaultBackground(); + Minecraft mc = Minecraft.getMinecraft(); + + String displayText; + if (BlockWrongSlayer.onlySlayerName.equals("")) { + displayText = "Only Allow Slayer: Off"; + } else { + displayText = "Only Allow Slayer: " + BlockWrongSlayer.onlySlayerName + " " + BlockWrongSlayer.onlySlayerNumber; + } + int displayWidth = mc.fontRendererObj.getStringWidth(displayText); + new TextRenderer(mc, displayText, width / 2 - displayWidth / 2, 10, 1D); + + super.drawScreen(mouseX, mouseY, partialTicks); + } + + @Override + public void actionPerformed(GuiButton button) { + if (button == goBack) { + DankersSkyblockMod.guiToOpen = "dankergui1"; + return; + } else if (button == off) { + BlockWrongSlayer.onlySlayerName = ""; + BlockWrongSlayer.onlySlayerNumber = ""; + ConfigHandler.writeStringConfig("toggles", "BlockSlayer", ""); + return; + } else if (button == zombie) { + onlyName = "Revenant Horror"; + } else if (button == spider) { + onlyName = "Tarantula Broodfather"; + } else if (button == wolf) { + onlyName = "Sven Packmaster"; + } else if (button == enderman) { + onlyName = "Voidgloom Seraph"; + } else if (button == one) { + onlyNumberInt = 1; + } else if (button == two) { + onlyNumberInt = 2; + } else if (button == three) { + onlyNumberInt = 3; + } else if (button == four) { + onlyNumberInt = 4; + } else if (button == five) { + onlyNumberInt = 5; + } + + String onlyNumber; + switch (onlyNumberInt) { + case 1: + onlyNumber = "I"; + break; + case 2: + onlyNumber = "II"; + break; + case 3: + onlyNumber = "III"; + break; + case 4: + onlyNumber = "IV"; + break; + case 5: + onlyNumber = "V"; + break; + default: + onlyNumber = "IV"; + } + + BlockWrongSlayer.onlySlayerName = onlyName; + BlockWrongSlayer.onlySlayerNumber = onlyNumber; + ConfigHandler.writeStringConfig("toggles", "BlockSlayer", BlockWrongSlayer.onlySlayerName + " " + BlockWrongSlayer.onlySlayerNumber); + } + +} diff --git a/src/main/java/me/Danker/gui/PuzzleSolversGui.java b/src/main/java/me/Danker/gui/PuzzleSolversGui.java index f671f33..27233d8 100644 --- a/src/main/java/me/Danker/gui/PuzzleSolversGui.java +++ b/src/main/java/me/Danker/gui/PuzzleSolversGui.java @@ -29,6 +29,8 @@ public class PuzzleSolversGui extends GuiScreen { private GuiButton startsWith; private GuiButton selectAll; private GuiButton clickOrder; + private GuiButton blockClicks; + private GuiButton itemFrameOnSeaLanterns; public PuzzleSolversGui(int page) { this.page = page; @@ -66,7 +68,10 @@ public class PuzzleSolversGui extends GuiScreen { startsWith = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Starts With Letter Terminal Solver: " + Utils.getColouredBoolean(ToggleCommand.startsWithToggled)); selectAll = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Select All Color Terminal Solver: " + Utils.getColouredBoolean(ToggleCommand.selectAllToggled)); clickOrder = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Click in Order Terminal Helper: " + Utils.getColouredBoolean(ToggleCommand.clickInOrderToggled)); - + blockClicks = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Block Wrong Clicks on Terminals: " + Utils.getColouredBoolean(ToggleCommand.blockWrongTerminalClicksToggled)); + // Page 3 + itemFrameOnSeaLanterns = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Ignore Arrows On Sea Lanterns: " + Utils.getColouredBoolean(ToggleCommand.itemFrameOnSeaLanternsToggled)); + switch (page) { case 1: this.buttonList.add(riddle); @@ -85,8 +90,13 @@ public class PuzzleSolversGui extends GuiScreen { this.buttonList.add(startsWith); this.buttonList.add(selectAll); this.buttonList.add(clickOrder); + this.buttonList.add(blockClicks); + this.buttonList.add(nextPage); this.buttonList.add(backPage); break; + case 3: + this.buttonList.add(itemFrameOnSeaLanterns); + this.buttonList.add(backPage); } this.buttonList.add(goBack); } @@ -157,6 +167,14 @@ public class PuzzleSolversGui extends GuiScreen { ToggleCommand.clickInOrderToggled = !ToggleCommand.clickInOrderToggled; ConfigHandler.writeBooleanConfig("toggles", "ClickInOrderTerminal", ToggleCommand.clickInOrderToggled); clickOrder.displayString = "Click in Order Terminal Helper: " + Utils.getColouredBoolean(ToggleCommand.clickInOrderToggled); + } else if (button == blockClicks) { + ToggleCommand.blockWrongTerminalClicksToggled = !ToggleCommand.blockWrongTerminalClicksToggled; + ConfigHandler.writeBooleanConfig("toggles", "BlockWrongTerminalClicks", ToggleCommand.blockWrongTerminalClicksToggled); + blockClicks.displayString = "Block Wrong Clicks on Terminals: " + Utils.getColouredBoolean(ToggleCommand.blockWrongTerminalClicksToggled); + } else if (button == itemFrameOnSeaLanterns) { + ToggleCommand.itemFrameOnSeaLanternsToggled = !ToggleCommand.itemFrameOnSeaLanternsToggled; + ConfigHandler.writeBooleanConfig("toggles", "IgnoreItemFrameOnSeaLanterns", ToggleCommand.itemFrameOnSeaLanternsToggled); + itemFrameOnSeaLanterns.displayString = "Ignore Arrows On Sea Lanterns: " + Utils.getColouredBoolean(ToggleCommand.itemFrameOnSeaLanternsToggled); } } diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 9195184..2a765ad 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -238,6 +238,7 @@ public class ConfigHandler { ToggleCommand.necronNotificationsToggled = initBoolean("toggles", "NecronNotifications", false); ToggleCommand.bonzoTimerToggled = initBoolean("toggles", "BonzoTimer", false); ToggleCommand.swapToPickBlockToggled = initBoolean("toggles", "PickBlock", false); + ToggleCommand.flowerWeaponsToggled = initBoolean("toggles", "FlowerWeapons", false); ToggleCommand.autoSkillTrackerToggled = initBoolean("toggles", "AutoSkillTracker", false); // Puzzle Solvers ToggleCommand.threeManToggled = initBoolean("toggles", "ThreeManPuzzle", false); @@ -253,6 +254,8 @@ public class ConfigHandler { ToggleCommand.startsWithToggled = initBoolean("toggles", "StartsWithTerminal", false); ToggleCommand.selectAllToggled = initBoolean("toggles", "SelectAllTerminal", false); ToggleCommand.clickInOrderToggled = initBoolean("toggles", "ClickInOrderTerminal", false); + ToggleCommand.blockWrongTerminalClicksToggled = initBoolean("toggles", "BlockWrongTerminalClicks", false); + ToggleCommand.itemFrameOnSeaLanternsToggled = initBoolean("toggles", "IgnoreItemFrameOnSeaLanterns", false); // Experiment Solvers ToggleCommand.ultrasequencerToggled = initBoolean("toggles", "UltraSequencer", false); ToggleCommand.chronomatronToggled = initBoolean("toggles", "Chronomatron", false); @@ -293,6 +296,14 @@ public class ConfigHandler { // API if (!hasKey("api", "APIKey")) writeStringConfig("api", "APIKey", ""); + + // Block Wrong Slayer + if (!hasKey("toggles", "BlockSlayer")) writeStringConfig("toggles", "BlockSlayer", ""); + String onlySlayer = getString("toggles", "BlockSlayer"); + if (!onlySlayer.equals("")) { + BlockWrongSlayer.onlySlayerName = onlySlayer.substring(0, onlySlayer.lastIndexOf(" ")); + BlockWrongSlayer.onlySlayerNumber = onlySlayer.substring(onlySlayer.lastIndexOf(" ") + 1); + } // Wolf WolfTracker.wolfSvens = initInt("wolf", "svens", 0); |