use of pneumaticCraft.common.tileentity.TileEntityKeroseneLamp in project PneumaticCraft by MineMaarten.
the class ModelKeroseneLamp method renderStatic.
@Override
public void renderStatic(float size, TileEntity te) {
ForgeDirection sideConnected = ForgeDirection.DOWN;
if (te != null) {
sideConnected = ((TileEntityKeroseneLamp) te).getSideConnected();
}
Tank.render(size);
Holder1.render(size);
Holder2.render(size);
Base.render(size);
Top.render(size);
if (sideConnected != ForgeDirection.DOWN) {
Support1.render(size);
if (sideConnected != ForgeDirection.UP) {
SupportSide.rotateAngleY = 0;
ForgeDirection rotation = ((TileEntityKeroseneLamp) te).getRotation();
if (rotation != ForgeDirection.UP && rotation != ForgeDirection.DOWN) {
while (sideConnected != rotation.getOpposite()) {
sideConnected = sideConnected.getRotation(ForgeDirection.DOWN);
SupportSide.rotateAngleY += Math.toRadians(90);
}
}
SupportSide2.rotateAngleY = SupportSide.rotateAngleY;
SupportSide.render(size);
SupportSide2.render(size);
}
}
if (te != null) {
FluidTankInfo info = ((TileEntityKeroseneLamp) te).getTankInfo(null)[0];
if (info.fluid != null && info.fluid.amount > 10) {
float percentageFull = (float) info.fluid.amount / info.capacity;
RenderInfo renderInfo = new RenderInfo(-3 / 16F + 0.01F, 23 / 16F - percentageFull * 2.999F / 16F, -3 / 16F + 0.01F, 3 / 16F - 0.01F, 22.99F / 16F, 3 / 16F - 0.01F);
RenderUtils.INSTANCE.renderLiquid(info, renderInfo, te.getWorldObj());
}
}
}
Aggregations