use of me.desht.pneumaticcraft.api.tileentity.IHeatExchanger in project pnc-repressurized by TeamPneumatic.
the class BlockPneumaticCraft method addProbeInfo.
@Override
@Optional.Method(modid = "theoneprobe")
public void addProbeInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlayer player, World world, IBlockState blockState, IProbeHitData data) {
TileEntity te = world.getTileEntity(data.getPos());
if (te instanceof IInfoForwarder) {
te = ((IInfoForwarder) te).getInfoTileEntity();
}
if (te instanceof IPneumaticMachine) {
TOPCallback.handlePneumatic(mode, probeInfo, (IPneumaticMachine) te);
}
if (te instanceof IHeatExchanger) {
TOPCallback.handleHeat(mode, probeInfo, (IHeatExchanger) te);
}
if (ConfigHandler.client.topShowsFluids && te != null && te.hasCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, data.getSideHit())) {
IFluidHandler handler = te.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, data.getSideHit());
TOPCallback.handleFluidTanks(mode, probeInfo, handler);
}
if (te instanceof TileEntityBase) {
TOPCallback.handleRedstoneMode(mode, probeInfo, (TileEntityBase) te);
}
if (te instanceof TileEntityPressureTube) {
TOPCallback.handlePressureTube(mode, probeInfo, (TileEntityPressureTube) te, data.getSideHit());
}
}
use of me.desht.pneumaticcraft.api.tileentity.IHeatExchanger in project pnc-repressurized by TeamPneumatic.
the class GuiAdvancedAirCompressor method initGui.
@Override
public void initGui() {
super.initGui();
addWidget(new WidgetTemperature(0, guiLeft + 87, guiTop + 20, 273, 675, ((IHeatExchanger) te).getHeatExchangerLogic(null), 325, 625));
}
use of me.desht.pneumaticcraft.api.tileentity.IHeatExchanger in project pnc-repressurized by TeamPneumatic.
the class TileEntityBase method addLuaMethods.
protected void addLuaMethods() {
if (this instanceof IHeatExchanger) {
final IHeatExchanger exchanger = (IHeatExchanger) this;
luaMethods.add(new LuaMethod("getTemperature") {
@Override
public Object[] call(Object[] args) throws Exception {
if (args.length == 0) {
return new Object[] { exchanger.getHeatExchangerLogic(null).getTemperature() };
} else if (args.length == 1) {
IHeatExchangerLogic logic = exchanger.getHeatExchangerLogic(getDirForString((String) args[0]));
return new Object[] { logic != null ? logic.getTemperature() : 0 };
} else {
throw new IllegalArgumentException("getTemperature method requires 0 or 1 argument (direction: up, down, east, west, north, south!");
}
}
});
}
}
Aggregations