Search in sources :

Example 1 with TileEntityRefinery

use of me.desht.pneumaticcraft.common.tileentity.TileEntityRefinery in project pnc-repressurized by TeamPneumatic.

the class GuiRefinery method initGui.

@Override
public void initGui() {
    super.initGui();
    addWidget(new WidgetTemperature(-1, guiLeft + 32, guiTop + 20, 273, 673, te.getHeatExchangerLogic(null), 373));
    addWidget(new WidgetTank(-1, guiLeft + 8, guiTop + 13, te.getInputTank()));
    int x = guiLeft + 95;
    int y = guiTop + 17;
    addWidget(new WidgetTank(-1, x, y, te.getOutputTank()));
    refineries = new ArrayList<>();
    refineries.add(te);
    TileEntityRefinery refinery = te;
    while (refinery.getTileCache()[EnumFacing.UP.ordinal()].getTileEntity() instanceof TileEntityRefinery) {
        refinery = (TileEntityRefinery) refinery.getTileCache()[EnumFacing.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();
    }
}
Also used : TileEntityRefinery(me.desht.pneumaticcraft.common.tileentity.TileEntityRefinery) WidgetTemperature(me.desht.pneumaticcraft.client.gui.widget.WidgetTemperature) WidgetTank(me.desht.pneumaticcraft.client.gui.widget.WidgetTank)

Example 2 with TileEntityRefinery

use of me.desht.pneumaticcraft.common.tileentity.TileEntityRefinery in project pnc-repressurized by TeamPneumatic.

the class BlockRefinery method onBlockActivated.

@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float par7, float par8, float par9) {
    TileEntityRefinery refinery = (TileEntityRefinery) world.getTileEntity(pos);
    refinery = refinery.getMasterRefinery();
    return super.onBlockActivated(world, refinery.getPos(), state, player, hand, side, par7, par8, par9);
}
Also used : TileEntityRefinery(me.desht.pneumaticcraft.common.tileentity.TileEntityRefinery)

Aggregations

TileEntityRefinery (me.desht.pneumaticcraft.common.tileentity.TileEntityRefinery)2 WidgetTank (me.desht.pneumaticcraft.client.gui.widget.WidgetTank)1 WidgetTemperature (me.desht.pneumaticcraft.client.gui.widget.WidgetTemperature)1