aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/Danker
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/me/Danker')
-rw-r--r--src/main/java/me/Danker/DankersSkyblockMod.java178
-rw-r--r--src/main/java/me/Danker/commands/DHelpCommand.java2
-rw-r--r--src/main/java/me/Danker/commands/ToggleCommand.java15
-rw-r--r--src/main/java/me/Danker/gui/ExperimentsGui.java7
-rw-r--r--src/main/java/me/Danker/handlers/ConfigHandler.java2
-rw-r--r--src/main/java/me/Danker/utils/Utils.java18
6 files changed, 186 insertions, 36 deletions
diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java
index 35a19c9..95f2099 100644
--- a/src/main/java/me/Danker/DankersSkyblockMod.java
+++ b/src/main/java/me/Danker/DankersSkyblockMod.java
@@ -1,6 +1,7 @@
package me.Danker;
import com.google.gson.JsonObject;
+import com.mojang.realmsclient.util.RealmsUtil;
import me.Danker.commands.*;
import me.Danker.gui.*;
import me.Danker.handlers.*;
@@ -13,6 +14,7 @@ import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.GuiChat;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.gui.inventory.GuiChest;
+import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItemFrame;
@@ -117,8 +119,9 @@ public class DankersSkyblockMod
static int lastChronomatronRound = 0;
static List<String> chronomatronPattern = new ArrayList<>();
static int chronomatronMouseClicks = 0;
-
- static double dungeonStartTime = 0;
+ static ItemStack[] experimentTableSlots = new ItemStack[54];
+
+ static double dungeonStartTime = 0;
static double bloodOpenTime = 0;
static double watcherClearTime = 0;
static double bossClearTime = 0;
@@ -2218,6 +2221,9 @@ public class DankersSkyblockMod
if (event.toolTip == null) return;
ItemStack item = event.itemStack;
+ Minecraft mc = Minecraft.getMinecraft();
+ EntityPlayerSP player = mc.thePlayer;
+
if (ToggleCommand.goldenToggled) {
for (int i = 0; i < event.toolTip.size(); i++) {
event.toolTip.set(i, Utils.returnGoldenEnchants(event.toolTip.get(i)));
@@ -2241,6 +2247,33 @@ public class DankersSkyblockMod
}
}
}
+
+ if(mc.currentScreen instanceof GuiChest) {
+ ContainerChest chest = (ContainerChest) player.openContainer;
+ IInventory inv = chest.getLowerChestInventory();
+ String chestName = inv.getDisplayName().getUnformattedText();
+ if (ToggleCommand.superpairsToggled && chestName.contains("Superpairs (")) {
+ if(Item.getIdFromItem(item.getItem()) != 95) return;
+ if(item.getDisplayName().contains("Click any button") || item.getDisplayName().contains("Click a second button") || item.getDisplayName().contains("Next button is instantly rewarded") || item.getDisplayName().contains("Stained Glass")) {
+ Slot slot = ((GuiChest) mc.currentScreen).getSlotUnderMouse();
+ ItemStack itemStack = experimentTableSlots[slot.getSlotIndex()];
+ if(itemStack == null) return;
+ String itemName = itemStack.getDisplayName();
+
+ if(event.toolTip.stream().anyMatch(x->StringUtils.stripControlCodes(x) == StringUtils.stripControlCodes(itemName))) return;
+ event.toolTip.removeIf(x->{
+ x = StringUtils.stripControlCodes(x);
+ if(x.equals("minecraft:stained_glass")) return true;
+ if(x.startsWith("NBT: ")) return true;
+
+ return false;
+ });
+ event.toolTip.add(event.toolTip.size(), itemName);
+ }
+
+ }
+ }
+
}
@SubscribeEvent
@@ -2580,31 +2613,31 @@ public class DankersSkyblockMod
// Checks 5 times per second
if (tickAmount % 4 == 0) {
if (ToggleCommand.blazeToggled && Utils.inDungeons && world != null) {
- List<Entity> entities = world.getLoadedEntityList();
- int highestHealth = 0;
- highestBlaze = null;
- int lowestHealth = 99999999;
- lowestBlaze = null;
+ List<Entity> entities = world.getLoadedEntityList();
+ int highestHealth = 0;
+ highestBlaze = null;
+ int lowestHealth = 99999999;
+ lowestBlaze = null;
- for (Entity entity : entities) {
- if (entity.getName().contains("Blaze") && entity.getName().contains("/")) {
- String blazeName = StringUtils.stripControlCodes(entity.getName());
- try {
- int health = Integer.parseInt(blazeName.substring(blazeName.indexOf("/") + 1, blazeName.length() - 1));
- if (health > highestHealth) {
- highestHealth = health;
- highestBlaze = entity;
- }
- if (health < lowestHealth) {
- lowestHealth = health;
- lowestBlaze = entity;
- }
- } catch (NumberFormatException ex) {
- ex.printStackTrace();
- }
- }
- }
- }
+ for (Entity entity : entities) {
+ if (entity.getName().contains("Blaze") && entity.getName().contains("/")) {
+ String blazeName = StringUtils.stripControlCodes(entity.getName());
+ try {
+ int health = Integer.parseInt(blazeName.substring(blazeName.indexOf("/") + 1, blazeName.length() - 1));
+ if (health > highestHealth) {
+ highestHealth = health;
+ highestBlaze = entity;
+ }
+ if (health < lowestHealth) {
+ lowestHealth = health;
+ lowestBlaze = entity;
+ }
+ } catch (NumberFormatException ex) {
+ ex.printStackTrace();
+ }
+ }
+ }
+ }
}
// Checks 10 times per second
@@ -2619,8 +2652,40 @@ public class DankersSkyblockMod
}
}
}
-
- if (titleTimer >= 0) {
+
+ if(mc.currentScreen instanceof GuiChest) {
+ ContainerChest chest = (ContainerChest) player.openContainer;
+ IInventory inv = chest.getLowerChestInventory();
+ String chestName = inv.getDisplayName().getUnformattedText();
+ if (ToggleCommand.superpairsToggled && chestName.contains("Superpairs (")) {
+ for (int i = 0; i < 53; i++) {
+ ItemStack itemStack = inv.getStackInSlot(i);
+ if (itemStack == null) continue;
+ String itemName = itemStack.getDisplayName();
+ if (Item.getIdFromItem(itemStack.getItem()) == 95 || Item.getIdFromItem(itemStack.getItem()) == 160) continue;
+ if (itemName.contains("Instant Find") || itemName.contains("Gained +")) continue;
+ if(itemName.contains("Enchanted Book")) {
+ itemName = itemStack.getTooltip(mc.thePlayer, false).get(3);
+ }
+ if(itemStack.stackSize > 1) {
+ itemName = itemStack.stackSize + " " + itemName;
+ }
+ if (experimentTableSlots[i] != null) continue;
+ experimentTableSlots[i] = itemStack.copy().setStackDisplayName(itemName);
+ }
+
+ /*
+ for (int i = 0; i < 53; i++) {
+ ItemStack itemStack = experimentTableSlots[i];
+ if (itemStack == null) continue;
+ inv.setInventorySlotContents(i, itemStack);
+ }
+ */
+
+ }
+ }
+
+ if (titleTimer >= 0) {
if (titleTimer == 0) {
showTitle = false;
}
@@ -2747,12 +2812,12 @@ public class DankersSkyblockMod
}
}
}
-
+
@SubscribeEvent
public void onGuiMouseInputPre(GuiScreenEvent.MouseInputEvent.Pre event) {
if (!Utils.inSkyblock) return;
- if (Mouse.getEventButton() != 0 && Mouse.getEventButton() != 1) return; // Left click or right click
- if (!Mouse.isButtonDown(0) && !Mouse.isButtonDown(1)) return;
+ if (Mouse.getEventButton() != 0 && Mouse.getEventButton() != 1 && Mouse.getEventButton() != 2) return; // Left click or right click
+ if (!Mouse.isButtonDown(0) && !Mouse.isButtonDown(1) && !Mouse.isButtonDown(2)) return;
if (event.gui instanceof GuiChest) {
Container containerChest = ((GuiChest) event.gui).inventorySlots;
@@ -2820,7 +2885,7 @@ public class DankersSkyblockMod
chronomatronMouseClicks++;
}
}
-
+
if (!BlockSlayerCommand.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;
@@ -2861,6 +2926,7 @@ public class DankersSkyblockMod
lastChronomatronRound = 0;
chronomatronPattern.clear();
chronomatronMouseClicks = 0;
+ experimentTableSlots = new ItemStack[54];
}
@SubscribeEvent
@@ -3017,6 +3083,54 @@ public class DankersSkyblockMod
}
new TextRenderer(mc, String.join("\n", chronomatronPattern), (int) (guiLeft * 0.8), 10, 1);
}
+
+ if(ToggleCommand.superpairsToggled && displayName.contains("Superpairs (")) {
+ HashMap<String, HashSet<Integer>> matches = new HashMap<>();
+ for(int i = 0; i<53; i++) {
+ ItemStack itemStack = experimentTableSlots[i];
+ if(itemStack == null) continue;
+ Slot slot = invSlots.get(i);
+ int x = guiLeft + slot.xDisplayPosition;
+ int y = guiTop + slot.yDisplayPosition;
+ if (chestSize != 90) y += (6 - (chestSize - 36) / 9) * 9;
+
+ //Utils.renderItem(itemStack, x, y, -100);
+
+ String itemName = itemStack.getDisplayName();
+ matches.computeIfAbsent(itemName, k -> new HashSet<>());
+ matches.get(itemName).add(i);
+ }
+
+ Color[] colors = {
+ new Color(255, 0, 0, 40),
+ new Color(0, 0, 255, 40),
+ new Color(60, 179, 113, 40),
+ new Color(255, 114, 255, 40),
+ new Color(255, 199, 87, 40),
+ new Color(119, 105, 198, 40),
+ new Color(135, 199, 112, 40),
+ new Color(250, 37, 240, 40),
+ new Color(178, 132, 190, 40),
+ new Color(63, 135, 163, 40),
+ new Color(146, 74, 10, 40),
+ new Color(255, 255, 255, 40),
+ new Color(217, 252, 140, 40),
+ new Color(255, 82, 82, 40)
+ };
+
+ Iterator<Color> colorIterator = Arrays.stream(colors).iterator();
+
+ matches.forEach((itemName, slotSet)->{
+ if(slotSet.size() < 2) return;
+ ArrayList<Slot> slots = new ArrayList();
+ slotSet.forEach(slotNum->slots.add(invSlots.get(slotNum)));
+ Color color = colorIterator.next();
+ slots.forEach(slot->{
+ Utils.drawOnSlot(chestSize, slot.xDisplayPosition, slot.yDisplayPosition, color.getRGB());
+ });
+ });
+ }
+
}
}
}
diff --git a/src/main/java/me/Danker/commands/DHelpCommand.java b/src/main/java/me/Danker/commands/DHelpCommand.java
index 332c47f..1628c0c 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/threemanpuzzle/oruopuzzle/blazepuzzle/creeperpuzzle/waterpuzzle/tictactoepuzzle/startswithterminal/selectallterminal/itemframeonsealanterns/ultrasequencer/chronomatron/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/sceptremessages/midasstaffmessages/implosionmessages/healmessages/petcolors/dungeontimer/golemalerts/expertiselore/skill50display/outlinetext/caketimer/lowhealthnotify/lividsolver/threemanpuzzle/oruopuzzle/blazepuzzle/creeperpuzzle/waterpuzzle/tictactoepuzzle/startswithterminal/selectallterminal/itemframeonsealanterns/ultrasequencer/chronomatron/superpairs/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 541a59a..2f72fd4 100644
--- a/src/main/java/me/Danker/commands/ToggleCommand.java
+++ b/src/main/java/me/Danker/commands/ToggleCommand.java
@@ -50,6 +50,7 @@ public class ToggleCommand extends CommandBase implements ICommand {
// Experiments
public static boolean ultrasequencerToggled;
public static boolean chronomatronToggled;
+ public static boolean superpairsToggled;
@Override
public String getCommandName() {
@@ -62,7 +63,7 @@ public class ToggleCommand extends CommandBase implements ICommand {
"aotd/lividdagger/sceptremessages/petcolors/dungeontimer/golemalerts/expertiselore/skill50display/" +
"outlinetext/midasstaffmessages/implosionmessages/healmessages/caketimer/lowhealthnotify/" +
"lividsolver/threemanpuzzle/oruopuzzle/blazepuzzle/creeperpuzzle/waterpuzzle/tictactoepuzzle/" +
- "startswithterminal/selectallterminal/itemframeonsealanterns/ultrasequencer/chronomatron/list>";
+ "startswithterminal/selectallterminal/itemframeonsealanterns/ultrasequencer/chronomatron/superpairs/list>";
}
@Override
@@ -81,7 +82,7 @@ public class ToggleCommand extends CommandBase implements ICommand {
"lividsolver", "threemanpuzzle", "oruopuzzle", "blazepuzzle",
"creeperpuzzle", "waterpuzzle", "tictactoepuzzle", "startswithterminal",
"selectallterminal", "itemframeonsealanterns", "ultrasequencer",
- "chronomatron", "list");
+ "chronomatron", "superpairs", "list");
}
return null;
}
@@ -266,6 +267,12 @@ public class ToggleCommand extends CommandBase implements ICommand {
chronomatronToggled = !chronomatronToggled;
ConfigHandler.writeBooleanConfig("toggles", "Chronomatron", chronomatronToggled);
player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Chronomatron solver has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + chronomatronToggled + DankersSkyblockMod.MAIN_COLOUR + "."));
+ break;
+ case "superpairs":
+ superpairsToggled = !superpairsToggled;
+ ConfigHandler.writeBooleanConfig("toggles", "Superpairs", superpairsToggled);
+ player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Superpairs solver has been set to " + DankersSkyblockMod.SECONDARY_COLOUR + superpairsToggled + DankersSkyblockMod.MAIN_COLOUR + "."));
+ break;
case "list":
player.addChatMessage(new ChatComponentText(DankersSkyblockMod.TYPE_COLOUR + "Guild party notifications: " + DankersSkyblockMod.VALUE_COLOUR + gpartyToggled + "\n" +
DankersSkyblockMod.TYPE_COLOUR + " Coord/Angle display: " + DankersSkyblockMod.VALUE_COLOUR + coordsToggled + "\n" +
@@ -300,7 +307,9 @@ public class ToggleCommand extends CommandBase implements ICommand {
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));
+ DankersSkyblockMod.TYPE_COLOUR + " Chronomatron solver: " + DankersSkyblockMod.VALUE_COLOUR + chronomatronToggled + "\n" +
+ DankersSkyblockMod.TYPE_COLOUR + " Superpairs solver: " + DankersSkyblockMod.VALUE_COLOUR + superpairsToggled
+ ));
break;
default:
player.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Usage: " + getCommandUsage(arg0)));
diff --git a/src/main/java/me/Danker/gui/ExperimentsGui.java b/src/main/java/me/Danker/gui/ExperimentsGui.java
index 8b19820..42c9b66 100644
--- a/src/main/java/me/Danker/gui/ExperimentsGui.java
+++ b/src/main/java/me/Danker/gui/ExperimentsGui.java
@@ -14,6 +14,7 @@ public class ExperimentsGui extends GuiScreen {
private GuiButton goBack;
private GuiButton ultrasequencer;
private GuiButton chronomatron;
+ private GuiButton superpairs;
@Override
public boolean doesGuiPauseGame() {
@@ -31,10 +32,12 @@ public class ExperimentsGui extends GuiScreen {
goBack = new GuiButton(0, 2, height - 30, 100, 20, "Go Back");
ultrasequencer = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Ultrasequencer Solver: " + Utils.getColouredBoolean(ToggleCommand.ultrasequencerToggled));
chronomatron = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Chronomatron Solver: " + Utils.getColouredBoolean(ToggleCommand.chronomatronToggled));
+ superpairs = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Superpairs Solver: " + Utils.getColouredBoolean(ToggleCommand.superpairsToggled));
this.buttonList.add(goBack);
this.buttonList.add(ultrasequencer);
this.buttonList.add(chronomatron);
+ this.buttonList.add(superpairs);
}
@Override
@@ -55,6 +58,10 @@ public class ExperimentsGui extends GuiScreen {
ToggleCommand.chronomatronToggled = !ToggleCommand.chronomatronToggled;
ConfigHandler.writeBooleanConfig("toggles", "Chronomatron", ToggleCommand.chronomatronToggled);
chronomatron.displayString = "Chronomatron Solver: " + Utils.getColouredBoolean(ToggleCommand.chronomatronToggled);
+ } else if (button == superpairs) {
+ ToggleCommand.superpairsToggled = !ToggleCommand.superpairsToggled;
+ ConfigHandler.writeBooleanConfig("toggles", "Superpairs", ToggleCommand.superpairsToggled);
+ superpairs.displayString = "Superpairs Solver: " + Utils.getColouredBoolean(ToggleCommand.superpairsToggled);
}
}
diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java
index 5280747..0d0ccb1 100644
--- a/src/main/java/me/Danker/handlers/ConfigHandler.java
+++ b/src/main/java/me/Danker/handlers/ConfigHandler.java
@@ -203,6 +203,7 @@ public class ConfigHandler {
if (!hasKey("toggles", "IgnoreItemFrameOnSeaLanterns")) writeBooleanConfig("toggles", "IgnoreItemFrameOnSeaLanterns", false);
if (!hasKey("toggles", "UltraSequencer")) writeBooleanConfig("toggles", "UltraSequencer", false);
if (!hasKey("toggles", "Chronomatron")) writeBooleanConfig("toggles", "Chronomatron", false);
+ if (!hasKey("toggles", "Superpairs")) writeBooleanConfig("toggles", "Superpairs", false);
if (!hasKey("api", "APIKey")) writeStringConfig("api", "APIKey", "");
@@ -446,6 +447,7 @@ public class ConfigHandler {
ToggleCommand.itemFrameOnSeaLanternsToggled = getBoolean("toggles", "IgnoreItemFrameOnSeaLanterns");
ToggleCommand.ultrasequencerToggled = getBoolean("toggles", "UltraSequencer");
ToggleCommand.chronomatronToggled = getBoolean("toggles", "Chronomatron");
+ ToggleCommand.superpairsToggled = getBoolean("toggles", "Superpairs");
String onlySlayer = getString("toggles", "BlockSlayer");
if (!onlySlayer.equals("")) {
diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java
index 9d460bc..e0a7454 100644
--- a/src/main/java/me/Danker/utils/Utils.java
+++ b/src/main/java/me/Danker/utils/Utils.java
@@ -9,6 +9,7 @@ import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.network.NetworkPlayerInfo;
import net.minecraft.client.renderer.GlStateManager;
+import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.WorldRenderer;
import net.minecraft.client.renderer.entity.RenderManager;
@@ -18,6 +19,7 @@ import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.item.EntityItemFrame;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
import net.minecraft.scoreboard.ScoreObjective;
import net.minecraft.util.*;
import org.lwjgl.opengl.GL11;
@@ -363,6 +365,22 @@ public class Utils {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.popMatrix();
}
+
+ public static void renderItem(ItemStack item, float x, float y, float z) {
+
+ GlStateManager.enableRescaleNormal();
+ RenderHelper.enableGUIStandardItemLighting();
+ GlStateManager.enableDepth();
+
+ GlStateManager.pushMatrix();
+ GlStateManager.translate(x, y, z);
+ Minecraft.getMinecraft().getRenderItem().renderItemIntoGUI(item, 0, 0);
+ GlStateManager.popMatrix();
+
+ GlStateManager.disableDepth();
+ RenderHelper.disableStandardItemLighting();
+ GlStateManager.disableRescaleNormal();
+ }
public static BlockPos getFirstBlockPosAfterVectors(Minecraft mc, Vec3 pos1, Vec3 pos2, int strength, int distance) {
double x = pos2.xCoord - pos1.xCoord;