use of stevekung.mods.moreplanets.module.planets.chalos.tileentity.TileEntityChalosTreasureChest in project MorePlanets by SteveKunG.
the class RoomTreasureChalos method addComponentParts.
@Override
public boolean addComponentParts(World world, Random rand, StructureBoundingBox boundingBox) {
for (int i = 0; i <= this.sizeX; i++) {
for (int j = 0; j <= this.sizeY; j++) {
for (int k = 0; k <= this.sizeZ; k++) {
if (i == 0 || i == this.sizeX || j == 0 || j == this.sizeY || k == 0 || k == this.sizeZ) {
boolean placeBlock = true;
if (this.getDirection().getAxis() == EnumFacing.Axis.Z) {
int start = (this.boundingBox.maxX - this.boundingBox.minX) / 2 - 1;
int end = (this.boundingBox.maxX - this.boundingBox.minX) / 2 + 1;
if (i > start && i <= end && j < 3 && j > 0) {
if (this.getDirection() == EnumFacing.SOUTH && k == 0) {
placeBlock = false;
} else if (this.getDirection() == EnumFacing.NORTH && k == this.sizeZ) {
placeBlock = false;
}
}
} else {
int start = (this.boundingBox.maxZ - this.boundingBox.minZ) / 2 - 1;
int end = (this.boundingBox.maxZ - this.boundingBox.minZ) / 2 + 1;
if (k > start && k <= end && j < 3 && j > 0) {
if (this.getDirection() == EnumFacing.EAST && i == 0) {
placeBlock = false;
} else if (this.getDirection() == EnumFacing.WEST && i == this.sizeX) {
placeBlock = false;
}
}
}
if (placeBlock) {
this.setBlockState(world, this.configuration.getBrickBlock(), i, j, k, boundingBox);
} else {
this.setBlockState(world, Blocks.AIR.getDefaultState(), i, j, k, boundingBox);
}
} else if (i == 1 && k == 1 || i == 1 && k == this.sizeZ - 1 || i == this.sizeX - 1 && k == 1 || i == this.sizeX - 1 && k == this.sizeZ - 1) {
this.setBlockState(world, this.configuration.getGlowstoneBlock(), i, j, k, boundingBox);
} else if (i == this.sizeX / 2 && j == 1 && k == this.sizeZ / 2) {
this.setBlockState(world, ChalosBlocks.CHALOS_TREASURE_CHEST.getDefaultState().withProperty(BlockStateHelper.FACING_HORIZON, this.getDirection().getOpposite()), i, j, k, boundingBox);
BlockPos blockpos = new BlockPos(this.getXWithOffset(i, k), this.getYWithOffset(j), this.getZWithOffset(i, k));
if (world.getTileEntity(blockpos) == null) {
world.setTileEntity(blockpos, new TileEntityChalosTreasureChest());
}
} else {
this.setBlockState(world, Blocks.AIR.getDefaultState(), i, j, k, boundingBox);
}
}
}
}
return true;
}
use of stevekung.mods.moreplanets.module.planets.chalos.tileentity.TileEntityChalosTreasureChest in project MorePlanets by SteveKunG.
the class TileEntityItemStackRendererMP method renderByItem.
@Override
public void renderByItem(ItemStack itemStack) {
Block block = Block.getBlockFromItem(itemStack.getItem());
if (block == DionaBlocks.DIONA_ANCIENT_CHEST) {
ClientRegisterHelper.registerTileEntityItemStackRendering(new TileEntityDionaAncientChest());
} else if (block == DionaBlocks.DIONA_TREASURE_CHEST) {
ClientRegisterHelper.registerTileEntityItemStackRendering(new TileEntityDionaTreasureChest());
} else if (block == ChalosBlocks.CHALOS_ANCIENT_CHEST) {
ClientRegisterHelper.registerTileEntityItemStackRendering(new TileEntityChalosAncientChest());
} else if (block == ChalosBlocks.CHALOS_TREASURE_CHEST) {
ClientRegisterHelper.registerTileEntityItemStackRendering(new TileEntityChalosTreasureChest());
} else if (block == DionaBlocks.ZELIUS_EGG) {
ClientRegisterHelper.registerTileEntityItemStackRendering(new TileEntityZeliusEgg());
GlStateManager.enableBlend();
} else if (block == DionaBlocks.LARGE_INFECTED_CRYSTALLIZE) {
TileEntityLargeInfectedCrystallizeRenderer.INSTANCE.render();
} else if (block == MPBlocks.DARK_ENERGY_RECEIVER) {
ClientRegisterHelper.registerTileEntityItemStackRendering(new TileEntityDarkEnergyReceiver());
} else if (itemStack.getItem() == DionaItems.INFECTED_CRYSTALLIZE_BOMB) {
RenderInfectedCrystallizeBomb.INSTANCE.render();
} else if (block == NibiruBlocks.NIBIRU_ANCIENT_CHEST) {
ClientRegisterHelper.registerTileEntityItemStackRendering(new TileEntityNibiruAncientChest());
} else if (block == NibiruBlocks.NIBIRU_TREASURE_CHEST) {
ClientRegisterHelper.registerTileEntityItemStackRendering(new TileEntityNibiruTreasureChest());
} else if (block == ChalosBlocks.CHEESE_SPORE_CHEST) {
ClientRegisterHelper.registerTileEntityItemStackRendering(new TileEntityCheeseSporeChest());
} else if (block == NibiruBlocks.INFECTED_CHEST) {
ClientRegisterHelper.registerTileEntityItemStackRendering(new TileEntityInfectedChest());
} else if (block == NibiruBlocks.MULTALIC_CRYSTAL) {
TileEntityMultalicCrystalRenderer.INSTANCE.render();
} else if (block == DionaBlocks.DARK_ENERGY_CORE) {
ClientRegisterHelper.registerTileEntityItemStackRendering(new TileEntityDarkEnergyCore());
GlStateManager.enableBlend();
} else if (block == NibiruBlocks.ALIEN_BERRY_CHEST) {
ClientRegisterHelper.registerTileEntityItemStackRendering(new TileEntityAlienBerryChest());
} else if (block == NibiruBlocks.JUICER_EGG) {
ClientRegisterHelper.registerTileEntityItemStackRendering(new TileEntityJuicerEgg());
TileEntityJuicerEggRenderer.renderItem(null, true);
} else if (block == NibiruBlocks.NUCLEAR_WASTE_TANK) {
TileEntityNuclearWasteTankRenderer.INSTANCE.render();
} else if (block == NibiruBlocks.VEIN_FRAME) {
ClientRegisterHelper.registerTileEntityItemStackRendering(new TileEntityVeinFrame());
GlStateManager.enableBlend();
} else if (block == DionaBlocks.DARK_ENERGY_GENERATOR) {
TileEntityDarkEnergyGeneratorRenderer.INSTANCE.render();
} else if (block == MPBlocks.BLACK_HOLE_STORAGE) {
ClientRegisterHelper.registerTileEntityItemStackRendering(new TileEntityBlackHoleStorage());
GlStateManager.enableBlend();
} else if (block == MPBlocks.ALIEN_DEFENDER_BEACON) {
ClientRegisterHelper.registerTileEntityItemStackRendering(new TileEntityAlienDefenderBeacon());
GlStateManager.enableBlend();
GlStateManager.enableCull();
} else if (block == MPBlocks.SHIELD_GENERATOR) {
TileEntityShieldGeneratorRenderer.INSTANCE.render();
} else {
this.old.renderByItem(itemStack);
}
}
Aggregations