From 732bba514610765be30f3e1164ec7db57e0b7f44 Mon Sep 17 00:00:00 2001 From: MachineMuse Date: Wed, 10 Sep 2014 12:03:39 -0600 Subject: [PATCH] fixed graphical meters --- .../machinemuse/powersuits/block/BlockLuxCapacitor.java | 3 ++- .../machinemuse/powersuits/block/BlockTinkerTable.scala | 2 +- .../machinemuse/powersuits/event/ClientTickHandler.scala | 8 ++++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/scala/net/machinemuse/powersuits/block/BlockLuxCapacitor.java b/src/main/scala/net/machinemuse/powersuits/block/BlockLuxCapacitor.java index 78a31b1..4af3e3b 100644 --- a/src/main/scala/net/machinemuse/powersuits/block/BlockLuxCapacitor.java +++ b/src/main/scala/net/machinemuse/powersuits/block/BlockLuxCapacitor.java @@ -85,7 +85,8 @@ public class BlockLuxCapacitor extends Block { } @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister iconRegister) { + @Override + public void registerBlockIcons(IIconRegister iconRegister) { this.blockIcon = iconRegister.registerIcon(MuseIcon.ICON_PREFIX + "bluelight"); } diff --git a/src/main/scala/net/machinemuse/powersuits/block/BlockTinkerTable.scala b/src/main/scala/net/machinemuse/powersuits/block/BlockTinkerTable.scala index 01e61a8..dff9a90 100644 --- a/src/main/scala/net/machinemuse/powersuits/block/BlockTinkerTable.scala +++ b/src/main/scala/net/machinemuse/powersuits/block/BlockTinkerTable.scala @@ -40,7 +40,7 @@ object BlockTinkerTable extends Block(Material.iron) { this } - @SideOnly(Side.CLIENT) def registerIcons(iconRegister: IIconRegister) { + @SideOnly(Side.CLIENT) override def registerBlockIcons(iconRegister: IIconRegister) { this.blockIcon = iconRegister.registerIcon(MuseIcon.ICON_PREFIX + "heatresistantplating") energyIcon = blockIcon } diff --git a/src/main/scala/net/machinemuse/powersuits/event/ClientTickHandler.scala b/src/main/scala/net/machinemuse/powersuits/event/ClientTickHandler.scala index ea8da97..4031e34 100644 --- a/src/main/scala/net/machinemuse/powersuits/event/ClientTickHandler.scala +++ b/src/main/scala/net/machinemuse/powersuits/event/ClientTickHandler.scala @@ -4,6 +4,7 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent import cpw.mods.fml.common.gameevent.TickEvent import cpw.mods.fml.common.gameevent.TickEvent.{ClientTickEvent, RenderTickEvent} import net.machinemuse.general.gui.{EnergyMeter, HeatMeter} +import net.machinemuse.numina.general.MuseLogger import net.machinemuse.numina.network.{MusePacket, PacketSender} import net.machinemuse.powersuits.block.BlockTinkerTable import net.machinemuse.powersuits.common.Config @@ -45,7 +46,7 @@ class ClientTickHandler { if (inputmap.hasChanged) { inputmap.refresh() val inputPacket: MusePacket = new MusePacketPlayerUpdate(player, inputmap) - PacketSender.sendToServer(inputPacket.getPacket131) + PacketSender.sendToServer(inputPacket) } } } @@ -71,12 +72,15 @@ class ClientTickHandler { val maxEnergy: Double = ElectricItemUtils.getMaxEnergy(player) val currHeat: Double = MuseHeatUtils.getPlayerHeat(player) val maxHeat: Double = MuseHeatUtils.getMaxHeat(player) + MuseLogger.logDebug("A") if (maxEnergy > 0 && BlockTinkerTable.energyIcon != null) { + MuseLogger.logDebug("B") val currStr: String = MuseStringUtils.formatNumberShort(currEnergy) val maxStr: String = MuseStringUtils.formatNumberShort(maxEnergy) val currHeatStr: String = MuseStringUtils.formatNumberShort(currHeat) val maxHeatStr: String = MuseStringUtils.formatNumberShort(maxHeat) - if (Config.useGraphicalMeters) { + if (Config.useGraphicalMeters) { MuseLogger.logDebug("C") + if (energy == null) { energy = new EnergyMeter heat = new HeatMeter