Search in sources :

Example 1 with IHeatExchanger

use of pneumaticCraft.api.tileentity.IHeatExchanger in project PneumaticCraft by MineMaarten.

the class GuiAdvancedAirCompressor method initGui.

@Override
public void initGui() {
    super.initGui();
    addWidget(new WidgetTemperature(0, guiLeft + 87, guiTop + 20, 273, 675, ((IHeatExchanger) te).getHeatExchangerLogic(ForgeDirection.UNKNOWN), 325, 625));
}
Also used : IHeatExchanger(pneumaticCraft.api.tileentity.IHeatExchanger) WidgetTemperature(pneumaticCraft.client.gui.widget.WidgetTemperature)

Example 2 with IHeatExchanger

use of pneumaticCraft.api.tileentity.IHeatExchanger in project PneumaticCraft by MineMaarten.

the class GuiAdvancedLiquidCompressor method initGui.

@Override
public void initGui() {
    super.initGui();
    addWidget(new WidgetTemperature(0, guiLeft + 92, guiTop + 20, 273, 675, ((IHeatExchanger) te).getHeatExchangerLogic(ForgeDirection.UNKNOWN), 325, 625));
}
Also used : IHeatExchanger(pneumaticCraft.api.tileentity.IHeatExchanger) WidgetTemperature(pneumaticCraft.client.gui.widget.WidgetTemperature)

Example 3 with IHeatExchanger

use of pneumaticCraft.api.tileentity.IHeatExchanger in project PneumaticCraft by MineMaarten.

the class GuiFluxCompressor method initGui.

@Override
public void initGui() {
    super.initGui();
    inputStat = addAnimatedStat("Input", (ItemStack) null, 0xFF555555, false);
    addWidget(new WidgetEnergy(guiLeft + 20, guiTop + 20, te));
    addWidget(new WidgetTemperature(0, guiLeft + 87, guiTop + 20, 273, 675, ((IHeatExchanger) te).getHeatExchangerLogic(ForgeDirection.UNKNOWN), 325, 625));
}
Also used : IHeatExchanger(pneumaticCraft.api.tileentity.IHeatExchanger) WidgetTemperature(pneumaticCraft.client.gui.widget.WidgetTemperature) ItemStack(net.minecraft.item.ItemStack)

Example 4 with IHeatExchanger

use of pneumaticCraft.api.tileentity.IHeatExchanger in project PneumaticCraft by MineMaarten.

the class GuiPneumaticGenerator method initGui.

@Override
public void initGui() {
    super.initGui();
    outputStat = addAnimatedStat("Output", IC2Items.getItem("glassFiberCableItem"), 0xFF555555, false);
    addWidget(new WidgetTemperature(0, guiLeft + 87, guiTop + 20, 273, 675, ((IHeatExchanger) te).getHeatExchangerLogic(ForgeDirection.UNKNOWN), 325, 625));
}
Also used : IHeatExchanger(pneumaticCraft.api.tileentity.IHeatExchanger) WidgetTemperature(pneumaticCraft.client.gui.widget.WidgetTemperature)

Example 5 with IHeatExchanger

use of pneumaticCraft.api.tileentity.IHeatExchanger in project PneumaticCraft by MineMaarten.

the class WailaHeatHandler method getNBTData.

@Override
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) {
    if (te instanceof IHeatExchanger) {
        Set<IHeatExchangerLogic> heatExchangers = new HashSet<IHeatExchangerLogic>();
        IHeatExchangerLogic logic = null;
        boolean isMultisided = true;
        for (ForgeDirection d : ForgeDirection.VALID_DIRECTIONS) {
            logic = ((IHeatExchanger) te).getHeatExchangerLogic(d);
            if (logic != null) {
                if (heatExchangers.contains(logic)) {
                    isMultisided = false;
                    break;
                } else {
                    heatExchangers.add(logic);
                }
            }
        }
        if (isMultisided) {
            NBTTagList tagList = new NBTTagList();
            for (ForgeDirection d : ForgeDirection.VALID_DIRECTIONS) {
                logic = ((IHeatExchanger) te).getHeatExchangerLogic(d);
                if (logic != null) {
                    NBTTagCompound heatTag = new NBTTagCompound();
                    heatTag.setByte("side", (byte) d.ordinal());
                    heatTag.setInteger("temp", (int) logic.getTemperature());
                    tagList.appendTag(heatTag);
                }
            }
            tag.setTag("heat", tagList);
        } else if (logic != null) {
            tag.setInteger("temp", (int) logic.getTemperature());
        }
    }
    return tag;
}
Also used : NBTTagList(net.minecraft.nbt.NBTTagList) IHeatExchanger(pneumaticCraft.api.tileentity.IHeatExchanger) ForgeDirection(net.minecraftforge.common.util.ForgeDirection) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) IHeatExchangerLogic(pneumaticCraft.api.IHeatExchangerLogic) HashSet(java.util.HashSet)

Aggregations

IHeatExchanger (pneumaticCraft.api.tileentity.IHeatExchanger)11 WidgetTemperature (pneumaticCraft.client.gui.widget.WidgetTemperature)6 ItemStack (net.minecraft.item.ItemStack)3 IHeatExchangerLogic (pneumaticCraft.api.IHeatExchangerLogic)3 ArrayList (java.util.ArrayList)2 ForgeDirection (net.minecraftforge.common.util.ForgeDirection)2 LuaException (dan200.computercraft.api.lua.LuaException)1 Point (java.awt.Point)1 Rectangle (java.awt.Rectangle)1 HashSet (java.util.HashSet)1 IInventory (net.minecraft.inventory.IInventory)1 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)1 NBTTagList (net.minecraft.nbt.NBTTagList)1 TileEntity (net.minecraft.tileentity.TileEntity)1 ChatComponentTranslation (net.minecraft.util.ChatComponentTranslation)1 IChatComponent (net.minecraft.util.IChatComponent)1 IPressurizable (pneumaticCraft.api.item.IPressurizable)1 IManoMeasurable (pneumaticCraft.api.tileentity.IManoMeasurable)1 IPneumaticMachine (pneumaticCraft.api.tileentity.IPneumaticMachine)1 SyncedField (pneumaticCraft.common.inventory.SyncedField)1