use of net.minecraftforge.fluids.IFluidBlock in project BloodMagic by WayofTime.
the class TESpectralContainer method createSpectralBlockAtLocation.
public static boolean createSpectralBlockAtLocation(World world, int x, int y, int z, int duration) {
Block block = world.getBlock(x, y, z);
if (block == null) {
return false;
}
if (world.getTileEntity(x, y, z) == null || block instanceof IFluidBlock) {
int meta = world.getBlockMetadata(x, y, z);
ItemStack item = new ItemStack(block, 1, meta);
world.setBlock(x, y, z, ModBlocks.blockSpectralContainer);
TileEntity tile = world.getTileEntity(x, y, z);
if (tile instanceof TESpectralContainer) {
((TESpectralContainer) tile).setContainedItem(item);
((TESpectralContainer) tile).setDuration(duration);
return true;
}
}
return false;
}
Aggregations