fix some stuff, also fix sending exactly 19x more packets than needed lmao

This commit is contained in:
BallOfEnergy 2024-12-20 17:54:45 -06:00
parent 90cfd37a31
commit 88c1632481
2 changed files with 5 additions and 2 deletions

View File

@ -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"));
}

View File

@ -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;
}