This commit is contained in:
Calclavia 2013-08-05 16:22:53 -04:00
commit cef14e88d1
5 changed files with 28 additions and 15 deletions

View file

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

View file

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

View file

@ -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
{

View file

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

View file

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