Search in sources :

Example 1 with TileEntityMetalBarrel

use of blusunrize.immersiveengineering.common.blocks.metal.TileEntityMetalBarrel in project ImmersiveEngineering by BluSunrize.

the class TileEntityWoodenBarrel method interact.

@Override
public boolean interact(EnumFacing side, EntityPlayer player, EnumHand hand, ItemStack heldItem, float hitX, float hitY, float hitZ) {
    FluidStack f = FluidUtil.getFluidContained(heldItem);
    boolean metal = this instanceof TileEntityMetalBarrel;
    if (f != null)
        if (!metal && f.getFluid().isGaseous(f)) {
            ChatUtils.sendServerNoSpamMessages(player, new TextComponentTranslation(Lib.CHAT_INFO + "noGasAllowed"));
            return true;
        } else if (!metal && f.getFluid().getTemperature(f) >= TileEntityWoodenBarrel.IGNITION_TEMPERATURE) {
            ChatUtils.sendServerNoSpamMessages(player, new TextComponentTranslation(Lib.CHAT_INFO + "tooHot"));
            return true;
        }
    if (FluidUtil.interactWithFluidHandler(heldItem, tank, player)) {
        this.markDirty();
        this.markContainingBlockForUpdate(null);
        return true;
    }
    //		}
    return false;
}
Also used : TextComponentTranslation(net.minecraft.util.text.TextComponentTranslation) FluidStack(net.minecraftforge.fluids.FluidStack) TileEntityMetalBarrel(blusunrize.immersiveengineering.common.blocks.metal.TileEntityMetalBarrel)

Aggregations

TileEntityMetalBarrel (blusunrize.immersiveengineering.common.blocks.metal.TileEntityMetalBarrel)1 TextComponentTranslation (net.minecraft.util.text.TextComponentTranslation)1 FluidStack (net.minecraftforge.fluids.FluidStack)1