Search in sources :

Example 1 with PartPressureTube

use of pneumaticCraft.common.thirdparty.fmp.PartPressureTube in project PneumaticCraft by MineMaarten.

the class ModInteractionUtilImplementation method removeTube.

@Override
@Optional.Method(modid = ModIds.FMP)
public void removeTube(TileEntity te) {
    if (te instanceof TileMultipart) {
        PartPressureTube tube = FMP.getMultiPart((TileMultipart) te, PartPressureTube.class);
        if (tube != null) {
            List<ItemStack> drops = BlockPressureTube.getModuleDrops(tube.getTube());
            for (ItemStack drop : drops) {
                EntityItem entity = new EntityItem(te.getWorldObj(), te.xCoord + 0.5, te.yCoord + 0.5, te.zCoord + 0.5);
                entity.setEntityItemStack(drop);
                te.getWorldObj().spawnEntityInWorld(entity);
            }
            ((TileMultipart) te).remPart(tube);
        }
    } else {
        super.removeTube(te);
    }
}
Also used : TileMultipart(codechicken.multipart.TileMultipart) PartPressureTube(pneumaticCraft.common.thirdparty.fmp.PartPressureTube) ItemStack(net.minecraft.item.ItemStack) EntityItem(net.minecraft.entity.item.EntityItem)

Aggregations

TileMultipart (codechicken.multipart.TileMultipart)1 EntityItem (net.minecraft.entity.item.EntityItem)1 ItemStack (net.minecraft.item.ItemStack)1 PartPressureTube (pneumaticCraft.common.thirdparty.fmp.PartPressureTube)1