diff options
author | bowser0000 <bowser0000@gmail.com> | 2020-10-26 00:05:01 -0400 |
---|---|---|
committer | bowser0000 <bowser0000@gmail.com> | 2020-10-26 00:05:01 -0400 |
commit | d4f348736c7144dcf109b4182134d84276e58d58 (patch) | |
tree | 205738a34e5af59be0dc0614e46838346d04acd0 | |
parent | 7296e488bfe96eeb1cc91bbaeb3411f43d1f4386 (diff) | |
download | SkyblockMod-d4f348736c7144dcf109b4182134d84276e58d58.tar.gz SkyblockMod-d4f348736c7144dcf109b4182134d84276e58d58.tar.bz2 SkyblockMod-d4f348736c7144dcf109b4182134d84276e58d58.zip |
Fix Spirit Boots fix stops working when disconnecting from server
Also fix rare crash in blaze puzzle solver
-rw-r--r-- | src/main/java/me/Danker/TheMod.java | 11 | ||||
-rw-r--r-- | src/main/java/me/Danker/handlers/PacketHandler.java | 2 |
2 files changed, 4 insertions, 9 deletions
diff --git a/src/main/java/me/Danker/TheMod.java b/src/main/java/me/Danker/TheMod.java index f5f508a..9f19c97 100644 --- a/src/main/java/me/Danker/TheMod.java +++ b/src/main/java/me/Danker/TheMod.java @@ -793,7 +793,7 @@ public class TheMod cf.writeIntConfig("fishing", "milestone", lc.fishingMilestone); increaseSeaCreatures(); } else if (message.contains("Dungeon starts in 1 second.")) { // Dungeons Stuff - dungeonStartTime = System.currentTimeMillis() / 1000; + dungeonStartTime = System.currentTimeMillis() / 1000 + 1; bloodOpenTime = dungeonStartTime; watcherClearTime = dungeonStartTime; bossClearTime = dungeonStartTime; @@ -1932,7 +1932,7 @@ public class TheMod // Checks 5 times per second if (tickAmount % 4 == 0) { - if (ToggleCommand.blazeToggled && Utils.inDungeons) { + if (ToggleCommand.blazeToggled && Utils.inDungeons && mc.theWorld != null) { List<Entity> entities = mc.theWorld.getLoadedEntityList(); int highestHealth = 0; highestBlaze = null; @@ -2173,11 +2173,8 @@ public class TheMod @SubscribeEvent public void onServerConnect(ClientConnectedToServerEvent event) { - if (!PacketHandler.added) { - event.manager.channel().pipeline().addBefore("packet_handler", "danker_packet_handler", new PacketHandler()); - PacketHandler.added = true; - System.out.println("Added packet handler to channel pipeline."); - } + event.manager.channel().pipeline().addBefore("packet_handler", "danker_packet_handler", new PacketHandler()); + System.out.println("Added packet handler to channel pipeline."); } public void increaseSeaCreatures() { diff --git a/src/main/java/me/Danker/handlers/PacketHandler.java b/src/main/java/me/Danker/handlers/PacketHandler.java index 56bbc24..ed1c8b0 100644 --- a/src/main/java/me/Danker/handlers/PacketHandler.java +++ b/src/main/java/me/Danker/handlers/PacketHandler.java @@ -10,8 +10,6 @@ import net.minecraft.network.Packet; import net.minecraft.network.play.server.S04PacketEntityEquipment; public class PacketHandler extends ChannelDuplexHandler { - - public static boolean added = false; @Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { |