Search in sources :

Example 1 with TileEntityIrrigationChannel

use of com.infinityraider.agricraft.content.irrigation.TileEntityIrrigationChannel in project AgriCraft by AgriCraft.

the class AgriWailaIrrigationBlockInfoProvider method appendBody.

@Override
public void appendBody(List<ITextComponent> tooltip, IDataAccessor accessor, IPluginConfig config) {
    TileEntity tile = accessor.getTileEntity();
    if (tile instanceof TileEntityIrrigationComponent) {
        if (tile instanceof TileEntityIrrigationChannel) {
            TileEntityIrrigationChannel channel = (TileEntityIrrigationChannel) tile;
            if (channel.hasValve()) {
                if (channel.isOpen()) {
                    tooltip.add(AgriToolTips.VALVE_INFO_OPEN);
                } else {
                    tooltip.add(AgriToolTips.VALVE_INFO_CLOSED);
                }
            }
        }
        TileEntityIrrigationComponent component = (TileEntityIrrigationComponent) tile;
        tooltip.add(new StringTextComponent(component.getContent() + " / " + component.getCapacity() + " mB"));
    }
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) TileEntityIrrigationChannel(com.infinityraider.agricraft.content.irrigation.TileEntityIrrigationChannel) StringTextComponent(net.minecraft.util.text.StringTextComponent) TileEntityIrrigationComponent(com.infinityraider.agricraft.content.irrigation.TileEntityIrrigationComponent)

Example 2 with TileEntityIrrigationChannel

use of com.infinityraider.agricraft.content.irrigation.TileEntityIrrigationChannel in project AgriCraft by AgriCraft.

the class AgriProbeIrrigationBlockInfoProvider method addIrrigationProbeInfo.

protected void addIrrigationProbeInfo(IProbeInfo info, World world, BlockPos pos) {
    TileEntity tile = world.getTileEntity(pos);
    if (tile instanceof TileEntityIrrigationComponent) {
        if (tile instanceof TileEntityIrrigationChannel) {
            TileEntityIrrigationChannel channel = (TileEntityIrrigationChannel) tile;
            if (channel.hasValve()) {
                if (channel.isOpen()) {
                    info.text(AgriToolTips.VALVE_INFO_OPEN);
                } else {
                    info.text(AgriToolTips.VALVE_INFO_CLOSED);
                }
            }
        }
        TileEntityIrrigationComponent component = (TileEntityIrrigationComponent) tile;
        info.progress(component.getContent(), component.getCapacity(), new ProgressStyle().filledColor(0xff327DCD).alternateFilledColor(0xff3732CD).suffix(" mB"));
    }
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) ProgressStyle(mcjty.theoneprobe.apiimpl.styles.ProgressStyle) TileEntityIrrigationChannel(com.infinityraider.agricraft.content.irrigation.TileEntityIrrigationChannel) TileEntityIrrigationComponent(com.infinityraider.agricraft.content.irrigation.TileEntityIrrigationComponent)

Aggregations

TileEntityIrrigationChannel (com.infinityraider.agricraft.content.irrigation.TileEntityIrrigationChannel)2 TileEntityIrrigationComponent (com.infinityraider.agricraft.content.irrigation.TileEntityIrrigationComponent)2 TileEntity (net.minecraft.tileentity.TileEntity)2 ProgressStyle (mcjty.theoneprobe.apiimpl.styles.ProgressStyle)1 StringTextComponent (net.minecraft.util.text.StringTextComponent)1