Cells now render dynamically on battery

This commit is contained in:
Aidan Brady 2013-08-05 13:16:39 -04:00
parent 0de97ab6fa
commit 5b1a070664
5 changed files with 12 additions and 8 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

View file

@ -62,7 +62,7 @@ public class ResonantInduction
public static final String VERSION = MAJOR_VERSION + "." + MINOR_VERSION + "." + REVISION_VERSION; public static final String VERSION = MAJOR_VERSION + "." + MINOR_VERSION + "." + REVISION_VERSION;
@Instance(ID) @Instance(ID)
public static ResonantInduction INSTNACE; public static ResonantInduction INSTANCE;
@SidedProxy(clientSide = ID + ".ClientProxy", serverSide = ID + ".CommonProxy") @SidedProxy(clientSide = ID + ".ClientProxy", serverSide = ID + ".CommonProxy")
public static CommonProxy proxy; public static CommonProxy proxy;

View file

@ -100,7 +100,7 @@ public class BlockBattery extends BlockBase implements ITileEntityProvider
if(!world.isRemote) if(!world.isRemote)
{ {
entityPlayer.openGui(ResonantInduction.INSTNACE, 0, world, x, y, z); entityPlayer.openGui(ResonantInduction.INSTANCE, 0, world, x, y, z);
} }
return true; return true;

View file

@ -47,7 +47,7 @@ public class BlockMultimeter extends BlockBase implements ITileEntityProvider
} }
else else
{ {
entityPlayer.openGui(ResonantInduction.INSTNACE, 0, world, x, y, z); entityPlayer.openGui(ResonantInduction.INSTANCE, 0, world, x, y, z);
} }
return true; return true;

View file

@ -71,9 +71,13 @@ public class RenderBattery extends TileEntitySpecialRenderer
MODEL.render(0.0625f); MODEL.render(0.0625f);
GL11.glPopMatrix(); GL11.glPopMatrix();
int renderAmount = 16; int renderAmount = Math.min(((TileEntityBattery)t).clientCells, 16);
if(renderAmount == 0)
{
return;
}
itemRender:
for (int i = 2; i < 6; i++) for (int i = 2; i < 6; i++)
{ {
ForgeDirection direction = ForgeDirection.getOrientation(i); ForgeDirection direction = ForgeDirection.getOrientation(i);
@ -130,9 +134,9 @@ public class RenderBattery extends TileEntitySpecialRenderer
this.renderItemSimple(this.fakeBattery); this.renderItemSimple(this.fakeBattery);
GL11.glPopMatrix(); GL11.glPopMatrix();
if (renderAmount-- <= 0) if (--renderAmount == 0)
{ {
break itemRender; return;
} }
} }
} }