use of stevekung.mods.moreplanets.util.tileentity.TileEntityAncientChestMP in project MorePlanets by SteveKunG.
the class DoubleAncientChestItemHandlerMP method insertItem.
@Override
public ItemStack insertItem(int slot, ItemStack stack, boolean simulate) {
boolean accessingUpperChest = slot < 27;
int targetSlot = accessingUpperChest ? slot : slot - 27;
TileEntityAncientChestMP chest = this.getChest(accessingUpperChest);
return chest != null ? chest.getSingleChestHandler().insertItem(targetSlot, stack, simulate) : stack;
}
use of stevekung.mods.moreplanets.util.tileentity.TileEntityAncientChestMP in project MorePlanets by SteveKunG.
the class DoubleAncientChestItemHandlerMP method extractItem.
@Override
public ItemStack extractItem(int slot, int amount, boolean simulate) {
boolean accessingUpperChest = slot < 27;
int targetSlot = accessingUpperChest ? slot : slot - 27;
TileEntityAncientChestMP chest = this.getChest(accessingUpperChest);
return chest != null ? chest.getSingleChestHandler().extractItem(targetSlot, amount, simulate) : ItemStack.EMPTY;
}
use of stevekung.mods.moreplanets.util.tileentity.TileEntityAncientChestMP in project MorePlanets by SteveKunG.
the class RoomChestNibiru method addComponentParts.
@Override
public boolean addComponentParts(World world, Random rand, StructureBoundingBox boundingBox) {
if (super.addComponentParts(world, rand, boundingBox)) {
int chestX = this.sizeX / 2;
int chestY = 1;
int chestZ = this.sizeZ / 2;
this.setBlockState(world, this.configuration.getAncientChestBlock().withProperty(BlockStateHelper.FACING_HORIZON, this.getDirection().getOpposite()), chestX, chestY, chestZ, boundingBox);
BlockPos blockpos = new BlockPos(this.getXWithOffset(chestX, chestZ), this.getYWithOffset(chestY), this.getZWithOffset(chestX, chestZ));
TileEntityAncientChestMP chest = (TileEntityAncientChestMP) world.getTileEntity(blockpos);
if (chest != null) {
chest.setLootTable(MPLootTables.COMMON_SPACE_DUNGEON, rand.nextLong());
}
return true;
}
return false;
}
Aggregations