Search in sources :

Example 1 with IInfoForwarder

use of me.desht.pneumaticcraft.common.thirdparty.waila.IInfoForwarder 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());
    }
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) IHeatExchanger(me.desht.pneumaticcraft.api.tileentity.IHeatExchanger) IPneumaticMachine(me.desht.pneumaticcraft.api.tileentity.IPneumaticMachine) IInfoForwarder(me.desht.pneumaticcraft.common.thirdparty.waila.IInfoForwarder) IFluidHandler(net.minecraftforge.fluids.capability.IFluidHandler)

Aggregations

IHeatExchanger (me.desht.pneumaticcraft.api.tileentity.IHeatExchanger)1 IPneumaticMachine (me.desht.pneumaticcraft.api.tileentity.IPneumaticMachine)1 IInfoForwarder (me.desht.pneumaticcraft.common.thirdparty.waila.IInfoForwarder)1 TileEntity (net.minecraft.tileentity.TileEntity)1 IFluidHandler (net.minecraftforge.fluids.capability.IFluidHandler)1