From 25271de81c778ed66e37156749381609a3385acc Mon Sep 17 00:00:00 2001 From: Boblet Date: Mon, 16 Mar 2026 16:39:07 +0100 Subject: [PATCH] can i have uhhhhhh labels --- changelog | 4 +++- .../java/com/hbm/extprop/HbmPlayerProps.java | 15 ++++++++------ .../render/tileentity/RenderRBMKGauge.java | 20 +++++++++++++++++++ 3 files changed, 32 insertions(+), 7 deletions(-) diff --git a/changelog b/changelog index a52ef30e0..882222e24 100644 --- a/changelog +++ b/changelog @@ -1,6 +1,8 @@ ## Changed * Doubled bismuth and tantalum yields from high-performance solvent bedrock ore processing * Hoppers and buckets can now be made out of steel +* RoR gauges now show the lowest and highest configured value on the actual gauge ## Fixed -* Fixed size 15 dual kerosene thruster not rendering at all \ No newline at end of file +* Fixed size 15 dual kerosene thruster not rendering at all +* Fixed HUD/jetpack toggle popup not working at all on multiplayer servers \ No newline at end of file diff --git a/src/main/java/com/hbm/extprop/HbmPlayerProps.java b/src/main/java/com/hbm/extprop/HbmPlayerProps.java index e1b64d8e9..207bb6d44 100644 --- a/src/main/java/com/hbm/extprop/HbmPlayerProps.java +++ b/src/main/java/com/hbm/extprop/HbmPlayerProps.java @@ -5,12 +5,15 @@ import com.hbm.handler.ArmorModHandler; import com.hbm.handler.HbmKeybinds.EnumKeybind; import com.hbm.items.armor.ItemModShield; import com.hbm.main.MainRegistry; +import com.hbm.packet.PacketDispatcher; +import com.hbm.packet.toclient.PlayerInformPacket; import com.hbm.tileentity.IGUIProvider; import cpw.mods.fml.common.network.internal.FMLNetworkHandler; import io.netty.buffer.ByteBuf; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; @@ -86,9 +89,9 @@ public class HbmPlayerProps implements IExtendedEntityProperties { this.enableBackpack = !this.enableBackpack; if(this.enableBackpack) - MainRegistry.proxy.displayTooltip(EnumChatFormatting.GREEN + "Jetpack ON", MainRegistry.proxy.ID_JETPACK); + PacketDispatcher.wrapper.sendTo(new PlayerInformPacket(EnumChatFormatting.GREEN + "Jetpack ON", MainRegistry.proxy.ID_JETPACK, 1000), (EntityPlayerMP) player); else - MainRegistry.proxy.displayTooltip(EnumChatFormatting.RED + "Jetpack OFF", MainRegistry.proxy.ID_JETPACK); + PacketDispatcher.wrapper.sendTo(new PlayerInformPacket(EnumChatFormatting.RED + "Jetpack OFF", MainRegistry.proxy.ID_JETPACK, 1000), (EntityPlayerMP) player); } } if (key == EnumKeybind.TOGGLE_MAGNET){ @@ -96,9 +99,9 @@ public class HbmPlayerProps implements IExtendedEntityProperties { this.enableMagnet = !this.enableMagnet; if(this.enableMagnet) - MainRegistry.proxy.displayTooltip(EnumChatFormatting.GREEN + "Magnet ON", MainRegistry.proxy.ID_MAGNET); + PacketDispatcher.wrapper.sendTo(new PlayerInformPacket(EnumChatFormatting.GREEN + "Magnet ON", MainRegistry.proxy.ID_MAGNET, 1000), (EntityPlayerMP) player); else - MainRegistry.proxy.displayTooltip(EnumChatFormatting.RED + "Magnet OFF", MainRegistry.proxy.ID_MAGNET); + PacketDispatcher.wrapper.sendTo(new PlayerInformPacket(EnumChatFormatting.GREEN + "Magnet ON", MainRegistry.proxy.ID_MAGNET, 1000), (EntityPlayerMP) player); } } if(key == EnumKeybind.TOGGLE_HEAD) { @@ -107,9 +110,9 @@ public class HbmPlayerProps implements IExtendedEntityProperties { this.enableHUD = !this.enableHUD; if(this.enableHUD) - MainRegistry.proxy.displayTooltip(EnumChatFormatting.GREEN + "HUD ON", MainRegistry.proxy.ID_HUD); + PacketDispatcher.wrapper.sendTo(new PlayerInformPacket(EnumChatFormatting.GREEN + "HUD ON", MainRegistry.proxy.ID_HUD, 1000), (EntityPlayerMP) player); else - MainRegistry.proxy.displayTooltip(EnumChatFormatting.RED + "HUD OFF", MainRegistry.proxy.ID_HUD); + PacketDispatcher.wrapper.sendTo(new PlayerInformPacket(EnumChatFormatting.GREEN + "HUD ON", MainRegistry.proxy.ID_HUD, 1000), (EntityPlayerMP) player); } } diff --git a/src/main/java/com/hbm/render/tileentity/RenderRBMKGauge.java b/src/main/java/com/hbm/render/tileentity/RenderRBMKGauge.java index 398502319..3cd143d31 100644 --- a/src/main/java/com/hbm/render/tileentity/RenderRBMKGauge.java +++ b/src/main/java/com/hbm/render/tileentity/RenderRBMKGauge.java @@ -5,6 +5,7 @@ import org.lwjgl.opengl.GL11; import com.hbm.main.ResourceManager; import com.hbm.tileentity.machine.rbmk.TileEntityRBMKGauge; import com.hbm.tileentity.machine.rbmk.TileEntityRBMKGauge.GaugeUnit; +import com.hbm.util.BobMathUtil; import com.hbm.util.ColorUtil; import net.minecraft.client.Minecraft; @@ -71,6 +72,25 @@ public class RenderRBMKGauge extends TileEntitySpecialRenderer { FontRenderer font = Minecraft.getMinecraft().fontRenderer; int height = font.FONT_HEIGHT; + + double lineScale = 0.0025D; + String lineLower = unit.min <= 10_000 ? unit.min + "" : BobMathUtil.getShortNumber(unit.min); + String lineUpper = unit.max <= 10_000 ? unit.max + "" : BobMathUtil.getShortNumber(unit.max); + + for(int j = 0; j < 2; j++) { + GL11.glPushMatrix(); + GL11.glTranslated(0, 0.4375, -0.125); + GL11.glRotated(10 + j * 50, -1, 0, 0); + GL11.glTranslated(0, -0.4375, 0.125); + + GL11.glTranslated(0.032, 0.4375, 0.125); + GL11.glScaled(lineScale, -lineScale, lineScale); + GL11.glNormal3f(0.0F, 0.0F, -1.0F); + GL11.glRotatef(90, 0, 1, 0); + font.drawString(j == 0 ? lineLower : lineUpper, 0, -height / 2, 0x000000); + GL11.glPopMatrix(); + } + if(unit.label != null && !unit.label.isEmpty()) { GL11.glTranslated(0.01, 0.3125, 0);