From 0e082336fb25c9591785de2a78a16d289d37cb40 Mon Sep 17 00:00:00 2001 From: Deeplerg <47917846+deeplerg@users.noreply.github.com> Date: Fri, 7 Aug 2026 18:36:02 +0500 Subject: [PATCH] I18N CALL SERVERSIDE - GREAT JOB: heavy metal --- .../hbm/items/tool/ItemPollutionDetector.java | 34 +++++++++++++++---- 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/hbm/items/tool/ItemPollutionDetector.java b/src/main/java/com/hbm/items/tool/ItemPollutionDetector.java index c05f62632..c35e5ab44 100644 --- a/src/main/java/com/hbm/items/tool/ItemPollutionDetector.java +++ b/src/main/java/com/hbm/items/tool/ItemPollutionDetector.java @@ -19,9 +19,9 @@ public class ItemPollutionDetector extends Item { @Override public void onUpdate(ItemStack stack, World world, Entity entity, int i, boolean bool) { - + if(!(entity instanceof EntityPlayerMP) || world.getTotalWorldTime() % 10 != 0) return; - + PollutionData data = PollutionHandler.getPollutionData(world, (int) Math.floor(entity.posX), (int) Math.floor(entity.posY), (int) Math.floor(entity.posZ)); if(data == null) data = new PollutionData(); @@ -34,10 +34,32 @@ public class ItemPollutionDetector extends Item { poison = ((int) (poison * 100)) / 100F; heavymetal = ((int) (heavymetal * 100)) / 100F; //fallout = ((int) (fallout * 100)) / 100F; - - PacketDispatcher.wrapper.sendTo(new PlayerInformPacket(ChatBuilder.start(I18nUtil.resolveKey("pollution.soot") + ": " + soot).color(EnumChatFormatting.YELLOW).flush(), 100, 4000), (EntityPlayerMP) entity); - PacketDispatcher.wrapper.sendTo(new PlayerInformPacket(ChatBuilder.start(I18nUtil.resolveKey("pollution.poison") + ": " + poison).color(EnumChatFormatting.YELLOW).flush(), 101, 4000), (EntityPlayerMP) entity); - PacketDispatcher.wrapper.sendTo(new PlayerInformPacket(ChatBuilder.start(I18nUtil.resolveKey("pollution.heavymetal") + ": " + heavymetal).color(EnumChatFormatting.YELLOW).flush(), 102, 4000), (EntityPlayerMP) entity); + + PacketDispatcher.wrapper.sendTo( + new PlayerInformPacket( + ChatBuilder.startTranslation("pollution.soot") + .color(EnumChatFormatting.YELLOW) + .next(": " + soot) + .color(EnumChatFormatting.YELLOW) + .flush(), 100, 4000), + (EntityPlayerMP) entity); + PacketDispatcher.wrapper.sendTo( + new PlayerInformPacket( + ChatBuilder.startTranslation("pollution.poison") + .color(EnumChatFormatting.YELLOW) + .next(": " + poison) + .color(EnumChatFormatting.YELLOW) + .flush(), 101, 4000), + (EntityPlayerMP) entity); + PacketDispatcher.wrapper.sendTo( + new PlayerInformPacket( + ChatBuilder.startTranslation("pollution.heavymetal") + .color(EnumChatFormatting.YELLOW) + .next(": " + heavymetal) + .color(EnumChatFormatting.YELLOW) + .flush(), 102, 4000), + (EntityPlayerMP) entity); + //PacketDispatcher.wrapper.sendTo(new PlayerInformPacket(ChatBuilder.start("Fallout: " + fallout).color(EnumChatFormatting.YELLOW).flush(), 103, 4000), (EntityPlayerMP) entity); } }