diff --git a/src/resonantinduction/ClientProxy.java b/src/resonantinduction/ClientProxy.java index bb02c542..5e98c595 100644 --- a/src/resonantinduction/ClientProxy.java +++ b/src/resonantinduction/ClientProxy.java @@ -6,11 +6,11 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; import resonantinduction.base.Vector3; -import resonantinduction.battery.GuiBattery; import resonantinduction.battery.TileEntityBattery; import resonantinduction.contractor.TileEntityEMContractor; import resonantinduction.fx.FXElectricBolt; -import resonantinduction.multimeter.GuiMultimeter; +import resonantinduction.gui.GuiBattery; +import resonantinduction.gui.GuiMultimeter; import resonantinduction.multimeter.TileEntityMultimeter; import resonantinduction.render.BlockRenderingHandler; import resonantinduction.render.RenderBattery; diff --git a/src/resonantinduction/battery/TileEntityBattery.java b/src/resonantinduction/battery/TileEntityBattery.java index 4ea11541..88c1ff24 100644 --- a/src/resonantinduction/battery/TileEntityBattery.java +++ b/src/resonantinduction/battery/TileEntityBattery.java @@ -49,11 +49,6 @@ public class TileEntityBattery extends TileEntityBase implements IPacketReceiver if (!worldObj.isRemote) { - if (playersUsing.size() > 0) - { - this.updateInventory(); - } - if (ticks == 5 && !structure.isMultiblock) { update(); @@ -100,13 +95,18 @@ public class TileEntityBattery extends TileEntityBase implements IPacketReceiver player.closeScreen(); } - PacketHandler.sendTileEntityPacketToClients(this, getNetworkedData(new ArrayList()).toArray()); + updateInventory(); } prevStructure = structure; structure.wroteInventory = false; structure.didTick = false; + + if(playersUsing.size() > 0) + { + updateInventory(); + } } } diff --git a/src/resonantinduction/battery/GuiBattery.java b/src/resonantinduction/gui/GuiBattery.java similarity index 93% rename from src/resonantinduction/battery/GuiBattery.java rename to src/resonantinduction/gui/GuiBattery.java index b0cc682f..e6549141 100644 --- a/src/resonantinduction/battery/GuiBattery.java +++ b/src/resonantinduction/gui/GuiBattery.java @@ -1,4 +1,4 @@ -package resonantinduction.battery; +package resonantinduction.gui; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.entity.player.InventoryPlayer; @@ -8,6 +8,8 @@ import net.minecraft.util.StatCollector; import org.lwjgl.opengl.GL11; import resonantinduction.ResonantInduction; +import resonantinduction.battery.ContainerBattery; +import resonantinduction.battery.TileEntityBattery; public class GuiBattery extends GuiContainer { diff --git a/src/resonantinduction/multimeter/GuiMultimeter.java b/src/resonantinduction/gui/GuiMultimeter.java similarity index 95% rename from src/resonantinduction/multimeter/GuiMultimeter.java rename to src/resonantinduction/gui/GuiMultimeter.java index 59941018..cf068e4d 100644 --- a/src/resonantinduction/multimeter/GuiMultimeter.java +++ b/src/resonantinduction/gui/GuiMultimeter.java @@ -1,7 +1,7 @@ /** * */ -package resonantinduction.multimeter; +package resonantinduction.gui; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiTextField; @@ -13,6 +13,8 @@ import org.lwjgl.opengl.GL11; import resonantinduction.PacketHandler; import resonantinduction.ResonantInduction; +import resonantinduction.multimeter.ContainerMultimeter; +import resonantinduction.multimeter.TileEntityMultimeter; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; diff --git a/src/resonantinduction/render/RenderBattery.java b/src/resonantinduction/render/RenderBattery.java index b4ca4b97..99f24a98 100644 --- a/src/resonantinduction/render/RenderBattery.java +++ b/src/resonantinduction/render/RenderBattery.java @@ -22,6 +22,7 @@ import net.minecraftforge.common.ForgeDirection; import org.lwjgl.opengl.GL11; import resonantinduction.ResonantInduction; +import resonantinduction.base.Vector3; import resonantinduction.battery.TileEntityBattery; import resonantinduction.model.ModelBattery; import cpw.mods.fml.relauncher.Side; @@ -132,13 +133,21 @@ public class RenderBattery extends TileEntitySpecialRenderer } GL11.glScalef(0.5f, 0.5f, 0.5f); - this.renderItemSimple(this.fakeBattery); - GL11.glPopMatrix(); - - if (--renderAmount == 0) + + Vector3 sideVec = new Vector3(t).getFromSide(direction); + + if(t.worldObj.isAirBlock((int)sideVec.x, (int)sideVec.y, (int)sideVec.z)) { - return; + this.renderItemSimple(this.fakeBattery); + + if (--renderAmount <= 0) + { + GL11.glPopMatrix(); + return; + } } + + GL11.glPopMatrix(); } } }