use of pneumaticCraft.common.tileentity.TileEntityRefinery in project PneumaticCraft by MineMaarten.
the class GuiRefinery method initGui.
@Override
public void initGui() {
super.initGui();
addWidget(new WidgetTemperature(-1, guiLeft + 32, guiTop + 20, 273, 673, te.getHeatExchangerLogic(ForgeDirection.UNKNOWN), 373));
addWidget(new WidgetTank(-1, guiLeft + 8, guiTop + 13, te.getOilTank()));
int x = guiLeft + 95;
int y = guiTop + 17;
addWidget(new WidgetTank(-1, x, y, te.getOutputTank()));
refineries = new ArrayList<TileEntityRefinery>();
refineries.add(te);
TileEntityRefinery refinery = te;
while (refinery.getTileCache()[ForgeDirection.UP.ordinal()].getTileEntity() instanceof TileEntityRefinery) {
refinery = (TileEntityRefinery) refinery.getTileCache()[ForgeDirection.UP.ordinal()].getTileEntity();
x += 20;
y -= 4;
if (refineries.size() < 4)
addWidget(new WidgetTank(-1, x, y, refinery.getOutputTank()));
refineries.add(refinery);
}
if (refineries.size() < 2 || refineries.size() > 4) {
problemTab.openWindow();
}
}
use of pneumaticCraft.common.tileentity.TileEntityRefinery in project PneumaticCraft by MineMaarten.
the class BlockRefinery method onBlockActivated.
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) {
TileEntityRefinery refinery = (TileEntityRefinery) world.getTileEntity(x, y, z);
refinery = refinery.getMasterRefinery();
return super.onBlockActivated(world, x, refinery.yCoord, z, player, par6, par7, par8, par9);
}
use of pneumaticCraft.common.tileentity.TileEntityRefinery in project PneumaticCraft by MineMaarten.
the class ModelRefinery method renderStatic.
@Override
public void renderStatic(float size, TileEntity te) {
outputTank.render(size);
inputTank.render(size);
machineLeft.render(size);
machineRight.render(size);
machineMiddle.render(size);
if (te != null) {
TileEntityRefinery refinery = (TileEntityRefinery) te;
FluidTankInfo info = new FluidTankInfo(refinery.getOilTank());
if (info.fluid != null && info.fluid.amount > 10) {
float percentageFull = (float) info.fluid.amount / info.capacity;
RenderInfo renderInfo = new RenderInfo(-4 / 16F + 0.01F, 22 / 16F - percentageFull * 13.999F / 16F, 3 / 16F + 0.01F, 4 / 16F - 0.01F, 22 / 16F, 8 / 16F - 0.01F);
RenderUtils.INSTANCE.renderLiquid(info, renderInfo, refinery.getWorldObj());
}
info = refinery.getTankInfo(null)[1];
if (info.fluid != null && info.fluid.amount > 10) {
float percentageFull = (float) info.fluid.amount / info.capacity;
RenderInfo renderInfo = new RenderInfo(-4 / 16F + 0.01F, 24 / 16F - percentageFull * 15.999F / 16F, -8 / 16F + 0.01F, 4 / 16F - 0.01F, 24 / 16F, -3 / 16F - 0.01F);
RenderUtils.INSTANCE.renderLiquid(info, renderInfo, refinery.getWorldObj());
}
}
}
Aggregations