use of stevekung.mods.moreplanets.util.tileentity.TileEntityChestMP in project MorePlanets by SteveKunG.
the class SpaceDoubleChestItemHandlerMP method equals.
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || this.getClass() != o.getClass()) {
return false;
}
SpaceDoubleChestItemHandlerMP that = (SpaceDoubleChestItemHandlerMP) o;
if (this.hashCode != that.hashCode) {
return false;
}
TileEntityChestMP otherChest = this.getOtherChest();
if (this.mainChestIsUpper == that.mainChestIsUpper) {
return Objects.equal(this.mainChest, that.mainChest) && Objects.equal(otherChest, that.getOtherChest());
} else {
return Objects.equal(this.mainChest, that.getOtherChest()) && Objects.equal(otherChest, that.mainChest);
}
}
use of stevekung.mods.moreplanets.util.tileentity.TileEntityChestMP in project MorePlanets by SteveKunG.
the class StructureNibiruJungleTemplePieces method generateChest.
@Override
protected boolean generateChest(World world, StructureBoundingBox box, Random rand, int x, int y, int z, ResourceLocation loot) {
BlockPos blockpos = new BlockPos(this.getXWithOffset(x, z), this.getYWithOffset(y), this.getZWithOffset(x, z));
if (box.isVecInside(blockpos) && world.getBlockState(blockpos).getBlock() != NibiruBlocks.INFECTED_CHEST) {
IBlockState iblockstate = NibiruBlocks.INFECTED_CHEST.getDefaultState();
world.setBlockState(blockpos, NibiruBlocks.INFECTED_CHEST.correctFacing(world, blockpos, iblockstate), 2);
TileEntity tileentity = world.getTileEntity(blockpos);
if (tileentity instanceof TileEntityChestMP) {
((TileEntityChestMP) tileentity).setLootTable(loot, rand.nextLong());
}
return true;
} else {
return false;
}
}
use of stevekung.mods.moreplanets.util.tileentity.TileEntityChestMP in project MorePlanets by SteveKunG.
the class StructureNibiruPyramidPieces method generateChest.
@Override
protected boolean generateChest(World world, StructureBoundingBox box, Random randomIn, int x, int y, int z, ResourceLocation loot) {
BlockPos blockpos = new BlockPos(this.getXWithOffset(x, z), this.getYWithOffset(y), this.getZWithOffset(x, z));
if (box.isVecInside(blockpos) && world.getBlockState(blockpos).getBlock() != NibiruBlocks.INFECTED_CHEST) {
IBlockState iblockstate = NibiruBlocks.INFECTED_CHEST.getDefaultState();
world.setBlockState(blockpos, NibiruBlocks.INFECTED_CHEST.correctFacing(world, blockpos, iblockstate), 2);
TileEntity tileentity = world.getTileEntity(blockpos);
if (tileentity instanceof TileEntityChestMP) {
((TileEntityChestMP) tileentity).setLootTable(loot, randomIn.nextLong());
}
return true;
} else {
return false;
}
}
Aggregations