diff options
| author | bowser0000 <bowser0000@gmail.com> | 2020-12-07 19:00:24 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-07 19:00:24 -0500 |
| commit | 0bd7c6336f5866ea5513f85a3cedf5c48e375ab2 (patch) | |
| tree | c28066f2d9f819f57c42d8911f1e0046f48cdf60 | |
| parent | 886402bdcd8d68e6d1076c86d53baab47070dd63 (diff) | |
| parent | c5e8044e39f784798000b64bbece05eae0282d86 (diff) | |
| download | SkyblockMod-0bd7c6336f5866ea5513f85a3cedf5c48e375ab2.tar.gz SkyblockMod-0bd7c6336f5866ea5513f85a3cedf5c48e375ab2.tar.bz2 SkyblockMod-0bd7c6336f5866ea5513f85a3cedf5c48e375ab2.zip | |
1.8.4v1.8.4
Merge pull request #42 from bowser0000/development
41 files changed, 1603 insertions, 909 deletions
@@ -5,8 +5,10 @@ Discord Server: https://discord.gg/QsEkNQS ## Incompatibilities - Old Animations <2.6.4 - Frequent crashes -- Old Animations 2.6.4 - Pet colors does not work -- LabyMod + Sidebar Mod Revamp - Displays don't show +- Old Animations 2.6.4 + - Pet colors does not color slots + - Catacombs F7 terminal solvers do not color slots + - Ultrasequencer solver does not color slots ## Current features - Guild party desktop notifications @@ -16,6 +18,7 @@ Discord Server: https://discord.gg/QsEkNQS - Block Livid Dagger ability - Disable Spirit Sceptre messages - Disable Midas Staff messages +- Disable Implosion messages - Disable heal messages - Slayer item tracker - RNGesus drop alerts @@ -25,7 +28,8 @@ Discord Server: https://discord.gg/QsEkNQS - Fishing, jerry fishing, fishing festival, spooky fishing trackers - Expertise kills in fishing rod lore - Catacombs trackers -- Dungeons puzzle solver (Riddle, trivia, blaze, creeper, water) +- Dungeons puzzle solver (Riddle, trivia, blaze, creeper, water, tic tac toe) +- Experimentation solvers (Ultrasequencer, Chronomatron, Superpairs) - Catacombs F7 Stage 3 solvers (Starts with letter, select all colour, ignore arrows on sea lanterns) - Find correct Livid (with graphic display of HP) - Pet background colors based on level @@ -41,14 +45,14 @@ Discord Server: https://discord.gg/QsEkNQS ## Commands - /dhelp - Returns this message in-game. - /dsm - Opens the GUI for Danker's Skyblock Mod. -- /toggle <gparty/coords/golden/slayercount/rngesusalerts/splitfishing/chatmaddox/spiritbearalerts/aotd/sceptremessages/petcolors/dungeontimer/golemalerts/expertiselore/skill50display/outlinetext/midasstaffmessages/healmessages/caketimer/lividsolver/lowhealthnotify/oruopuzzle/blazepuzzle/creeperpuzzle/waterpuzzle/startswithterminal/selectallterminal/itemframeonsealanterns/list> - Toggles features. /toggle list returns values of every toggle. +- /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/list> - Toggles features. /toggle list returns values of every toggle. - /setkey <key> - Sets API key. - /getkey - Returns key set with /setkey and copies it to your clipboard. - /loot <zombie/spider/wolf/fishing/catacombs> [winter/spooky/f(1-7)/session] - Returns loot received from slayer quests or fishing stats. /loot fishing winter returns winter sea creatures instead. - /display <zombie/spider/wolf/fishing/catacombs/auto/off> [winter/spooky/f(1-7)/session] - Text display for trackers. /display fishing winter displays winter sea creatures instead. /display auto automatically displays the loot for the slayer quest you have active. - /resetloot <zombie/spider/wolf/fishing/catacombs/confirm/cancel> - - Resets loot for trackers. /resetloot confirm confirms the reset. -- /move <coords/display/dungeontimer/skill50/lividhp/caketimer/skilltracker> <x> <y> - Moves text display to specified X and Y coordinates. -- /scale <coords/display/dungeontimer/skill50/lividhp/caketimer/skilltracker> <scale (0.1 - 10)> - Scales text display to a specified multipler between 0.1x and 10x. +- /move <coords/display/dungeontimer/skill50/lividhp/caketimer/skilltracker/wateranswer> <x> <y> - Moves text display to specified X and Y coordinates. +- /scale <coords/display/dungeontimer/skill50/lividhp/caketimer/skilltracker/wateranswer> <scale (0.1 - 10)> - Scales text display to a specified multipler between 0.1x and 10x. - /slayer [player] - Uses API to get slayer xp of a person. If no name is provided, it checks yours. - /skills [player] - Uses API to get skill levels of a person. If no name is provided, it checks yours. - /lobbyskills - Uses API to find the average skills of the lobby, as well the three players with the highest skill average. diff --git a/build.gradle b/build.gradle index 60e9ed9..0258259 100644 --- a/build.gradle +++ b/build.gradle @@ -20,7 +20,7 @@ plugins { id "net.minecraftforge.gradle.forge" version "2.0.2" } */ -version = "1.8.3" +version = "1.8.4" group= "com.yourname.modid" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "Danker's Skyblock Mod" diff --git a/src/main/java/me/Danker/TheMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 9f0e935..2c75a0e 100644 --- a/src/main/java/me/Danker/TheMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -1,65 +1,19 @@ package me.Danker; -import java.awt.Image; -import java.awt.SystemTray; -import java.awt.Toolkit; -import java.awt.TrayIcon; -import java.text.NumberFormat; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.regex.Pattern; - -import org.apache.commons.lang3.time.StopWatch; -import org.lwjgl.input.Keyboard; -import org.lwjgl.input.Mouse; -import org.lwjgl.opengl.GL11; - import com.google.gson.JsonObject; - -import me.Danker.commands.ArmourCommand; -import me.Danker.commands.BankCommand; -import me.Danker.commands.BlockSlayerCommand; -import me.Danker.commands.DHelpCommand; -import me.Danker.commands.DankerGuiCommand; -import me.Danker.commands.DisplayCommand; -import me.Danker.commands.DungeonsCommand; -import me.Danker.commands.GetkeyCommand; -import me.Danker.commands.GuildOfCommand; -import me.Danker.commands.ImportFishingCommand; -import me.Danker.commands.LobbySkillsCommand; -import me.Danker.commands.LootCommand; -import me.Danker.commands.MoveCommand; -import me.Danker.commands.PetsCommand; -import me.Danker.commands.ReloadConfigCommand; -import me.Danker.commands.ResetLootCommand; -import me.Danker.commands.ScaleCommand; -import me.Danker.commands.SetkeyCommand; -import me.Danker.commands.SkillTrackerCommand; -import me.Danker.commands.SkillsCommand; -import me.Danker.commands.SkyblockPlayersCommand; -import me.Danker.commands.SlayerCommand; -import me.Danker.commands.ToggleCommand; -import me.Danker.gui.DankerGui; -import me.Danker.gui.DisplayGui; -import me.Danker.gui.EditLocationsGui; -import me.Danker.gui.OnlySlayerGui; -import me.Danker.gui.PuzzleSolversGui; -import me.Danker.gui.SkillTrackerGui; -import me.Danker.handlers.APIHandler; -import me.Danker.handlers.ConfigHandler; -import me.Danker.handlers.PacketHandler; -import me.Danker.handlers.ScoreboardHandler; -import me.Danker.handlers.TextRenderer; +import me.Danker.commands.*; +import me.Danker.gui.*; +import me.Danker.handlers.*; +import me.Danker.utils.TicTacToeUtils; import me.Danker.utils.Utils; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; 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.settings.GameSettings; import net.minecraft.client.settings.KeyBinding; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItemFrame; @@ -73,22 +27,16 @@ import net.minecraft.inventory.Container; import net.minecraft.inventory.ContainerChest; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; +import net.minecraft.item.Item; +import net.minecraft.item.ItemMap; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IChatComponent; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StringUtils; -import net.minecraft.util.Vec3; +import net.minecraft.util.*; import net.minecraft.world.World; +import net.minecraft.world.storage.MapData; import net.minecraftforge.client.ClientCommandHandler; -import net.minecraftforge.client.event.ClientChatReceivedEvent; -import net.minecraftforge.client.event.GuiScreenEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderWorldLastEvent; +import net.minecraftforge.client.GuiIngameForge; +import net.minecraftforge.client.event.*; import net.minecraftforge.client.event.sound.PlaySoundEvent; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.EntityJoinWorldEvent; @@ -110,16 +58,26 @@ import net.minecraftforge.fml.common.gameevent.TickEvent; import net.minecraftforge.fml.common.gameevent.TickEvent.Phase; import net.minecraftforge.fml.common.network.FMLNetworkEvent.ClientConnectedToServerEvent; import net.minecraftforge.fml.common.versioning.DefaultArtifactVersion; +import org.apache.commons.lang3.time.StopWatch; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +import java.awt.*; +import java.text.NumberFormat; +import java.util.List; +import java.util.*; +import java.util.regex.Pattern; -@Mod(modid = TheMod.MODID, version = TheMod.VERSION, clientSideOnly = true) -public class TheMod +@Mod(modid = DankersSkyblockMod.MODID, version = DankersSkyblockMod.VERSION, clientSideOnly = true) +public class DankersSkyblockMod { public static final String MODID = "Danker's Skyblock Mod"; - public static final String VERSION = "1.8.3"; + public static final String VERSION = "1.8.4"; static double checkItemsNow = 0; static double itemsChecked = 0; - public static Map<String, String> t6Enchants = new HashMap<String, String>(); + public static Map<String, String> t6Enchants = new HashMap<>(); public static Pattern pattern = Pattern.compile(""); static boolean updateChecked = false; public static int titleTimer = -1; @@ -133,7 +91,6 @@ public class TheMod static String lastMaddoxCommand = "/cb placeholder"; static double lastMaddoxTime = 0; static KeyBinding[] keyBindings = new KeyBinding[2]; - static int lastMouse = -1; static boolean usingLabymod = false; public static String guiToOpen = null; static boolean foundLivid = false; @@ -145,7 +102,7 @@ public class TheMod static String[] riddleSolutions = {"The reward is not in my chest!", "At least one of them is lying, and the reward is not in", "My chest doesn't have the reward. We are all telling the truth", "My chest has the reward and I'm telling the truth", "The reward isn't in any of our chests", "Both of them are telling the truth."}; - static Map<String, String[]> triviaSolutions = new HashMap<String, String[]>(); + static Map<String, String[]> triviaSolutions = new HashMap<>(); static String[] triviaAnswers = null; static Entity highestBlaze = null; static Entity lowestBlaze = null; @@ -153,11 +110,21 @@ public class TheMod static final int[] CREEPER_COLOURS = {0x50EF39, 0xC51111, 0x132ED1, 0x117F2D, 0xED54BA, 0xEF7D0D, 0xF5F557, 0xD6E0F0, 0x6B2FBB, 0x39FEDC}; static boolean drawCreeperLines = false; static Vec3 creeperLocation = new Vec3(0, 0, 0); - static List<Vec3[]> creeperLines = new ArrayList<Vec3[]>(); + static List<Vec3[]> creeperLines = new ArrayList<>(); static boolean prevInWaterRoom = false; static boolean inWaterRoom = false; - - static double dungeonStartTime = 0; + static String waterAnswers = null; + static AxisAlignedBB correctTicTacToeButton = null; + static Slot[] clickInOrderSlots = new Slot[36]; + static int lastChronomatronRound = 0; + static List<String> chronomatronPattern = new ArrayList<>(); + static int chronomatronMouseClicks = 0; + static int lastUltraSequencerClicked = 0; + static ItemStack[] experimentTableSlots = new ItemStack[54]; + static int pickBlockBind; + static boolean pickBlockBindSwapped = false; + + static double dungeonStartTime = 0; static double bloodOpenTime = 0; static double watcherClearTime = 0; static double bossClearTime = 0; @@ -283,9 +250,9 @@ public class TheMod keyBindings[0] = new KeyBinding("Open Maddox Menu", Keyboard.KEY_M, "Danker's Skyblock Mod"); keyBindings[1] = new KeyBinding("Start/Stop Skill Tracker", Keyboard.KEY_NUMPAD5, "Danker's Skyblock Mod"); - - for (int i = 0; i < keyBindings.length; i++) { - ClientRegistry.registerKeyBinding(keyBindings[i]); + + for (KeyBinding keyBinding : keyBindings) { + ClientRegistry.registerKeyBinding(keyBinding); } } @@ -332,7 +299,7 @@ public class TheMod new Thread(() -> { EntityPlayer player = Minecraft.getMinecraft().thePlayer; - System.err.println("Checking for updates..."); + System.out.println("Checking for updates..."); JsonObject latestRelease = APIHandler.getResponse("https://api.github.com/repos/bowser0000/SkyblockMod/releases/latest"); String latestTag = latestRelease.get("tag_name").getAsString(); @@ -348,7 +315,7 @@ public class TheMod try { Thread.sleep(2000); } catch (InterruptedException ex) { - System.err.println(ex); + ex.printStackTrace(); } player.addChatMessage(new ChatComponentText(ERROR_COLOUR + MODID + " is outdated. Please update to " + latestTag + ".\n").appendSibling(update)); } @@ -375,77 +342,62 @@ public class TheMod for (String section : actionBarSections) { if (section.contains("+") && section.contains("/") && section.contains("(")) { if (!section.contains("Runecrafting") && !section.contains("Carpentry")) { - int limit = section.contains("Farming") ? 60 : 50; + int limit = section.contains("Farming") || section.contains("Enchanting") ? 60 : 50; double currentXP = Double.parseDouble(section.substring(section.indexOf("(") + 1, section.indexOf("/")).replace(",", "")); int xpToLevelUp = Integer.parseInt(section.substring(section.indexOf("/") + 1, section.indexOf(")")).replaceAll(",", "")); xpLeft = xpToLevelUp - currentXP; int previousXP = Utils.getPastXpEarned(xpToLevelUp, limit); double totalXP = currentXP + previousXP; - double xpGained = Double.parseDouble(section.substring(section.indexOf("+") + 1, section.indexOf(" ")).replace(",", "")); String skill = section.substring(section.indexOf(" ") + 1, section.lastIndexOf(" ")); switch (skill) { case "Farming": lastSkill = "Farming"; - if (farmingXP == 0) { - farmingXP = totalXP; - } else { + if (farmingXP != 0) { if (skillStopwatch.isStarted() && !skillStopwatch.isSuspended()) farmingXPGained += totalXP - farmingXP; - farmingXP = totalXP; } + farmingXP = totalXP; break; case "Mining": lastSkill = "Mining"; - if (miningXP == 0) { - miningXP = totalXP; - } else { + if (miningXP != 0) { if (skillStopwatch.isStarted() && !skillStopwatch.isSuspended()) miningXPGained += totalXP - miningXP; - miningXP = totalXP; } + miningXP = totalXP; break; case "Combat": lastSkill = "Combat"; - if (combatXP == 0) { - combatXP = totalXP; - } else { + if (combatXP != 0) { if (skillStopwatch.isStarted() && !skillStopwatch.isSuspended()) combatXPGained += totalXP - combatXP; - combatXP = totalXP; } + combatXP = totalXP; break; case "Foraging": lastSkill = "Foraging"; - if (foragingXP == 0) { - foragingXP = totalXP; - } else { + if (foragingXP != 0) { if (skillStopwatch.isStarted() && !skillStopwatch.isSuspended()) foragingXPGained += totalXP - foragingXP; - foragingXP = totalXP; } + foragingXP = totalXP; break; case "Fishing": lastSkill = "Fishing"; - if (fishingXP == 0) { - fishingXP = totalXP; - } else { + if (fishingXP != 0) { if (skillStopwatch.isStarted() && !skillStopwatch.isSuspended()) fishingXPGained += totalXP - fishingXP; - fishingXP = totalXP; } + fishingXP = totalXP; break; case "Enchanting": lastSkill = "Enchanting"; - if (enchantingXP == 0) { - enchantingXP = totalXP; - } else { + if (enchantingXP != 0) { if (skillStopwatch.isStarted() && !skillStopwatch.isSuspended()) enchantingXPGained += totalXP - enchantingXP; - enchantingXP = totalXP; } + enchantingXP = totalXP; break; case "Alchemy": lastSkill = "Alchemy"; - if (alchemyXP == 0) { - alchemyXP = totalXP; - } else { + if (alchemyXP != 0) { if (skillStopwatch.isStarted() && !skillStopwatch.isSuspended()) alchemyXPGained += totalXP - alchemyXP; - alchemyXP = totalXP; } + alchemyXP = totalXP; break; default: System.err.println("Unknown skill."); @@ -457,7 +409,7 @@ public class TheMod double currentXp = Double.parseDouble(section.substring(section.indexOf("(") + 1, section.indexOf("/")).replace(",", "")); int limit; int totalXp; - if (section.contains("Farming")) { + if (section.contains("Farming") || section.contains("Enchanting")) { limit = 60; totalXp = 111672425; } else { @@ -465,7 +417,7 @@ public class TheMod totalXp = 55172425; } int previousXp = Utils.getPastXpEarned(Integer.parseInt(section.substring(section.indexOf("/") + 1, section.indexOf(")")).replaceAll(",", "")), limit); - double percentage = (double) Math.floor(((currentXp + previousXp) / totalXp) * 10000D) / 100D; + double percentage = Math.floor(((currentXp + previousXp) / totalXp) * 10000D) / 100D; NumberFormat nf = NumberFormat.getNumberInstance(Locale.US); skillTimer = SKILL_TIME; @@ -512,6 +464,13 @@ public class TheMod event.setCanceled(true); return; } + + if (!ToggleCommand.implosionMessages) { + if (message.contains("Your Implosion hit ") || message.contains("There are blocks in the way")) { + event.setCanceled(true); + return; + } + } if (ToggleCommand.oruoToggled && Utils.inDungeons) { // Don't set every answer to wrong with this question @@ -528,11 +487,14 @@ public class TheMod if (triviaAnswers != null && (message.contains("ⓐ") || message.contains("ⓑ") || message.contains("ⓒ"))) { boolean isSolution = false; for (String solution : triviaAnswers) { - if (message.contains(solution)) isSolution = true; + if (message.contains(solution)) { + isSolution = true; + break; + } } if (!isSolution) { char letter = message.charAt(5); - String option = message.substring(6, message.length()); + String option = message.substring(6); event.message = new ChatComponentText(" " + EnumChatFormatting.GOLD + letter + TRIVIA_WRONG_ANSWER_COLOUR + option); return; } @@ -551,7 +513,7 @@ public class TheMod trayIcon.displayMessage("Guild Party", message, TrayIcon.MessageType.INFO); tray.remove(trayIcon); } catch (Exception ex) { - System.err.print(ex); + ex.printStackTrace(); } } } @@ -1206,7 +1168,7 @@ public class TheMod @SubscribeEvent public void renderPlayerInfo(final RenderGameOverlayEvent.Post event) { - if (usingLabymod) return; + if (usingLabymod && !(Minecraft.getMinecraft().ingameGUI instanceof GuiIngameForge)) return; if (event.type != RenderGameOverlayEvent.ElementType.EXPERIENCE && event.type != RenderGameOverlayEvent.ElementType.JUMPBAR) return; renderEverything(); } @@ -1259,7 +1221,7 @@ public class TheMod if (ToggleCommand.cakeTimerToggled && Utils.inSkyblock) { double scale = ScaleCommand.cakeTimerScale; - double scaleReset = (double) Math.pow(scale, -1); + double scaleReset = Math.pow(scale, -1); GL11.glScaled(scale, scale, scale); double timeNow = System.currentTimeMillis() / 1000; @@ -1278,7 +1240,7 @@ public class TheMod } if (showSkillTracker && Utils.inSkyblock) { - int xpPerHour = 0; + int xpPerHour; double xpToShow = 0; switch (lastSkill) { case "Farming": @@ -1319,14 +1281,18 @@ public class TheMod new TextRenderer(mc, skillTrackerText, MoveCommand.skillTrackerXY[0], MoveCommand.skillTrackerXY[1], ScaleCommand.skillTrackerScale); } - + + if (ToggleCommand.waterToggled && Utils.inDungeons && waterAnswers != null) { + new TextRenderer(mc, waterAnswers, MoveCommand.waterAnswerXY[0], MoveCommand.waterAnswerXY[1], ScaleCommand.waterAnswerScale); + } + if (!DisplayCommand.display.equals("off")) { String dropsText = ""; String countText = ""; - String dropsTextTwo = ""; - String countTextTwo = ""; - String timeBetween = "Never"; - String bossesBetween = "Never"; + String dropsTextTwo; + String countTextTwo; + String timeBetween; + String bossesBetween; String drop20; double timeNow = System.currentTimeMillis() / 1000; NumberFormat nf = NumberFormat.getIntegerInstance(Locale.US); @@ -2262,6 +2228,9 @@ public class TheMod 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))); @@ -2285,16 +2254,42 @@ public class TheMod } } } + + 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).equals(StringUtils.stripControlCodes(itemName)))) return; + event.toolTip.removeIf(x -> { + x = StringUtils.stripControlCodes(x); + if (x.equals("minecraft:stained_glass")) return true; + return x.startsWith("NBT: "); + }); + event.toolTip.add(itemName); + event.toolTip.add(itemStack.getItem().getRegistryName()); + } + + } + } + } - + @SubscribeEvent public void onTick(TickEvent.ClientTickEvent event) { if (event.phase != Phase.START) return; - + Minecraft mc = Minecraft.getMinecraft(); World world = mc.theWorld; EntityPlayerSP player = mc.thePlayer; - + // Checks every second tickAmount++; if (tickAmount % 20 == 0) { @@ -2302,8 +2297,8 @@ public class TheMod Utils.checkForSkyblock(); Utils.checkForDungeons(); } - - if (DisplayCommand.auto && mc != null && world != null && player != null) { + + if (DisplayCommand.auto && world != null && player != null) { List<String> scoreboard = ScoreboardHandler.getSidebarLines(); boolean found = false; for (String s : scoreboard) { @@ -2347,8 +2342,8 @@ public class TheMod if (!found) DisplayCommand.display = "off"; ConfigHandler.writeStringConfig("misc", "display", DisplayCommand.display); } - - if (ToggleCommand.creeperToggled && Utils.inDungeons && world != null) { + + if (ToggleCommand.creeperToggled && Utils.inDungeons && world != null && player != null) { double x = player.posX; double y = player.posY; double z = player.posZ; @@ -2384,8 +2379,8 @@ public class TheMod drawCreeperLines = false; } } - - if (ToggleCommand.waterToggled && Utils.inDungeons && world != null) { + + if (ToggleCommand.waterToggled && Utils.inDungeons && world != null && player != null) { // multi thr |
