Merge branch 'master' of https://github.com/calclavia/Resonant-Induction
This commit is contained in:
commit
747bbd4c3f
6 changed files with 13 additions and 39 deletions
Binary file not shown.
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.8 KiB |
|
@ -62,7 +62,7 @@ public class ResonantInduction
|
|||
public static final String VERSION = MAJOR_VERSION + "." + MINOR_VERSION + "." + REVISION_VERSION;
|
||||
|
||||
@Instance(ID)
|
||||
public static ResonantInduction INSTNACE;
|
||||
public static ResonantInduction INSTANCE;
|
||||
|
||||
@SidedProxy(clientSide = ID + ".ClientProxy", serverSide = ID + ".CommonProxy")
|
||||
public static CommonProxy proxy;
|
||||
|
@ -168,8 +168,6 @@ public class ResonantInduction
|
|||
GameRegistry.registerTileEntity(TileEntityEMContractor.class, blockEMContractor.getUnlocalizedName());
|
||||
GameRegistry.registerTileEntity(TileEntityBattery.class, blockBattery.getUnlocalizedName());
|
||||
|
||||
TickRegistry.registerTickHandler(new BatteryManager(), Side.SERVER);
|
||||
|
||||
ResonantInduction.proxy.registerRenderers();
|
||||
|
||||
TabRI.ITEMSTACK = new ItemStack(blockTesla);
|
||||
|
|
|
@ -1,42 +1,14 @@
|
|||
package resonantinduction.battery;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import resonantinduction.api.IBattery;
|
||||
import cpw.mods.fml.common.ITickHandler;
|
||||
import cpw.mods.fml.common.TickType;
|
||||
|
||||
public class BatteryManager implements ITickHandler
|
||||
public class BatteryManager
|
||||
{
|
||||
public static final int CELLS_PER_BATTERY = 16;
|
||||
|
||||
@Override
|
||||
public void tickStart(EnumSet<TickType> type, Object... tickData)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tickEnd(EnumSet<TickType> type, Object... tickData)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumSet<TickType> ticks()
|
||||
{
|
||||
return EnumSet.of(TickType.WORLD);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLabel()
|
||||
{
|
||||
return "BatteryMultiblockManager";
|
||||
}
|
||||
|
||||
public static class SlotOut extends Slot
|
||||
{
|
||||
public SlotOut(IInventory inventory, int index, int x, int y)
|
||||
|
|
|
@ -127,7 +127,7 @@ public class BlockBattery extends BlockBase implements ITileEntityProvider
|
|||
|
||||
if (!world.isRemote)
|
||||
{
|
||||
entityPlayer.openGui(ResonantInduction.INSTNACE, 0, world, x, y, z);
|
||||
entityPlayer.openGui(ResonantInduction.INSTANCE, 0, world, x, y, z);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -90,7 +90,7 @@ public class BlockMultimeter extends BlockBase implements ITileEntityProvider
|
|||
}
|
||||
else
|
||||
{
|
||||
entityPlayer.openGui(ResonantInduction.INSTNACE, 0, world, x, y, z);
|
||||
entityPlayer.openGui(ResonantInduction.INSTANCE, 0, world, x, y, z);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -71,9 +71,13 @@ public class RenderBattery extends TileEntitySpecialRenderer
|
|||
MODEL.render(0.0625f);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
int renderAmount = 16;
|
||||
|
||||
itemRender:
|
||||
int renderAmount = Math.min(((TileEntityBattery)t).clientCells, 16);
|
||||
|
||||
if(renderAmount == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 2; i < 6; i++)
|
||||
{
|
||||
ForgeDirection direction = ForgeDirection.getOrientation(i);
|
||||
|
@ -130,9 +134,9 @@ public class RenderBattery extends TileEntitySpecialRenderer
|
|||
this.renderItemSimple(this.fakeBattery);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
if (renderAmount-- <= 0)
|
||||
if (--renderAmount == 0)
|
||||
{
|
||||
break itemRender;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue