use of net.minecraft.inventory.InventoryLargeChest in project MorePlanets by SteveKunG.
the class BlockAlienBerryChest method getLockableContainer.
@Override
public ILockableContainer getLockableContainer(World world, BlockPos pos) {
TileEntity tileentity = world.getTileEntity(pos);
if (!(tileentity instanceof TileEntityAlienBerryChest)) {
return null;
} else {
Object object = tileentity;
if (this.isBlocked(world, pos)) {
return null;
} else {
Iterator iterator = EnumFacing.Plane.HORIZONTAL.iterator();
while (iterator.hasNext()) {
EnumFacing enumfacing = (EnumFacing) iterator.next();
BlockPos blockpos1 = pos.offset(enumfacing);
Block block = world.getBlockState(blockpos1).getBlock();
if (block == this) {
if (this.isBlocked(world, blockpos1)) {
return null;
}
TileEntity tileentity1 = world.getTileEntity(blockpos1);
if (tileentity1 instanceof TileEntityAlienBerryChest) {
if (enumfacing != EnumFacing.WEST && enumfacing != EnumFacing.NORTH) {
object = new InventoryLargeChest(GCCoreUtil.translate("container.chestDouble"), (ILockableContainer) object, (TileEntityAlienBerryChest) tileentity1);
} else {
object = new InventoryLargeChest(GCCoreUtil.translate("container.chestDouble"), (TileEntityAlienBerryChest) tileentity1, (ILockableContainer) object);
}
}
}
}
return (ILockableContainer) object;
}
}
}
use of net.minecraft.inventory.InventoryLargeChest in project MorePlanets by SteveKunG.
the class BlockDionaAncientChest method getLockableContainer.
public ILockableContainer getLockableContainer(World world, BlockPos pos) {
TileEntity tileentity = world.getTileEntity(pos);
if (!(tileentity instanceof TileEntityDionaAncientChest)) {
return null;
} else {
Object object = tileentity;
if (this.isBlocked(world, pos)) {
return null;
} else {
Iterator iterator = EnumFacing.Plane.HORIZONTAL.iterator();
while (iterator.hasNext()) {
EnumFacing enumfacing = (EnumFacing) iterator.next();
BlockPos blockpos1 = pos.offset(enumfacing);
Block block = world.getBlockState(blockpos1).getBlock();
if (block == this) {
if (this.isBlocked(world, blockpos1)) {
return null;
}
TileEntity tileentity1 = world.getTileEntity(blockpos1);
if (tileentity1 instanceof TileEntityDionaAncientChest) {
if (enumfacing != EnumFacing.WEST && enumfacing != EnumFacing.NORTH) {
object = new InventoryLargeChest(GCCoreUtil.translate("container.diona.ancientchest.name"), (ILockableContainer) object, (TileEntityDionaAncientChest) tileentity1);
} else {
object = new InventoryLargeChest(GCCoreUtil.translate("container.diona.ancientchest.name"), (TileEntityDionaAncientChest) tileentity1, (ILockableContainer) object);
}
}
}
}
return (ILockableContainer) object;
}
}
}
Aggregations