From 88c1632481314c93480008c67de5964b314d0271 Mon Sep 17 00:00:00 2001 From: BallOfEnergy <66693744+BallOfEnergy1@users.noreply.github.com> Date: Fri, 20 Dec 2024 17:54:45 -0600 Subject: [PATCH] fix some stuff, also fix sending exactly 19x more packets than needed lmao --- src/main/java/com/hbm/commands/CommandPacketInfo.java | 5 ++++- src/main/java/com/hbm/tileentity/TileEntityLoadedBase.java | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/hbm/commands/CommandPacketInfo.java b/src/main/java/com/hbm/commands/CommandPacketInfo.java index d4d3cb0f3..dec1fbff7 100644 --- a/src/main/java/com/hbm/commands/CommandPacketInfo.java +++ b/src/main/java/com/hbm/commands/CommandPacketInfo.java @@ -58,7 +58,10 @@ public class CommandPacketInfo extends CommandBase { sender.addChatMessage(new ChatComponentText(EnumChatFormatting.GOLD + "Packet Info: ")); sender.addChatMessage(new ChatComponentText(EnumChatFormatting.YELLOW + "Amount total: " + totalCnt)); sender.addChatMessage(new ChatComponentText(EnumChatFormatting.YELLOW + "Amount remaining: " + PacketThreading.threadPool.getQueue().size())); - sender.addChatMessage(new ChatComponentText(EnumChatFormatting.YELLOW + "% Remaining to process: " + BobMathUtil.roundDecimal(((double) PacketThreading.threadPool.getQueue().size() / totalCnt) * 100, 2) + "%")); + + if(totalCnt != 0) + sender.addChatMessage(new ChatComponentText(EnumChatFormatting.YELLOW + "% Remaining to process: " + BobMathUtil.roundDecimal(((double) PacketThreading.threadPool.getQueue().size() / totalCnt) * 100, 2) + "%")); + sender.addChatMessage(new ChatComponentText(EnumChatFormatting.YELLOW + "Time spent waiting on thread(s) last tick: " + BobMathUtil.roundDecimal(PacketThreading.nanoTimeWaited / 1000000d, 4) + "ms")); } diff --git a/src/main/java/com/hbm/tileentity/TileEntityLoadedBase.java b/src/main/java/com/hbm/tileentity/TileEntityLoadedBase.java index c151824a9..6658452b7 100644 --- a/src/main/java/com/hbm/tileentity/TileEntityLoadedBase.java +++ b/src/main/java/com/hbm/tileentity/TileEntityLoadedBase.java @@ -80,7 +80,7 @@ public class TileEntityLoadedBase extends TileEntity implements ILoadedTile, IBu // In my testing, this can be reliably reproduced with a full fluid barrel, for instance. // I think it might be fixable by doing something with getDescriptionPacket() and onDataPacket(), // but this sidesteps the problem for the mean time. - if (preBuf.equals(lastPackedBuf) && this.worldObj.getWorldTime() % 20 == 0) { + if (preBuf.equals(lastPackedBuf) && this.worldObj.getWorldTime() % 20 != 0) { return; }