use of net.minecraft.block.ChestBlock in project BluePower by Qmunity.
the class IOHelper method getInventoryForTE.
public static IInventory getInventoryForTE(TileEntity te) {
if (te instanceof IInventory) {
IInventory inv = (IInventory) te;
BlockState block = te.getBlockState();
if (block.getBlock() instanceof ChestBlock) {
inv = (IInventory) ((ChestBlock) block.getBlock()).getMenuProvider(block, te.getLevel(), te.getBlockPos());
}
return inv;
} else {
return null;
}
}
Aggregations