aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/Danker/features
diff options
context:
space:
mode:
authorbowser0000 <bowser0000@gmail.com>2021-04-02 17:26:21 -0400
committerbowser0000 <bowser0000@gmail.com>2021-04-02 17:26:21 -0400
commitdf1f83cf4ddb80969d2086cf1d7a86df9dc90653 (patch)
tree5dde5a1bf277e779f23e3476187227e2671b5944 /src/main/java/me/Danker/features
parent032cbaea86a08b98a239257f464a00a925068fda (diff)
downloadSkyblockMod-df1f83cf4ddb80969d2086cf1d7a86df9dc90653.tar.gz
SkyblockMod-df1f83cf4ddb80969d2086cf1d7a86df9dc90653.tar.bz2
SkyblockMod-df1f83cf4ddb80969d2086cf1d7a86df9dc90653.zip
Remove features
Remove blocking starting wrong slayer quest Remove blocking using abilities Remove placing flower weapons Remove blocking misclicks in solvers Remove F7 arrow terminal solver
Diffstat (limited to 'src/main/java/me/Danker/features')
-rw-r--r--src/main/java/me/Danker/features/BlockAbilities.java96
-rw-r--r--src/main/java/me/Danker/features/BlockPlacingFlowers.java44
-rw-r--r--src/main/java/me/Danker/features/BlockWrongSlayer.java42
-rw-r--r--src/main/java/me/Danker/features/puzzlesolvers/ArrowTerminalSolver.java32
-rw-r--r--src/main/java/me/Danker/features/puzzlesolvers/BlockWrongTerminalClicks.java112
-rw-r--r--src/main/java/me/Danker/features/puzzlesolvers/ChronomatronSolver.java15
-rw-r--r--src/main/java/me/Danker/features/puzzlesolvers/UltrasequencerSolver.java25
7 files changed, 2 insertions, 364 deletions
diff --git a/src/main/java/me/Danker/features/BlockAbilities.java b/src/main/java/me/Danker/features/BlockAbilities.java
deleted file mode 100644
index 814fd65..0000000
--- a/src/main/java/me/Danker/features/BlockAbilities.java
+++ /dev/null
@@ -1,96 +0,0 @@
-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 BlockAbilities {
-
- @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_AIR) {
- if (ToggleCommand.aotdToggled && item.getDisplayName().contains("Aspect of the Dragons")) {
- event.setCanceled(true);
- }
- if (ToggleCommand.lividDaggerToggled && item.getDisplayName().contains("Livid Dagger")) {
- event.setCanceled(true);
- }
- if (ToggleCommand.shadowFuryToggled && item.getDisplayName().contains("Shadow Fury")) {
- event.setCanceled(true);
- }
- if (ToggleCommand.specialHoeRightClick && (item.getDisplayName().contains("Mathematical Hoe") || item.getDisplayName().contains("Potato Hoe") || item.getDisplayName().contains("Wheat Hoe") || item.getDisplayName().contains("Carrot Hoe") || item.getDisplayName().contains("Sugar Cane Hoe") || item.getDisplayName().contains("Nether Warts Hoe"))) {
- event.setCanceled(true);
- }
- } else if (event.action == PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) {
- Block block = Minecraft.getMinecraft().theWorld.getBlockState(event.pos).getBlock();
-
- ArrayList<Block> interactables = new ArrayList<>(Arrays.asList(
- Blocks.acacia_door,
- Blocks.anvil,
- Blocks.beacon,
- Blocks.bed,
- Blocks.birch_door,
- Blocks.brewing_stand,
- Blocks.command_block,
- Blocks.crafting_table,
- Blocks.chest,
- Blocks.dark_oak_door,
- Blocks.daylight_detector,
- Blocks.daylight_detector_inverted,
- Blocks.dispenser,
- Blocks.dropper,
- Blocks.enchanting_table,
- Blocks.ender_chest,
- Blocks.furnace,
- Blocks.hopper,
- Blocks.jungle_door,
- Blocks.lever,
- Blocks.noteblock,
- Blocks.powered_comparator,
- Blocks.unpowered_comparator,
- Blocks.powered_repeater,
- Blocks.unpowered_repeater,
- Blocks.standing_sign,
- Blocks.wall_sign,
- Blocks.trapdoor,
- Blocks.trapped_chest,
- Blocks.wooden_button,
- Blocks.stone_button,
- Blocks.oak_door,
- Blocks.skull
- ));
- if (Utils.inDungeons) {
- interactables.add(Blocks.coal_block);
- interactables.add(Blocks.stained_hardened_clay);
- }
-
- if (!interactables.contains(block)) {
- if (ToggleCommand.aotdToggled && item.getDisplayName().contains("Aspect of the Dragons")) {
- event.setCanceled(true);
- }
- if (ToggleCommand.lividDaggerToggled && item.getDisplayName().contains("Livid Dagger")) {
- event.setCanceled(true);
- }
- if (ToggleCommand.shadowFuryToggled && item.getDisplayName().contains("Shadow Fury")) {
- event.setCanceled(true);
- }
- }
- if (ToggleCommand.specialHoeRightClick && (item.getDisplayName().contains("Mathematical Hoe") || item.getDisplayName().contains("Potato Hoe") || item.getDisplayName().contains("Wheat Hoe") || item.getDisplayName().contains("Carrot Hoe") || item.getDisplayName().contains("Sugar Cane Hoe") || item.getDisplayName().contains("Nether Warts Hoe"))) {
- event.setCanceled(true);
- }
- }
- }
-
-}
diff --git a/src/main/java/me/Danker/features/BlockPlacingFlowers.java b/src/main/java/me/Danker/features/BlockPlacingFlowers.java
deleted file mode 100644
index 9bfc986..0000000
--- a/src/main/java/me/Danker/features/BlockPlacingFlowers.java
+++ /dev/null
@@ -1,44 +0,0 @@
-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 {
-
- @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();
-
- ArrayList<Block> flowerPlaceable = new ArrayList<>(Arrays.asList(
- Blocks.grass,
- Blocks.dirt,
- Blocks.flower_pot,
- Blocks.tallgrass,
- Blocks.double_plant
- ));
- 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
deleted file mode 100644
index 6da4798..0000000
--- a/src/main/java/me/Danker/features/BlockWrongSlayer.java
+++ /dev/null
@@ -1,42 +0,0 @@
-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")) {
- if (item.getDisplayName().contains("Revenant Horror") || item.getDisplayName().contains("Tarantula Broodfather") || item.getDisplayName().contains("Sven Packmaster")) {
- // 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
deleted file mode 100644
index 35458f3..0000000
--- a/src/main/java/me/Danker/features/puzzlesolvers/ArrowTerminalSolver.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package me.Danker.features.puzzlesolvers;
-
-import me.Danker.commands.ToggleCommand;
-import me.Danker.utils.Utils;
-import net.minecraft.client.Minecraft;
-import net.minecraft.entity.item.EntityItemFrame;
-import net.minecraft.init.Blocks;
-import net.minecraft.init.Items;
-import net.minecraft.item.ItemStack;
-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);
- }
- }
- }
-
-}
diff --git a/src/main/java/me/Danker/features/puzzlesolvers/BlockWrongTerminalClicks.java b/src/main/java/me/Danker/features/puzzlesolvers/BlockWrongTerminalClicks.java
deleted file mode 100644
index 5176e8b..0000000
--- a/src/main/java/me/Danker/features/puzzlesolvers/BlockWrongTerminalClicks.java
+++ /dev/null
@@ -1,112 +0,0 @@
-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 7bbd25a..208cf9b 100644
--- a/src/main/java/me/Danker/features/puzzlesolvers/ChronomatronSolver.java
+++ b/src/main/java/me/Danker/features/puzzlesolvers/ChronomatronSolver.java
@@ -15,7 +15,6 @@ 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;
@@ -33,20 +32,10 @@ public class ChronomatronSolver {
if (ToggleCommand.chronomatronToggled && event.inventoryName.startsWith("Chronomatron (")) {
IInventory inventory = event.inventory;
ItemStack item = event.item;
- if (item == null) {
- if (event.isCancelable() && !Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) && !Keyboard.isKeyDown(Keyboard.KEY_RCONTROL))
- event.setCanceled(true);
- return;
- }
+ if (item == null) return;
+
if (inventory.getStackInSlot(49).getDisplayName().startsWith("§7Timer: §a") && (item.getItem() == Item.getItemFromBlock(Blocks.stained_glass) || item.getItem() == Item.getItemFromBlock(Blocks.stained_hardened_clay))) {
- 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);
- return;
- }
chronomatronMouseClicks++;
- } 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 87309fe..3df6fc4 100644
--- a/src/main/java/me/Danker/features/puzzlesolvers/UltrasequencerSolver.java
+++ b/src/main/java/me/Danker/features/puzzlesolvers/UltrasequencerSolver.java
@@ -1,20 +1,17 @@
package me.Danker.features.puzzlesolvers;
import me.Danker.commands.ToggleCommand;
-import me.Danker.events.ChestSlotClickedEvent;
import me.Danker.events.GuiChestBackgroundDrawnEvent;
import me.Danker.utils.Utils;
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;
@@ -53,28 +50,6 @@ 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);
- return;
- } 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);
- return;
- }
- }
- }
- }
-
- @SubscribeEvent
public void onGuiRender(GuiChestBackgroundDrawnEvent event) {
if (ToggleCommand.ultrasequencerToggled && event.displayName.startsWith("Ultrasequencer (")) {
List<Slot> invSlots = event.slots;