From 7d156d9ff974fb604cb2a1502c78d47366cdcfea Mon Sep 17 00:00:00 2001 From: Vaern Date: Tue, 23 Aug 2022 20:11:34 -0700 Subject: [PATCH 01/12] argh this shit needs to be sorted out --- .../world/worldgen/ComponentNTMFeatures.java | 149 ++++++-- .../hbm/world/worldgen/MapGenNTMFeatures.java | 18 +- .../world/worldgen/components/Feature.java | 326 ++++++++++++++++++ .../components/MilitaryBaseFeatures.java | 186 ++++++++++ 4 files changed, 645 insertions(+), 34 deletions(-) create mode 100644 src/main/java/com/hbm/world/worldgen/components/Feature.java create mode 100644 src/main/java/com/hbm/world/worldgen/components/MilitaryBaseFeatures.java diff --git a/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java b/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java index b98219729..49b292dbd 100644 --- a/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java +++ b/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java @@ -8,7 +8,10 @@ import com.hbm.blocks.generic.BlockBobble.TileEntityBobble; import com.hbm.lib.HbmChestContents; import com.hbm.tileentity.machine.storage.TileEntityCrateIron; import com.hbm.util.LootGenerator; +import com.hbm.world.worldgen.components.MilitaryBaseFeatures; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; import net.minecraft.init.Blocks; import net.minecraft.item.ItemDoor; import net.minecraft.nbt.NBTTagCompound; @@ -18,7 +21,10 @@ import net.minecraft.world.World; import net.minecraft.world.gen.structure.MapGenStructureIO; import net.minecraft.world.gen.structure.StructureBoundingBox; import net.minecraft.world.gen.structure.StructureComponent; +import scala.reflect.internal.Trees.This; +//TODO: +//KILL! //Probably one of the more difficult parts. /** Base component file. For structure generation under 32x32 blocks, as Minecraft generates 2x2 chunks for structures. * Larger non-procedural structures should be split up into several bounding boxes, which check if they intersect the chunk bounding box currently being loaded. Doing so will prevent @@ -38,6 +44,9 @@ public class ComponentNTMFeatures { MapGenStructureIO.func_143031_a(ComponentNTMFeatures.NTMRuin2.class, "NTMRuin2"); MapGenStructureIO.func_143031_a(ComponentNTMFeatures.NTMRuin3.class, "NTMRuin3"); MapGenStructureIO.func_143031_a(ComponentNTMFeatures.NTMRuin4.class, "NTMRuin4"); + //aggggggggggg + MapGenStructureIO.func_143031_a(MilitaryBaseFeatures.BasicHelipad.class, "NTMBasicHelipad"); + MapGenStructureIO.func_143031_a(MilitaryBaseFeatures.RadioShack.class, "NTMRadioShack"); } /** Sandstone Ruin 1 */ @@ -93,7 +102,7 @@ public class ComponentNTMFeatures { */ //System.out.println(this.coordBaseMode); - if(!this.func_74935_a(world, box, this.boundingBox.minY)) { + if(!this.setAverageHeight(world, box, this.boundingBox.minY)) { return false; } //System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); @@ -177,7 +186,7 @@ public class ComponentNTMFeatures { public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { //System.out.print(this.coordBaseMode); - if(!this.func_74935_a(world, box, this.boundingBox.minY)) { + if(!this.setAverageHeight(world, box, this.boundingBox.minY)) { return false; } //System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); @@ -257,7 +266,7 @@ public class ComponentNTMFeatures { //Loot & Decorations //House 1 - int eastMeta = this.getMetadataForRotatableDeco(4); + int eastMeta = this.getDecoMeta(4); this.placeBlockAtCurrentPosition(world, ModBlocks.machine_boiler_off, 4, 1, 1, 1, box); this.fillWithBlocks(world, box, 1, 2, 1, 1, 3, 1, ModBlocks.deco_pipe_quad_rusted, Blocks.air, false); this.placeBlockAtCurrentPosition(world, ModBlocks.deco_pipe_rim_rusted, 0, 1, featureSizeY, 1, box); @@ -332,7 +341,7 @@ public class ComponentNTMFeatures { public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { //System.out.println(this.coordBaseMode); - if(!this.func_74935_a(world, box, this.boundingBox.minY)) { + if(!this.setAverageHeight(world, box, this.boundingBox.minY)) { return false; } //System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); @@ -360,7 +369,7 @@ public class ComponentNTMFeatures { this.fillWithAir(world, box, 4, 0, 4, featureSizeX - 1, featureSizeY, featureSizeZ - 1); this.fillWithAir(world, box, 3, 1, featureSizeZ - 1, 3, 2, featureSizeZ - 1); - int pillarMeta = this.getMetadataForRotatablePillar(8); + int pillarMeta = this.getPillarMeta(8); //Pillars this.fillWithBlocks(world, box, 0, 0, 0, 0, 3, 0, ModBlocks.concrete_pillar, Blocks.air, false); @@ -398,7 +407,7 @@ public class ComponentNTMFeatures { //Decorations & Loot this.fillWithMetadataBlocks(world, box, 1, 1, 1, 1, 1, 4, Blocks.dirt, 2, Blocks.air, 0, false); - int westDecoMeta = this.getMetadataForRotatableDeco(5); + int westDecoMeta = this.getDecoMeta(5); this.fillWithMetadataBlocks(world, box, 2, 1, 1, 2, 1, 4, ModBlocks.steel_wall, westDecoMeta, Blocks.air, 0, false); this.fillWithMetadataBlocks(world, box, 2, featureSizeY - 1, 1, 2, featureSizeY - 1, 4, ModBlocks.steel_wall, westDecoMeta, Blocks.air, 0, false); for(byte i = 0; i < 4; i++) { @@ -409,7 +418,7 @@ public class ComponentNTMFeatures { this.placeBlockAtCurrentPosition(world, ModBlocks.door_office, doorMeta, 3, 1, featureSizeZ - 1, box); ItemDoor.placeDoorBlock(world, this.getXWithOffset(3, featureSizeZ - 1), this.getYWithOffset(1), this.getZWithOffset(3, featureSizeZ - 1), doorMeta, ModBlocks.door_office); - int northDecoMeta = this.getMetadataForRotatableDeco(3); + int northDecoMeta = this.getDecoMeta(3); this.fillWithMetadataBlocks(world, box, 5, featureSizeY - 1, 1, featureSizeX - 1, featureSizeY - 1, 1, ModBlocks.steel_scaffold, westDecoMeta, Blocks.air, 0, false); this.fillWithMetadataBlocks(world, box, 5, featureSizeY - 1, 2, featureSizeX - 1, featureSizeY - 1, 2, ModBlocks.steel_wall, northDecoMeta, Blocks.air, 0, false); this.placeBlockAtCurrentPosition(world, ModBlocks.machine_electric_furnace_off, northDecoMeta, 5, 1, 1, box); @@ -469,7 +478,7 @@ public class ComponentNTMFeatures { public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { //System.out.println(this.coordBaseMode); - if(!this.func_74935_a(world, box, this.boundingBox.minY)) { + if(!this.setAverageHeight(world, box, this.boundingBox.minY)) { return false; } this.boundingBox.offset(0, -7, 0); @@ -566,10 +575,10 @@ public class ComponentNTMFeatures { this.fillWithRandomizedBlocks(world, box, 1, 4, 1, featureSizeX - 1, 4, featureSizeZ - 1, false, rand, RandomConcreteBricks); //Ceiling //Decorations & Loot - int eastMeta = this.getMetadataForRotatableDeco(4); - int westMeta = this.getMetadataForRotatableDeco(5); - int northMeta = this.getMetadataForRotatableDeco(3); - int southMeta = this.getMetadataForRotatableDeco(2); + int eastMeta = this.getDecoMeta(4); + int westMeta = this.getDecoMeta(5); + int northMeta = this.getDecoMeta(3); + int southMeta = this.getDecoMeta(2); this.placeBlockAtCurrentPosition(world, ModBlocks.crashed_balefire, southMeta, 6, featureSizeY - 2, 3, box); int doorMeta = this.getMetadataWithOffset(Blocks.wooden_door, 1); @@ -648,7 +657,7 @@ public class ComponentNTMFeatures { public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { ////System.out.println(this.coordBaseMode); - if(!this.func_74935_a(world, box, this.boundingBox.minY)) { + if(!this.setAverageHeight(world, box, this.boundingBox.minY)) { return false; } //System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); @@ -681,8 +690,8 @@ public class ComponentNTMFeatures { } //Walls - int pillarMetaWE = this.getMetadataForRotatablePillar(4); - int pillarMetaNS = this.getMetadataForRotatablePillar(8); + int pillarMetaWE = this.getPillarMeta(4); + int pillarMetaNS = this.getPillarMeta(8); this.fillWithBlocks(world, box, 1, 0, 0, 1, 3, 0, ModBlocks.concrete_pillar, Blocks.air, false); //Back Wall this.placeBlockAtCurrentPosition(world, ModBlocks.concrete, 0, 1, 4, 0, box); this.fillWithMetadataBlocks(world, box, 2, 4, 0, featureSizeX - 4, 4, 0, ModBlocks.concrete_pillar, pillarMetaWE, Blocks.air, 0, false); @@ -713,8 +722,8 @@ public class ComponentNTMFeatures { this.fillWithMetadataBlocks(world, box, featureSizeX - 3, 4, 1, featureSizeX - 3, 4, featureSizeZ - 1, ModBlocks.concrete_pillar, pillarMetaNS, Blocks.air, 0, false); //Right Wall this.fillWithRandomizedBlocks(world, box, featureSizeX - 3, 0, 1, featureSizeX - 3, 3, featureSizeZ - 1, false, rand, RandomSuperConcrete); - pillarMetaWE = this.getMetadataForRotatablePillar(5); - pillarMetaNS = this.getMetadataForRotatablePillar(9); + pillarMetaWE = this.getPillarMeta(5); + pillarMetaNS = this.getPillarMeta(9); this.fillWithMetadataBlocks(world, box, featureSizeX - 2, 2, 1, featureSizeX - 1, 2, 1, Blocks.log, pillarMetaWE, Blocks.air, 0, false); //Back Wall this.fillWithMetadataBlocks(world, box, featureSizeX, 0, 1, featureSizeX, 2, 1, Blocks.log, 1, Blocks.air, 0, false); this.fillWithMetadataBlocks(world, box, featureSizeX - 2, 0, 1, featureSizeX - 1, 1, 1, Blocks.planks, 1, Blocks.air, 0, false); @@ -735,8 +744,8 @@ public class ComponentNTMFeatures { this.fillWithBlocks(world, box, featureSizeX - 2, 2, 2, featureSizeX - 1, 2, 5, ModBlocks.deco_steel, Blocks.air, false); //Loot & Decorations - int southMeta = this.getMetadataForRotatableDeco(2); - int eastMeta = this.getMetadataForRotatableDeco(5); + int southMeta = this.getDecoMeta(2); + int eastMeta = this.getDecoMeta(5); this.placeBlockAtCurrentPosition(world, ModBlocks.pole_satellite_receiver, eastMeta, 2, featureSizeY - 1, 1, box); this.fillWithBlocks(world, box, 3, featureSizeY - 1, 1, 4, featureSizeY - 1, 1, ModBlocks.deco_steel, Blocks.air, false); this.fillWithBlocks(world, box, 2, featureSizeY - 1, 2, 4, featureSizeY - 1, 2, ModBlocks.deco_steel, Blocks.air, false); @@ -793,7 +802,7 @@ public class ComponentNTMFeatures { public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { //System.out.println(this.coordBaseMode); - if(!this.func_74935_a(world, box, this.boundingBox.minY)) { + if(!this.setAverageHeight(world, box, this.boundingBox.minY)) { return false; } //System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); @@ -804,8 +813,8 @@ public class ComponentNTMFeatures { } } - int pillarMetaWE = this.getMetadataForRotatablePillar(4); - int pillarMetaNS = this.getMetadataForRotatablePillar(8); + int pillarMetaWE = this.getPillarMeta(4); + int pillarMetaNS = this.getPillarMeta(8); this.fillWithBlocks(world, box, 0, 0, 0, 0, featureSizeY, 0, ModBlocks.concrete_pillar, Blocks.air, false); //Back Wall this.fillWithMetadataBlocks(world, box, 1, 3, 0, 3, 3, 0, ModBlocks.concrete_pillar, pillarMetaWE, Blocks.air, 0, false); @@ -869,7 +878,7 @@ public class ComponentNTMFeatures { public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { //System.out.println(this.coordBaseMode); - if(!this.func_74935_a(world, box, this.boundingBox.minY)) { + if(!this.setAverageHeight(world, box, this.boundingBox.minY)) { return false; } //System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); @@ -880,8 +889,8 @@ public class ComponentNTMFeatures { } } - int pillarMetaWE = this.getMetadataForRotatablePillar(4); - int pillarMetaNS = this.getMetadataForRotatablePillar(8); + int pillarMetaWE = this.getPillarMeta(4); + int pillarMetaNS = this.getPillarMeta(8); this.fillWithBlocks(world, box, 0, 0, 0, 0, 3, 0, ModBlocks.concrete_pillar, Blocks.air, false); //Back Wall this.fillWithMetadataBlocks(world, box, 1, 3, 0, featureSizeX - 1, 3, 0, ModBlocks.concrete_pillar, pillarMetaWE, Blocks.air, 0, false); @@ -936,7 +945,7 @@ public class ComponentNTMFeatures { public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { //System.out.println(this.coordBaseMode); - if(!this.func_74935_a(world, box, this.boundingBox.minY)) { + if(!this.setAverageHeight(world, box, this.boundingBox.minY)) { return false; } //System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); @@ -997,7 +1006,7 @@ public class ComponentNTMFeatures { public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { //System.out.println(this.coordBaseMode); - if(!this.func_74935_a(world, box, this.boundingBox.minY)) { + if(!this.setAverageHeight(world, box, this.boundingBox.minY)) { return false; } //System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); @@ -1043,6 +1052,8 @@ public class ComponentNTMFeatures { } } + /*Worrying: StructureStart checks for not addComponentParts to remove structure components from iterator, but here successful builds return true. + may be issue with multiple components.*/ abstract static class Feature extends StructureComponent { /** The size of the bounding box for this feature in the X axis */ protected int featureSizeX; @@ -1101,7 +1112,7 @@ public class ComponentNTMFeatures { this.hpos = nbt.getInteger("HPos"); } - protected boolean func_74935_a(World world, StructureBoundingBox box, int y) { + protected boolean setAverageHeight(World world, StructureBoundingBox box, int y) { int j = 0; int k = 0; @@ -1128,7 +1139,7 @@ public class ComponentNTMFeatures { * @param metadata (First two digits are equal to block metadata, other two are equal to orientation * @return metadata adjusted for random orientation */ - protected int getMetadataForRotatablePillar(int metadata) { + protected int getPillarMeta(int metadata) { int blockMeta = metadata & 3; int rotationMeta = metadata >> 2; @@ -1163,7 +1174,7 @@ public class ComponentNTMFeatures { * @param metadata (2 for facing South, 3 for facing North, 4 for facing East, 5 for facing West * @return metadata adjusted for random orientation */ - protected int getMetadataForRotatableDeco(int metadata) { + protected int getDecoMeta(int metadata) { switch(this.coordBaseMode) { case 0: //South switch(metadata) { @@ -1213,6 +1224,40 @@ public class ComponentNTMFeatures { return 0; } + //TODO: Make a lot of these orientation/rotation methods much more transparent about what + //direction they will actually face + + /** + * Places door at specified location with orientation-adjusted meta + * don't ask me which directions are what + */ + protected void placeDoor(World world, StructureBoundingBox box, Block door, int direction, int featureX, int featureY, int featureZ) { + int meta = getMetadataWithOffset(Blocks.wooden_door, direction); + int posX = this.getXWithOffset(featureX, featureZ); + int posY = this.getYWithOffset(featureY); + int posZ = this.getZWithOffset(featureX, featureZ); + + this.placeBlockAtCurrentPosition(world, door, meta, featureX, featureY, featureZ, box); + ItemDoor.placeDoorBlock(world, posX, posY, posZ, meta, door); + } + + /** + * Places random bobblehead with a randomized orientation at specified location + */ + protected void placeRandomBobble(World world, StructureBoundingBox box, Random rand, int featureX, int featureY, int featureZ) { + int posX = this.getXWithOffset(featureX, featureZ); + int posY = this.getYWithOffset(featureY); + int posZ = this.getZWithOffset(featureX, featureZ); + + placeBlockAtCurrentPosition(world, ModBlocks.bobblehead, rand.nextInt(16), featureX, featureY, featureZ, box); + TileEntityBobble bobble = (TileEntityBobble) world.getTileEntity(posX, posY, posZ); + + if(bobble != null) { + bobble.type = BobbleType.values()[rand.nextInt(BobbleType.values().length - 1) + 1]; + bobble.markDirty(); + } + } + /** * it feels disgusting to make a method with this many parameters but fuck it, it's easier * @return iron crate with generated content @@ -1232,6 +1277,47 @@ public class ComponentNTMFeatures { return false; } + + @Override + protected void func_151554_b(World world, Block placeBlock, int meta, int featureX, int featureY, int featureZ, StructureBoundingBox box) { + int posX = this.getXWithOffset(featureX, featureZ); + int posY = this.getYWithOffset(featureY); + int posZ = this.getZWithOffset(featureX, featureZ); + + if(box.isVecInside(posX, posY, posZ)) { + Block block = world.getBlock(posX, posY, posZ); + + while ((world.isAirBlock(posX, posY, posZ) || !block.getMaterial().isSolid() || (block.isFoliage(world, posX, posY, posZ) || block.getMaterial() == Material.leaves)) && posY > 1) { + world.setBlock(posX, posY, posZ, placeBlock, meta, 2); + block = world.getBlock(posX, --posY, posZ); + } + } + } + + /** + * Places specified blocks on top of pre-existing blocks in a given area, up to a certain height. Does NOT place blocks on top of liquids. + * Useful for stuff like fences and walls most likely. + */ + protected void placeBlocksOnTop(World world, StructureBoundingBox box, Block block, int minX, int minZ, int maxX, int maxZ, int height) { + + for(int x = minX; x <= maxX; x++) { + for(int z = minZ; z <= maxZ; z++) { + int posX = this.getXWithOffset(x, z); + int posZ = this.getZWithOffset(x, z); + int topHeight = world.getTopSolidOrLiquidBlock(posX, posZ); + + if(!world.getBlock(posX, topHeight, posZ).getMaterial().isLiquid()) { + + for(int i = 0; i < height; i++) { + int posY = topHeight + i; + + world.setBlock(posX, posY, posZ, block, 0, 2); + } + } + } + } + } + } //Block Selectors @@ -1276,6 +1362,7 @@ public class ComponentNTMFeatures { } } + //ag static class LabTiles extends StructureComponent.BlockSelector { LabTiles() { } @@ -1305,8 +1392,6 @@ public class ComponentNTMFeatures { @Override public void selectBlocks(Random rand, int posX, int posY, int posZ, boolean p_75062_5_) { this.selectedBlockMetaData = rand.nextInt(6) + 10; - - } } } diff --git a/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java b/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java index 9f26946be..666f892a3 100644 --- a/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java +++ b/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java @@ -2,19 +2,25 @@ package com.hbm.world.worldgen; import java.util.Arrays; import java.util.Iterator; +import java.util.LinkedList; import java.util.List; import java.util.Random; import com.hbm.config.GeneralConfig; +import com.hbm.world.worldgen.components.MilitaryBaseFeatures; import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.BiomeGenBeach; import net.minecraft.world.biome.BiomeGenMesa; import net.minecraft.world.gen.structure.MapGenStructure; +import net.minecraft.world.gen.structure.MapGenStructureIO; +import net.minecraft.world.gen.structure.StructureComponent; import net.minecraft.world.gen.structure.StructureStart; public class MapGenNTMFeatures extends MapGenStructure { + //BiomeDictionary could be /very/ useful, since it automatically sorts *all* biomes into predefined categories private static List biomelist = Arrays.asList(new BiomeGenBase[] {BiomeGenBase.ocean, BiomeGenBase.river, BiomeGenBase.frozenOcean, BiomeGenBase.frozenRiver, BiomeGenBase.deepOcean}); /** Maximum distance between structures */ private int maxDistanceBetweenScatteredFeatures; @@ -130,6 +136,8 @@ public class MapGenNTMFeatures extends MapGenStructure { ComponentNTMFeatures.NTMWorkshop1 workshop1 = new ComponentNTMFeatures.NTMWorkshop1(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); this.components.add(workshop1); } + } else if(biome.heightVariation <= 0.2 && biome.rainfall <= 0.5 && !(biome instanceof BiomeGenBeach) && rand.nextBoolean()) { + MilitaryBaseFeatures.smallHelipad(components, chunkX, posY, chunkZ, rand); //agggggggg } else { //Everything else if(rand.nextBoolean()) { ComponentNTMFeatures.NTMLab2 lab2 = new ComponentNTMFeatures.NTMLab2(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); @@ -140,8 +148,14 @@ public class MapGenNTMFeatures extends MapGenStructure { } } - if(GeneralConfig.enableDebugMode) - System.out.print("[Debug] StructureStart at " + (chunkX * 16 + 8) + ", " + posY + ", " + (chunkZ * 16 + 8) + "\n"); + if(GeneralConfig.enableDebugMode) { + System.out.print("[Debug] StructureStart at " + (chunkX * 16 + 8) + ", " + posY + ", " + (chunkZ * 16 + 8) + "\n[Debug] Components: "); + this.components.forEach((component) -> { + System.out.print(MapGenStructureIO.func_143036_a((StructureComponent) component) + " "); + }); + + System.out.print("\n"); + } this.updateBoundingBox(); } diff --git a/src/main/java/com/hbm/world/worldgen/components/Feature.java b/src/main/java/com/hbm/world/worldgen/components/Feature.java new file mode 100644 index 000000000..0ffce977c --- /dev/null +++ b/src/main/java/com/hbm/world/worldgen/components/Feature.java @@ -0,0 +1,326 @@ +package com.hbm.world.worldgen.components; + +import java.util.Random; + +import com.hbm.blocks.ModBlocks; +import com.hbm.blocks.generic.BlockBobble.BobbleType; +import com.hbm.blocks.generic.BlockBobble.TileEntityBobble; +import com.hbm.tileentity.machine.storage.TileEntityCrateIron; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemDoor; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.World; +import net.minecraft.world.gen.structure.StructureBoundingBox; +import net.minecraft.world.gen.structure.StructureComponent; + +abstract public class Feature extends StructureComponent { + /** The size of the bounding box for this feature in the X axis */ + protected int sizeX; + /** The size of the bounding box for this feature in the Y axis */ + protected int sizeY; + /** The size of the bounding box for this feature in the Z axis */ + protected int sizeZ; + /** Average height (Presumably stands for height position) */ + protected int hpos = -1; + + protected Feature() { + super(0); + } + + protected Feature(Random rand, int minX, int minY, int minZ, int maxX, int maxY, int maxZ ) { + super(0); + this.sizeX = maxX; + this.sizeY = maxY; + this.sizeZ = maxZ; + this.coordBaseMode = rand.nextInt(4); + + switch(this.coordBaseMode) { + case 0: + this.boundingBox = new StructureBoundingBox(minX, minY, minZ, minX + maxX, minY + maxY, minZ + maxZ); + break; + case 1: + this.boundingBox = new StructureBoundingBox(minX, minY, minZ, minX + maxZ, minY + maxY, minZ + maxX); + break; + case 2: + //North (2) and East (3) will result in mirrored structures. Not an issue, but keep in mind. + this.boundingBox = new StructureBoundingBox(minX, minY, minZ, minX + maxX, minY + maxY, minZ + maxZ); + break; + case 3: + this.boundingBox = new StructureBoundingBox(minX, minY, minZ, minX + maxX, minY + maxY, minZ + maxZ); + break; + default: + this.boundingBox = new StructureBoundingBox(minX, minY, minZ, minX + maxX, minY + maxY, minZ + maxZ); + + } + } + + /** Set to NBT */ + protected void func_143012_a(NBTTagCompound nbt) { + nbt.setInteger("Width", this.sizeX); + nbt.setInteger("Height", this.sizeY); + nbt.setInteger("Depth", this.sizeZ); + nbt.setInteger("HPos", this.hpos); + } + + /** Get from NBT */ + protected void func_143011_b(NBTTagCompound nbt) { + this.sizeX = nbt.getInteger("Width"); + this.sizeY = nbt.getInteger("Height"); + this.sizeZ = nbt.getInteger("Depth"); + this.hpos = nbt.getInteger("HPos"); + } + + protected boolean setAverageHeight(World world, StructureBoundingBox box, int y) { + + int total = 0; + int iterations = 0; + + for(int z = this.boundingBox.minZ; z <= this.boundingBox.maxZ; z++) { + for(int x = this.boundingBox.minX; x <= this.boundingBox.maxX; x++) { + if(box.isVecInside(x, y, z)) { + total += Math.max(world.getTopSolidOrLiquidBlock(x, z), world.provider.getAverageGroundLevel()); + iterations++; + } + } + } + + if(iterations == 0) + return false; + + this.hpos = total / iterations; //finds mean of every block in bounding box + this.boundingBox.offset(0, this.hpos - this.boundingBox.minY, 0); + return true; + } + + /** Metadata for Decoration Methods **/ + + /** + * Gets metadata for rotatable pillars. + * @param metadata (First two digits are equal to block metadata, other two are equal to orientation + * @return metadata adjusted for random orientation + */ + protected int getPillarMeta(int metadata) { + if(this.coordBaseMode % 2 != 0 && this.coordBaseMode != -1) + metadata = metadata ^ 12; + + return metadata; + } + + /** + * Gets metadata for rotatable DecoBlock + * honestly i don't remember how i did this and i'm scared to optimize it because i fail to see any reasonable patterns like the pillar + * seriously, 3 fucking bits for 4 orientations when you can do it easily with 2? + * @param metadata (2 for facing South, 3 for facing North, 4 for facing East, 5 for facing West + */ + protected int getDecoMeta(int metadata) { + switch(this.coordBaseMode) { + case 0: //South + switch(metadata) { + case 2: return 2; + case 3: return 3; + case 4: return 4; + case 5: return 5; + } + case 1: //West + switch(metadata) { + case 2: return 5; + case 3: return 4; + case 4: return 2; + case 5: return 3; + } + case 2: //North + switch(metadata) { + case 2: return 3; + case 3: return 2; + case 4: return 4; + case 5: return 5; + } + case 3: //East + switch(metadata) { + case 2: return 4; + case 3: return 5; + case 4: return 2; + case 5: return 3; + } + } + return 0; + } + + /** + * Places door at specified location with orientation-adjusted meta + * don't ask me which directions are what (take direction such as South/0 and add 1) + */ + protected void placeDoor(World world, StructureBoundingBox box, Block door, int direction, int featureX, int featureY, int featureZ) { + int meta = getMetadataWithOffset(Blocks.wooden_door, direction); + int posX = this.getXWithOffset(featureX, featureZ); + int posY = this.getYWithOffset(featureY); + int posZ = this.getZWithOffset(featureX, featureZ); + + this.placeBlockAtCurrentPosition(world, door, meta, featureX, featureY, featureZ, box); + ItemDoor.placeDoorBlock(world, posX, posY, posZ, meta, door); + } + + /** Loot Methods **/ + + /** + * it feels disgusting to make a method with this many parameters but fuck it, it's easier + * @return TE implementing IInventory with randomized contents + */ + protected boolean generateInvContents(World world, StructureBoundingBox box, Random rand, Block block, int featureX, int featureY, int featureZ, WeightedRandomChestContent[] content, int amount) { + int posX = this.getXWithOffset(featureX, featureZ); + int posY = this.getYWithOffset(featureY); + int posZ = this.getZWithOffset(featureX, featureZ); + + this.placeBlockAtCurrentPosition(world, block, 0, featureX, featureY, featureZ, box); + IInventory inventory = (IInventory)world.getTileEntity(posX, posY, posZ); + + if(inventory != null) { + WeightedRandomChestContent.generateChestContents(rand, content, inventory, amount); + return true; + } + + return false; + } + + /** + * Places random bobblehead with a randomized orientation at specified location + */ + protected void placeRandomBobble(World world, StructureBoundingBox box, Random rand, int featureX, int featureY, int featureZ) { + int posX = this.getXWithOffset(featureX, featureZ); + int posY = this.getYWithOffset(featureY); + int posZ = this.getZWithOffset(featureX, featureZ); + + placeBlockAtCurrentPosition(world, ModBlocks.bobblehead, rand.nextInt(16), featureX, featureY, featureZ, box); + TileEntityBobble bobble = (TileEntityBobble) world.getTileEntity(posX, posY, posZ); + + if(bobble != null) { + bobble.type = BobbleType.values()[rand.nextInt(BobbleType.values().length - 1) + 1]; + bobble.markDirty(); + } + } + + /** Block Placement Utility Methods **/ + + /** + * Places blocks underneath location until reaching a solid block; good for foundations + */ + protected void placeFoundationUnderneath(World world, Block placeBlock, int meta, int featureX, int featureY, int featureZ, StructureBoundingBox box) { + int posX = this.getXWithOffset(featureX, featureZ); + int posY = this.getYWithOffset(featureY); + int posZ = this.getZWithOffset(featureX, featureZ); + + if(box.isVecInside(posX, posY, posZ)) { + Block block = world.getBlock(posX, posY, posZ); + + while ((world.isAirBlock(posX, posY, posZ) || !block.getMaterial().isSolid() || (block.isFoliage(world, posX, posY, posZ) || block.getMaterial() == Material.leaves)) && posY > 1) { + world.setBlock(posX, posY, posZ, placeBlock, meta, 2); + block = world.getBlock(posX, --posY, posZ); + } + } + } + + /** + * Places specified blocks on top of pre-existing blocks in a given area, up to a certain height. Does NOT place blocks on top of liquids. + * Useful for stuff like fences and walls most likely. + */ + protected void placeBlocksOnTop(World world, StructureBoundingBox box, Block block, int minX, int minZ, int maxX, int maxZ, int height) { + + for(int x = minX; x <= maxX; x++) { + for(int z = minZ; z <= maxZ; z++) { + int posX = this.getXWithOffset(x, z); + int posZ = this.getZWithOffset(x, z); + int topHeight = world.getTopSolidOrLiquidBlock(posX, posZ); + + if(!world.getBlock(posX, topHeight, posZ).getMaterial().isLiquid()) { + + for(int i = 0; i < height; i++) { + int posY = topHeight + i; + + world.setBlock(posX, posY, posZ, block, 0, 2); + } + } + } + } + } + + /** Block Selectors **/ + + static class Sandstone extends StructureComponent.BlockSelector { + + Sandstone() { } + + /** Selects blocks */ + @Override + public void selectBlocks(Random rand, int posX, int posY, int posZ, boolean p_75062_5_) { + float chance = rand.nextFloat(); + + if(chance > 0.6F) { + this.field_151562_a = Blocks.sandstone; + } else if (chance < 0.5F ) { + this.field_151562_a = ModBlocks.reinforced_sand; + } else { + this.field_151562_a = Blocks.sand; + } + } + } + + static class ConcreteBricks extends StructureComponent.BlockSelector { + + ConcreteBricks() { } + + /** Selects blocks */ + @Override + public void selectBlocks(Random rand, int posX, int posY, int posZ, boolean p_75062_5_) { + float chance = rand.nextFloat(); + + if(chance < 0.2F) { + this.field_151562_a = ModBlocks.brick_concrete; + } else if (chance < 0.55F) { + this.field_151562_a = ModBlocks.brick_concrete_mossy; + } else if (chance < 0.75F) { + this.field_151562_a = ModBlocks.brick_concrete_cracked; + } else { + this.field_151562_a = ModBlocks.brick_concrete_broken; + } + } + } + + //ag + static class LabTiles extends StructureComponent.BlockSelector { + + LabTiles() { } + + /** Selects blocks */ + @Override + public void selectBlocks(Random rand, int posX, int posY, int posZ, boolean p_75062_5_) { + float chance = rand.nextFloat(); + + if(chance < 0.5F) { + this.field_151562_a = ModBlocks.tile_lab; + } else if (chance < 0.9F) { + this.field_151562_a = ModBlocks.tile_lab_cracked; + } else { + this.field_151562_a = ModBlocks.tile_lab_broken; + } + } + } + + static class SuperConcrete extends StructureComponent.BlockSelector { + + SuperConcrete() { + this.field_151562_a = ModBlocks.concrete_super; + } + + /** Selects blocks */ + @Override + public void selectBlocks(Random rand, int posX, int posY, int posZ, boolean p_75062_5_) { + this.selectedBlockMetaData = rand.nextInt(6) + 10; + } + } + +} diff --git a/src/main/java/com/hbm/world/worldgen/components/MilitaryBaseFeatures.java b/src/main/java/com/hbm/world/worldgen/components/MilitaryBaseFeatures.java new file mode 100644 index 000000000..49bf2cad6 --- /dev/null +++ b/src/main/java/com/hbm/world/worldgen/components/MilitaryBaseFeatures.java @@ -0,0 +1,186 @@ +package com.hbm.world.worldgen.components; + +import java.util.LinkedList; +import java.util.Random; + +import com.hbm.blocks.ModBlocks; +import com.hbm.world.worldgen.ComponentNTMFeatures; + +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.gen.structure.StructureBoundingBox; + +public class MilitaryBaseFeatures { + + //stop-gap methods until this entire mess can be organized into proper classes/structure groups + public static void smallHelipad(LinkedList components, int chunkX, int posY, int chunkZ, Random rand) { + BasicHelipad helipad = new BasicHelipad(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); + int[] chunkPos = getAdjacentChunk(chunkX, chunkZ, rand); + + RadioShack radio = new RadioShack(rand, chunkPos[0] * 16 + 8, posY, chunkPos[1] * 16 + 8); + components.add(helipad); + components.add(radio); + } + + public static int[] getAdjacentChunk(int chunkX, int chunkZ, Random rand) { + int[] chunkPos = new int[2]; + + switch(rand.nextInt(4)) { + case 0: + chunkPos[0] = chunkX; + chunkPos[1] = chunkZ + 1; + break; + case 1: + chunkPos[0] = chunkX - 1; + chunkPos[1] = chunkZ; + break; + case 2: + chunkPos[0] = chunkX; + chunkPos[1] = chunkZ - 1; + break; + case 3: + chunkPos[0] = chunkX + 1; + chunkPos[1] = chunkZ; + break; + } + + return chunkPos; + } + + public static class BasicHelipad extends Feature { + + public BasicHelipad() { super(); } + + protected BasicHelipad(Random rand, int minX, int minY, int minZ) { + super(rand, minX, minY, minZ, 12, 0, 12); + } + + @Override + public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { + + if(!this.setAverageHeight(world, box, this.boundingBox.minY)) { + return true; + } + + this.boundingBox.offset(0, -1, 0); + + for(int i = 1; i < sizeX; i++) { + for(int j = 1; j < sizeZ; j++) { + func_151554_b(world, Blocks.stonebrick, 0, i, -1, j, box); + clearCurrentPositionBlocksUpwards(world, i, 1, j, box); + } + } + + for(int i = 0; i <= sizeX; i++) { + for(int j = 0; j <= sizeZ; j++) { + if(i == 0 || i == sizeX || j == 0 || j == sizeX) + func_151554_b(world, Blocks.stonebrick, 0, i, 0, j, box); + } + } + + //Helipad + fillWithBlocks(world, box, 1, 0, 1, 11, 0, 1, ModBlocks.concrete, Blocks.air, false); //this entire time, the second block was actually for anything not at min/max x's, y's, and z's. useful! + fillWithBlocks(world, box, 11, 0, 2, 11, 0, 11, ModBlocks.concrete, Blocks.air, false); + fillWithBlocks(world, box, 1, 0, 11, 10, 0, 11, ModBlocks.concrete, Blocks.air, false); + fillWithBlocks(world, box, 1, 0, 2, 1, 0, 10, ModBlocks.concrete, Blocks.air, false); + + fillWithBlocks(world, box, 2, 0, 2, 10, 0, 10, ModBlocks.concrete_smooth, Blocks.air, false); //i'm not carefully carving out the white H lmao fuck that + fillWithBlocks(world, box, 4, 0, 4, 4, 0, 8, ModBlocks.concrete_colored, Blocks.air, false); //white is 0 + fillWithBlocks(world, box, 8, 0, 4, 8, 0, 8, ModBlocks.concrete_colored, Blocks.air, false); + fillWithBlocks(world, box, 5, 0, 6, 7, 0, 6, ModBlocks.concrete_colored, Blocks.air, false); + + //Surrounding Fences + placeBlocksOnTop(world, box, ModBlocks.fence_metal, 0, 0, sizeX, 0, 1); + placeBlocksOnTop(world, box, ModBlocks.fence_metal, sizeX, 1, sizeX, sizeZ, 1); + placeBlocksOnTop(world, box, ModBlocks.fence_metal, 0, sizeZ, sizeX - 1, sizeZ, 1); + placeBlocksOnTop(world, box, ModBlocks.fence_metal, 0, 1, 0, sizeZ - 1, 1); + + return false; + } + + } + + public static class RadioShack extends Feature { + + private static LabTiles RandomLabTiles = new LabTiles(); + private static ConcreteBricks ConcreteBricks = new ConcreteBricks(); + + public RadioShack() { super(); } + + protected RadioShack(Random rand, int minX, int minY, int minZ) { + super(rand, minX, minY, minZ, 6, 4, 5); + } + + @Override + public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { + + if(!this.setAverageHeight(world, box, this.boundingBox.minY)) { + return true; + } + + this.boundingBox.offset(0, -1, 0); + + for(int i = 1; i <= sizeX; i++) { + for(int j = 1; j <= sizeZ; j++) { + func_151554_b(world, Blocks.stonebrick, 0, i, -1, j, box); + } + } + + func_151554_b(world, Blocks.stonebrick, 0, 0, 0, 2, box); + + //Floor & Foundation + fillWithRandomizedBlocks(world, box, 2, 0, 1, 5, 0, 4, false, rand, RandomLabTiles); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_pillar, 0, 1, 0, 1, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_pillar, 0, sizeX, 0, 1, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_pillar, 0, 1, 0, sizeZ, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_pillar, 0, sizeX, 0, sizeZ, box); + fillWithBlocks(world, box, 2, 0, 1, sizeX - 1, 0, 1, ModBlocks.concrete_smooth, Blocks.air, false); + fillWithBlocks(world, box, 2, 0, 0, sizeX - 1, 0, 0, ModBlocks.concrete_smooth, Blocks.air, false); + fillWithBlocks(world, box, sizeX, 0, 2, sizeX, 0, sizeZ - 1, ModBlocks.concrete_smooth, Blocks.air, false); + fillWithBlocks(world, box, 2, 0, sizeZ, sizeX - 1, 0, sizeZ, ModBlocks.concrete_smooth, Blocks.air, false); + fillWithBlocks(world, box, 1, 0, 2, 1, 0, sizeZ - 1, ModBlocks.concrete_smooth, Blocks.air, false); + + //Back Wall + fillWithRandomizedBlocks(world, box, 1, 1, 1, 2, sizeY - 1, 1, false, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 2, 1, 0, 5, sizeY - 1, 0, false, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 5, 1, 1, sizeX, sizeY - 1, 1, false, rand, ConcreteBricks); + //Front Wall + fillWithRandomizedBlocks(world, box, 1, 1, sizeZ, 2, sizeY - 1, sizeZ, false, rand, ConcreteBricks); + placeBlockAtCurrentPosition(world, ModBlocks.brick_concrete, 0, 3, sizeY - 1, sizeZ, box); + fillWithRandomizedBlocks(world, box, 4, 1, sizeZ, sizeX, sizeY - 1, sizeZ, false, rand, ConcreteBricks); + placeDoor(world, box, ModBlocks.door_metal, 3, 3, 1, sizeZ); + //Left & Right Wall + fillWithRandomizedBlocks(world, box, 1, 1, 2, 1, sizeY - 1, sizeZ - 1, false, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, sizeX, 1, 2, sizeX, sizeY - 1, sizeZ - 1, false, rand, ConcreteBricks); + placeBlockAtCurrentPosition(world, ModBlocks.reinforced_glass, 0, 1, 2, 3, box); + placeBlockAtCurrentPosition(world, ModBlocks.reinforced_glass, 0, sizeX, 2, 2, box); + placeBlockAtCurrentPosition(world, ModBlocks.reinforced_glass, 0, sizeX, 2, 4, box); + //Ceiling + fillWithBlocks(world, box, 3, sizeY - 1, 1, 4, sizeY - 1, 1, ModBlocks.concrete_smooth, Blocks.air, false); + fillWithBlocks(world, box, 2, sizeY - 1, 2, sizeX - 1, sizeY - 1, sizeZ - 1, ModBlocks.concrete_smooth, Blocks.air, false); + + fillWithAir(world, box, 2, 1, 2, sizeX - 1, 2, sizeZ - 1); + + //Decoration + int southMeta = getDecoMeta(2); + int northMeta = getDecoMeta(3); //all of these deco blocks are so inconsistent about what their directions actually are + int eastMeta = getDecoMeta(4); + fillWithMetadataBlocks(world, box, 2, 1, 2, 5, 1, 2, ModBlocks.steel_grate, 7, null, 0, false); //null should be okay here + fillWithBlocks(world, box, 3, 1, 1, 4, 1, 1, ModBlocks.deco_tungsten, null, false); + fillWithMetadataBlocks(world, box, 3, 2, 1, 4, 2, 1, ModBlocks.tape_recorder, northMeta, null, 0, false); + placeBlockAtCurrentPosition(world, ModBlocks.radiorec, southMeta, 2, 2, 2, box); + placeRandomBobble(world, box, rand, sizeX - 1, 2, 2); + fillWithMetadataBlocks(world, box, sizeX - 1, 1, 3, sizeX - 1, 2, 3, ModBlocks.tape_recorder, eastMeta, null, 0, false); + //OutsideDeco + fillWithMetadataBlocks(world, box, 0, 1, 2, 0, 2, 2, ModBlocks.steel_poles, eastMeta, null, 0, false); + placeBlockAtCurrentPosition(world, ModBlocks.pole_satellite_receiver, eastMeta, 0, sizeY - 1, 2, box); + fillWithBlocks(world, box, 0, sizeY, 2, sizeX - 1, sizeY, 2, ModBlocks.steel_roof, null, false); + placeBlockAtCurrentPosition(world, ModBlocks.steel_roof, 0, sizeX - 1, sizeY, 3, box); + + return false; + } + + } + + +} From 5f4c6469c44a70b8142f43f41ef4fc284540f195 Mon Sep 17 00:00:00 2001 From: Vaern Date: Fri, 2 Sep 2022 22:19:04 -0700 Subject: [PATCH 02/12] Organized structure classes, added config for structures and loot within tomorrow we got the epic looking computer deco block coming in it's freaking amazing gamers see you on the battlebus --- .../java/com/hbm/config/CommonConfig.java | 1 + .../java/com/hbm/config/StructureConfig.java | 37 + src/main/java/com/hbm/lib/HbmWorld.java | 22 +- src/main/java/com/hbm/main/MainRegistry.java | 1 + .../world/worldgen/ComponentNTMFeatures.java | 1397 ----------------- .../hbm/world/worldgen/MapGenNTMFeatures.java | 26 +- .../hbm/world/worldgen/NTMWorldGenerator.java | 6 +- .../worldgen/components/CivilianFeatures.java | 761 +++++++++ .../world/worldgen/components/Feature.java | 2 + .../components/MilitaryBaseFeatures.java | 5 +- .../worldgen/components/RuinFeatures.java | 279 ++++ 11 files changed, 1122 insertions(+), 1415 deletions(-) create mode 100644 src/main/java/com/hbm/config/StructureConfig.java delete mode 100644 src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java create mode 100644 src/main/java/com/hbm/world/worldgen/components/CivilianFeatures.java create mode 100644 src/main/java/com/hbm/world/worldgen/components/RuinFeatures.java diff --git a/src/main/java/com/hbm/config/CommonConfig.java b/src/main/java/com/hbm/config/CommonConfig.java index 2cbbab121..57495b68a 100644 --- a/src/main/java/com/hbm/config/CommonConfig.java +++ b/src/main/java/com/hbm/config/CommonConfig.java @@ -21,6 +21,7 @@ public class CommonConfig { public static final String CATEGORY_MOBS = "12_mobs"; public static final String CATEGORY_RADIATION = "13_radiation"; public static final String CATEGORY_HAZARD = "14_hazard"; + public static final String CATEGORY_STRUCTURES = "15_structures"; public static final String CATEGORY_528 = "528"; public static final String CATEGORY_LBSM = "LESS BULLSHIT MODE"; diff --git a/src/main/java/com/hbm/config/StructureConfig.java b/src/main/java/com/hbm/config/StructureConfig.java new file mode 100644 index 000000000..2f22d7281 --- /dev/null +++ b/src/main/java/com/hbm/config/StructureConfig.java @@ -0,0 +1,37 @@ +package com.hbm.config; + +import com.hbm.main.MainRegistry; + +import net.minecraftforge.common.config.Configuration; + +public class StructureConfig { + + public static boolean enableStructures = true; + + public static int structureMinChunks = 8; + public static int structureMaxChunks = 24; + + public static double lootAmountFactor = 1D; + + public static void loadFromConfig(Configuration config) { + + final String CATEGORY_STRUCTURES = CommonConfig.CATEGORY_STRUCTURES; + enableStructures = CommonConfig.createConfigBool(config, CATEGORY_STRUCTURES, "5.00_enableStructures", "Switch for whether structures using the MapGenStructure system spawn.", true); + + structureMinChunks = CommonConfig.createConfigInt(config, CATEGORY_STRUCTURES, "5.01_structureMinChunks", "Minimum non-zero distance between structures in chunks (Settings lower than 8 may be problematic).", 8); + structureMaxChunks = CommonConfig.createConfigInt(config, CATEGORY_STRUCTURES, "5.02_structureMaxChunks", "Maximum non-zero distance between structures in chunks.", 24); + + lootAmountFactor = CommonConfig.createConfigDouble(config, CATEGORY_STRUCTURES, "5.03_lootAmountFactor", "General factor for loot spawns. Applies to spawned IInventories, not loot blocks.", 1D); + + structureMinChunks = CommonConfig.setDef(structureMinChunks, 8); + structureMaxChunks = CommonConfig.setDef(structureMaxChunks, 24); + + if(structureMinChunks > structureMaxChunks) { + MainRegistry.logger.error("Fatal error config: Minimum value has been set higher than the maximum value!"); + MainRegistry.logger.error(String.format("Errored values will default back to %1$d and %2$d respectively, PLEASE REVIEW CONFIGURATION DESCRIPTION BEFORE MEDDLING WITH VALUES!", 8, 24)); + structureMinChunks = 8; + structureMaxChunks = 24; + } + + } +} diff --git a/src/main/java/com/hbm/lib/HbmWorld.java b/src/main/java/com/hbm/lib/HbmWorld.java index 242899b3e..69294f45c 100644 --- a/src/main/java/com/hbm/lib/HbmWorld.java +++ b/src/main/java/com/hbm/lib/HbmWorld.java @@ -1,8 +1,10 @@ package com.hbm.lib; -import com.hbm.world.worldgen.ComponentNTMFeatures; import com.hbm.world.worldgen.MapGenNTMFeatures; import com.hbm.world.worldgen.NTMWorldGenerator; +import com.hbm.world.worldgen.components.CivilianFeatures.*; +import com.hbm.world.worldgen.components.MilitaryBaseFeatures.*; +import com.hbm.world.worldgen.components.RuinFeatures.*; import cpw.mods.fml.common.IWorldGenerator; import cpw.mods.fml.common.registry.GameRegistry; @@ -19,7 +21,7 @@ public class HbmWorld { //MapGenStructureIO.registerStructure(StructureStartTest.class, "HFR_STRUCTURE"); //MapGenStructureIO.func_143031_a(StructureComponentTest.class, "HFR_COMPONENT"); MapGenStructureIO.registerStructure(MapGenNTMFeatures.Start.class, "NTMFeatures"); - ComponentNTMFeatures.registerNTMFeatures(); + registerNTMFeatures(); registerWorldGen(new HbmWorldGen(), 1); registerWorldGen(new NTMWorldGenerator(), 1); //Ideally, move everything over from HbmWorldGen to NTMWorldGenerator @@ -29,4 +31,20 @@ public class HbmWorld { public static void registerWorldGen(IWorldGenerator nukerWorldGen, int weightedProbability) { GameRegistry.registerWorldGenerator(nukerWorldGen, weightedProbability); } + + /** Register structures in MapGenStructureIO */ + public static void registerNTMFeatures() { + MapGenStructureIO.func_143031_a(NTMHouse1.class, "NTMHouse1"); + MapGenStructureIO.func_143031_a(NTMHouse2.class, "NTMHouse2"); + MapGenStructureIO.func_143031_a(NTMLab1.class, "NTMLab1"); + MapGenStructureIO.func_143031_a(NTMLab2.class, "NTMLab2"); + MapGenStructureIO.func_143031_a(NTMWorkshop1.class, "NTMWorkshop1"); + MapGenStructureIO.func_143031_a(NTMRuin1.class, "NTMRuin1"); + MapGenStructureIO.func_143031_a(NTMRuin2.class, "NTMRuin2"); + MapGenStructureIO.func_143031_a(NTMRuin3.class, "NTMRuin3"); + MapGenStructureIO.func_143031_a(NTMRuin4.class, "NTMRuin4"); + //aggggggggggg + MapGenStructureIO.func_143031_a(BasicHelipad.class, "NTMBasicHelipad"); + MapGenStructureIO.func_143031_a(RadioShack.class, "NTMRadioShack"); + } } diff --git a/src/main/java/com/hbm/main/MainRegistry.java b/src/main/java/com/hbm/main/MainRegistry.java index e671273f5..615c78c47 100644 --- a/src/main/java/com/hbm/main/MainRegistry.java +++ b/src/main/java/com/hbm/main/MainRegistry.java @@ -863,6 +863,7 @@ public class MainRegistry { ToolConfig.loadFromConfig(config); WeaponConfig.loadFromConfig(config); MobConfig.loadFromConfig(config); + StructureConfig.loadFromConfig(config); try { if(GeneralConfig.enableThermosPreventer && Class.forName("thermos.Thermos") != null) { diff --git a/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java b/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java deleted file mode 100644 index 49b292dbd..000000000 --- a/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java +++ /dev/null @@ -1,1397 +0,0 @@ -package com.hbm.world.worldgen; - -import java.util.Random; - -import com.hbm.blocks.ModBlocks; -import com.hbm.blocks.generic.BlockBobble.BobbleType; -import com.hbm.blocks.generic.BlockBobble.TileEntityBobble; -import com.hbm.lib.HbmChestContents; -import com.hbm.tileentity.machine.storage.TileEntityCrateIron; -import com.hbm.util.LootGenerator; -import com.hbm.world.worldgen.components.MilitaryBaseFeatures; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemDoor; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.WeightedRandomChestContent; -import net.minecraft.world.World; -import net.minecraft.world.gen.structure.MapGenStructureIO; -import net.minecraft.world.gen.structure.StructureBoundingBox; -import net.minecraft.world.gen.structure.StructureComponent; -import scala.reflect.internal.Trees.This; - -//TODO: -//KILL! -//Probably one of the more difficult parts. -/** Base component file. For structure generation under 32x32 blocks, as Minecraft generates 2x2 chunks for structures. - * Larger non-procedural structures should be split up into several bounding boxes, which check if they intersect the chunk bounding box currently being loaded. Doing so will prevent - * cascading world generation. See - * - * TheMasterCaver's advice. */ -public class ComponentNTMFeatures { - - /** Register structures in MapGenStructureIO */ - public static void registerNTMFeatures() { - MapGenStructureIO.func_143031_a(ComponentNTMFeatures.NTMHouse1.class, "NTMHouse1"); - MapGenStructureIO.func_143031_a(ComponentNTMFeatures.NTMHouse2.class, "NTMHouse2"); - MapGenStructureIO.func_143031_a(ComponentNTMFeatures.NTMLab1.class, "NTMLab1"); - MapGenStructureIO.func_143031_a(ComponentNTMFeatures.NTMLab2.class, "NTMLab2"); - MapGenStructureIO.func_143031_a(ComponentNTMFeatures.NTMWorkshop1.class, "NTMWorkshop1"); - MapGenStructureIO.func_143031_a(ComponentNTMFeatures.NTMRuin1.class, "NTMRuin1"); - MapGenStructureIO.func_143031_a(ComponentNTMFeatures.NTMRuin2.class, "NTMRuin2"); - MapGenStructureIO.func_143031_a(ComponentNTMFeatures.NTMRuin3.class, "NTMRuin3"); - MapGenStructureIO.func_143031_a(ComponentNTMFeatures.NTMRuin4.class, "NTMRuin4"); - //aggggggggggg - MapGenStructureIO.func_143031_a(MilitaryBaseFeatures.BasicHelipad.class, "NTMBasicHelipad"); - MapGenStructureIO.func_143031_a(MilitaryBaseFeatures.RadioShack.class, "NTMRadioShack"); - } - - /** Sandstone Ruin 1 */ - public static class NTMHouse1 extends ComponentNTMFeatures.Feature { - - private boolean hasPlacedChest; - - private static ComponentNTMFeatures.Sandstone RandomSandstone = new ComponentNTMFeatures.Sandstone(); - - public NTMHouse1() { - super(); - } - - /** Constructor for this feature; takes coordinates for bounding box */ - protected NTMHouse1(Random rand, int minX, int minY, int minZ) { - super(rand, minX, minY, minZ, 9, 4, 6); - this.hasPlacedChest = false; - } - - @Override - protected void func_143012_a(NBTTagCompound nbt) { - super.func_143012_a(nbt); - nbt.setBoolean("hasChest", this.hasPlacedChest); - } - - @Override - protected void func_143011_b(NBTTagCompound nbt) { - super.func_143011_b(nbt); - this.hasPlacedChest = nbt.getBoolean("hasChest"); - } - - /** - * Generates structures. - */ - @Override - public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { - /* - * Places block at current position. Dependent on coordinate mode, i.e. will allow for random rotation, so use this instead of setBlock! - * this.placeBlockAtCurrentPosition(world, block, minX, metadata, x, y, z, box); - * Fills an area with air, self-explanatory. Use to clear interiors of unwanted blocks. - * this.fillWithAir(world, box, minX, minY, minZ, maxX, maxY, maxZ); - * Fills an area with blocks, self-explanatory. - * this.fillWithBlocks(world, box, minX, minY, minZ, maxX, maxY, maxZ, blockToPlace, blockToReplace, alwaysReplace); - * Fills an area with metadata blocks, self-explanatory. - * this.fillWithMetadataBlocks(world, box, minX, minY, minZ, maxX, maxY, maxZ, blockToPlace, blockPlaceMeta, blockToReplace, replaceBlockMeta, alwaysReplace); - * Fills an area with randomized blocks, self-explanatory. - * this.fillWithRandomizedBlocks(world, box, minX, minY, minZ, maxX, maxY, maxZ, alwaysReplace, rand, StructureComponent.blockSelector); - * (BlockSelector is basically a list of blocks that can be randomly picked, except that it can actually be weighted) - * Replaces any air or water blocks with this block down. Useful for foundations - * this.func_151554_b(world, block, metadata, x, startAtY, z, box - * Fills an area with blocks randomly - look into randLimit? - * this.randomlyFillWithBlocks(world, box, rand, randLimit, minX, minY, minZ, maxX, maxY, maxZ, blockToPlace, blockToReplace, alwaysReplace); - */ - - //System.out.println(this.coordBaseMode); - if(!this.setAverageHeight(world, box, this.boundingBox.minY)) { - return false; - } - //System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); - - for(byte i = 0; i < this.featureSizeX + 1; i++) { - for(byte j = 0; j < this.featureSizeZ + 1; j++) { - this.func_151554_b(world, Blocks.sandstone, 0, i, -1, j, box); - } - } - - //Walls - this.fillWithRandomizedBlocks(world, box, 0, 0, 0, featureSizeX, 0, 0, false, rand, RandomSandstone); //Back Wall - this.fillWithRandomizedBlocks(world, box, 0, 1, 0, 1, 1, 0, false, rand, RandomSandstone); - this.placeBlockAtCurrentPosition(world, Blocks.fence, 0, 2, 1, 0, box); - this.fillWithRandomizedBlocks(world, box, 3, 1, 0, 5, 1, 0, false, rand, RandomSandstone); - this.placeBlockAtCurrentPosition(world, Blocks.fence, 0, 6, 1, 0, box); - this.placeBlockAtCurrentPosition(world, Blocks.fence, 0, 7, 1, 0, box); - this.fillWithRandomizedBlocks(world, box, featureSizeX - 1, 1, 0, featureSizeX, 1, 0, false, rand, RandomSandstone); - this.fillWithRandomizedBlocks(world, box, 0, 2, 0, featureSizeX - 2, 2, 0, false, rand, RandomSandstone); - this.fillWithRandomizedBlocks(world, box, 0, 0, 0, 0, 1, featureSizeZ, false, rand, RandomSandstone); //Left Wall - this.placeBlockAtCurrentPosition(world, Blocks.stone_slab, 1, 0, 2, 1, box); - this.fillWithMetadataBlocks(world, box, 0, 2, 3, 0, 2, featureSizeZ, Blocks.stone_slab, 1, Blocks.air, 0, false); - this.fillWithRandomizedBlocks(world, box, 1, 0, featureSizeZ, 1, 1, featureSizeZ, false, rand, RandomSandstone); //Front Wall - this.fillWithRandomizedBlocks(world, box, 3, 0, featureSizeZ, featureSizeX, 1, featureSizeZ, false, rand, RandomSandstone); - this.fillWithRandomizedBlocks(world, box, 1, 2, featureSizeZ, 3, 2, featureSizeZ, false, rand, RandomSandstone); - this.fillWithMetadataBlocks(world, box, 4, 2, featureSizeZ, 5, 2, featureSizeZ, Blocks.stone_slab, 1, Blocks.air, 0, false); - this.placeBlockAtCurrentPosition(world, Blocks.stone_slab, 1, featureSizeX - 2, 2, featureSizeZ, box); - this.fillWithRandomizedBlocks(world, box, featureSizeX, 0, 0, featureSizeX, 0, featureSizeZ, false, rand, RandomSandstone); //Right Wall - this.randomlyFillWithBlocks(world, box, rand, 0.65F, featureSizeX, 1, 1, featureSizeX, 1, featureSizeZ - 1, Blocks.sand, Blocks.air, false); - - this.fillWithRandomizedBlocks(world, box, 4, 0, 1, 4, 1, 3, false, rand, RandomSandstone); - this.placeBlockAtCurrentPosition(world, ModBlocks.reinforced_sand, 0, 4, 0, 4, box); - - //Loot/Sand - this.placeBlockAtCurrentPosition(world, ModBlocks.crate_weapon, 0, 1, 0, 1, box); - if(!this.hasPlacedChest) - this.hasPlacedChest = this.generateStructureChestContents(world, box, rand, 3, 0, 1, HbmChestContents.modGeneric, rand.nextInt(2) + 8); - this.fillWithBlocks(world, box, 5, 0, 1, 6, 0, 1, ModBlocks.crate, Blocks.air, false); - this.placeBlockAtCurrentPosition(world, Blocks.sand, 0, 7, 0, 1, box); - if(rand.nextFloat() <= 0.25) - this.placeBlockAtCurrentPosition(world, ModBlocks.crate_metal, 0, featureSizeX - 1, 0, 1, box); - this.randomlyFillWithBlocks(world, box, rand, 0.25F, 1, 0, 2, 3, 0, featureSizeZ - 1, Blocks.sand, Blocks.air, false); - this.randomlyFillWithBlocks(world, box, rand, 0.25F, 5, 0, 2, featureSizeX - 1, 0, featureSizeZ - 1, Blocks.sand, Blocks.air, false); - - return true; - } - - } - - public static class NTMHouse2 extends ComponentNTMFeatures.Feature { - - private static ComponentNTMFeatures.Sandstone RandomSandstone = new ComponentNTMFeatures.Sandstone(); - - private boolean[] hasPlacedLoot = new boolean[2]; - - public NTMHouse2() { - super(); - } - - protected NTMHouse2(Random rand, int minX, int minY, int minZ) { - super(rand, minX, minY, minZ, 15, 5, 9); - this.hasPlacedLoot[0] = false; - this.hasPlacedLoot[1] = false; - } - - @Override - protected void func_143012_a(NBTTagCompound nbt) { - super.func_143012_a(nbt); - nbt.setBoolean("hasLoot1", this.hasPlacedLoot[0]); - nbt.setBoolean("hasLoot2", this.hasPlacedLoot[1]); - } - - @Override - protected void func_143011_b(NBTTagCompound nbt) { - super.func_143011_b(nbt); - this.hasPlacedLoot[0] = nbt.getBoolean("hasLoot1"); - this.hasPlacedLoot[1] = nbt.getBoolean("hasLoot2"); - } - - @Override - public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { - - //System.out.print(this.coordBaseMode); - if(!this.setAverageHeight(world, box, this.boundingBox.minY)) { - return false; - } - //System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); - - for(byte i = 0; i < 7; i++) { - for(byte j = 0; j < this.featureSizeZ + 1; j++) { - this.func_151554_b(world, Blocks.sandstone, 0, i, -1, j, box); - } - } - - for(byte i = 9; i < this.featureSizeX + 1; i++) { - for(byte j = 0; j < this.featureSizeZ + 1; j++) { - this.func_151554_b(world, Blocks.sandstone, 0, i, -1, j, box); - } - } - - this.fillWithAir(world, box, 1, 0, 1, 5, featureSizeY, featureSizeZ - 1); - - //House 1 - this.fillWithRandomizedBlocks(world, box, 0, 0, 0, 6, 1, 0, false, rand, RandomSandstone); //Back Wall - this.fillWithRandomizedBlocks(world, box, 0, 2, 0, 1, 2, 0, false, rand, RandomSandstone); - this.placeBlockAtCurrentPosition(world, Blocks.fence, 0, 2, 2, 0, box); - this.fillWithRandomizedBlocks(world, box, 3, 2, 0, 3, 2, 0, false, rand, RandomSandstone); - this.placeBlockAtCurrentPosition(world, Blocks.fence, 0, 4, 2, 0, box); - this.fillWithRandomizedBlocks(world, box, 5, 2, 0, 6, 2, 0, false, rand, RandomSandstone); - this.fillWithRandomizedBlocks(world, box, 0, 3, 0, 6, 3, 0, false, rand, RandomSandstone); - this.fillWithRandomizedBlocks(world, box, 0, 0, 1, 0, 3, featureSizeZ, false, rand, RandomSandstone); //Left Wall - this.fillWithRandomizedBlocks(world, box, 1, 0, featureSizeZ, 6, 1, featureSizeZ, false, rand, RandomSandstone); //Front Wall - this.fillWithRandomizedBlocks(world, box, 1, 2, featureSizeZ, 1, 2, featureSizeZ, false, rand, RandomSandstone); - this.fillWithBlocks(world, box, 2, 2, featureSizeZ, 4, 2, featureSizeZ, Blocks.fence, Blocks.air, false); - this.fillWithRandomizedBlocks(world, box, 5, 2, featureSizeZ, 6, 2, featureSizeZ, false, rand, RandomSandstone); - this.fillWithRandomizedBlocks(world, box, 1, 3, featureSizeZ, 6, 3, featureSizeZ, false, rand, RandomSandstone); - this.fillWithRandomizedBlocks(world, box, 6, 0, featureSizeZ - 1, 6, 3, featureSizeZ - 1, false, rand, RandomSandstone); //Right Wall - this.fillWithRandomizedBlocks(world, box, 6, 0, featureSizeZ - 2, 6, 0, featureSizeZ - 2, false, rand, RandomSandstone); - this.fillWithRandomizedBlocks(world, box, 6, 3, featureSizeZ - 2, 6, 3, featureSizeZ - 2, false, rand, RandomSandstone); - this.fillWithRandomizedBlocks(world, box, 6, 0, 1, 6, 3, featureSizeZ - 3, false, rand, RandomSandstone); - - this.fillWithBlocks(world, box, 1, 0, 1, 5, 0, featureSizeZ - 1, Blocks.sandstone, Blocks.air, false); //Floor - //this.fillWithRandomizedBlocks(world, box, 1, featureSizeY - 1, 0, 5, featureSizeY - 1, featureSizeZ, false, rand, RandomSandstone); //Ceiling - this.fillWithBlocks(world, box, 1, featureSizeY - 1, 0, 5, featureSizeY - 1, featureSizeZ, Blocks.sandstone, Blocks.air, false); - this.fillWithMetadataBlocks(world, box, 0, featureSizeY - 1, 0, 0, featureSizeY - 1, featureSizeZ, Blocks.stone_slab, 1, Blocks.air, 0, false); //Roof - this.fillWithMetadataBlocks(world, box, 6, featureSizeY - 1, 0, 6, featureSizeY - 1, featureSizeZ, Blocks.stone_slab, 1, Blocks.air, 0, false); - this.fillWithMetadataBlocks(world, box, 2, featureSizeY, 0, 4, featureSizeY, 0, Blocks.stone_slab, 1, Blocks.air, 0, false); - this.fillWithMetadataBlocks(world, box, 3, featureSizeY, 1, 3, featureSizeY, 2, Blocks.stone_slab, 1, Blocks.air, 0, false); - this.fillWithMetadataBlocks(world, box, 3, featureSizeY, 4, 3, featureSizeY, 6, Blocks.stone_slab, 1, Blocks.air, 0, false); - this.placeBlockAtCurrentPosition(world, Blocks.stone_slab, 1, 3, featureSizeY, featureSizeZ - 1, box); - this.fillWithMetadataBlocks(world, box, 2, featureSizeY, featureSizeZ, 4, featureSizeY, featureSizeZ, Blocks.stone_slab, 1, Blocks.air, 0, false); - - //House 2 - this.fillWithRandomizedBlocks(world, box, featureSizeX - 6, 0, 0, featureSizeX, 0, 0, false, rand, RandomSandstone); //Back Wall - this.fillWithRandomizedBlocks(world, box, featureSizeX - 6, 1, 0, featureSizeX - 2, 1, 0, false, rand, RandomSandstone); - this.fillWithRandomizedBlocks(world, box, featureSizeX - 6, 2, 0, featureSizeX - 6, 2, 0, false, rand, RandomSandstone); - this.placeBlockAtCurrentPosition(world, Blocks.stone_slab, 1, featureSizeX - 6, 2, 0, box); - this.placeBlockAtCurrentPosition(world, Blocks.stone_slab, 1, featureSizeX - 3, 2, 0, box); - this.fillWithRandomizedBlocks(world, box, featureSizeX - 6, 0, 1, featureSizeX - 6, 3, 1, false, rand, RandomSandstone); //Left Wall - this.fillWithRandomizedBlocks(world, box, featureSizeX - 6, 0, 2, featureSizeX - 6, 0, 2, false, rand, RandomSandstone); - this.fillWithRandomizedBlocks(world, box, featureSizeX - 6, 3, 2, featureSizeX - 6, 3, featureSizeZ - 1, false, rand, RandomSandstone); - this.placeBlockAtCurrentPosition(world, Blocks.stone_slab, 1, featureSizeX - 6, featureSizeY - 1, 2, box); - this.fillWithMetadataBlocks(world, box, featureSizeX - 6, featureSizeY - 1, 4, featureSizeX - 6, featureSizeY - 1, featureSizeZ - 2, Blocks.stone_slab, 1, Blocks.air, 0, false); - this.fillWithRandomizedBlocks(world, box, featureSizeX - 6, 0, 3, featureSizeX - 6, 1, featureSizeZ, false, rand, RandomSandstone); - this.fillWithRandomizedBlocks(world, box, featureSizeX - 6, 0, 2, featureSizeX - 6, 0, 2, false, rand, RandomSandstone); - this.fillWithRandomizedBlocks(world, box, featureSizeX - 6, 2, 3, featureSizeX - 6, 2, 3, false, rand, RandomSandstone); - this.placeBlockAtCurrentPosition(world, Blocks.fence, 0, featureSizeX - 6, 2, 4, box); - this.fillWithRandomizedBlocks(world, box, featureSizeX - 6, 2, 5, featureSizeX - 6, 2, 5, false, rand, RandomSandstone); - this.fillWithBlocks(world, box, featureSizeX - 6, 2, featureSizeZ - 3, featureSizeX - 6, 2, featureSizeZ - 2, Blocks.fence, Blocks.air, false); - this.fillWithRandomizedBlocks(world, box, featureSizeX - 6, 2, featureSizeZ - 1, featureSizeX - 6, 2, featureSizeZ, false, rand, RandomSandstone); - this.fillWithRandomizedBlocks(world, box, featureSizeX - 5, 0, featureSizeZ, featureSizeX, 1, featureSizeZ, false, rand, RandomSandstone); //Front Wall - this.fillWithRandomizedBlocks(world, box, featureSizeX - 5, 2, featureSizeZ, featureSizeX - 5, 2, featureSizeZ, false, rand, RandomSandstone); - this.fillWithRandomizedBlocks(world, box, featureSizeX - 1, 2, featureSizeZ, featureSizeX, 2, featureSizeZ, false, rand, RandomSandstone); - this.fillWithRandomizedBlocks(world, box, featureSizeX, 0, 1, featureSizeX, 0, featureSizeZ - 1, false, rand, RandomSandstone); //Right Wall - this.fillWithRandomizedBlocks(world, box, featureSizeX, 1, 3, featureSizeX, 1, 3, false, rand, RandomSandstone); - this.fillWithMetadataBlocks(world, box, featureSizeX, 1, 4, featureSizeX, 1, 5, Blocks.stone_slab, 1, Blocks.air, 0, false); - this.fillWithRandomizedBlocks(world, box, featureSizeX, 1, featureSizeZ - 1, featureSizeX, 1, featureSizeZ - 3, false, rand, RandomSandstone); - this.placeBlockAtCurrentPosition(world, Blocks.stone_slab, 1, featureSizeX, 1, featureSizeZ - 1, box); - - this.fillWithBlocks(world, box, featureSizeX - 5, 0, 1, featureSizeX - 1, 0, featureSizeZ - 1, Blocks.sandstone, Blocks.air, false); //Floor - - //Loot & Decorations - //House 1 - int eastMeta = this.getDecoMeta(4); - this.placeBlockAtCurrentPosition(world, ModBlocks.machine_boiler_off, 4, 1, 1, 1, box); - this.fillWithBlocks(world, box, 1, 2, 1, 1, 3, 1, ModBlocks.deco_pipe_quad_rusted, Blocks.air, false); - this.placeBlockAtCurrentPosition(world, ModBlocks.deco_pipe_rim_rusted, 0, 1, featureSizeY, 1, box); - this.placeBlockAtCurrentPosition(world, ModBlocks.crate, 0, 2, 1, 3, box); - this.placeBlockAtCurrentPosition(world, ModBlocks.crate_can, 0, 1, 1, featureSizeZ - 4, box); - if(!hasPlacedLoot[0]) { - this.placeBlockAtCurrentPosition(world, Blocks.chest, this.getMetadataWithOffset(Blocks.chest, 3), 1, 1, featureSizeZ - 2, box); - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.machineParts, (TileEntityChest)world.getTileEntity(this.getXWithOffset(1, featureSizeZ - 2), - this.getYWithOffset(1), this.getZWithOffset(1, featureSizeZ - 2)), 10); - this.hasPlacedLoot[0] = true; - } - this.fillWithBlocks(world, box, 4, 1, featureSizeZ - 1, 5, 1, featureSizeZ - 1, ModBlocks.crate, Blocks.air, false); - this.fillWithMetadataBlocks(world, box, 5, 1, 4, 5, 3, 4, ModBlocks.steel_scaffold, eastMeta, Blocks.air, 0, false); - this.fillWithMetadataBlocks(world, box, 5, 1, 6, 5, 3, 6, ModBlocks.steel_scaffold, eastMeta, Blocks.air, 0, false); - this.placeBlockAtCurrentPosition(world, ModBlocks.steel_grate, 7, 5, 1, 5, box); - this.placeBlockAtCurrentPosition(world, ModBlocks.crate_weapon, 0, 5, 2, 5, box); - - //House 2 - if(!hasPlacedLoot[1]) { - this.placeBlockAtCurrentPosition(world, Blocks.chest, this.getMetadataWithOffset(Blocks.chest, 3), featureSizeX - 5, 1, 1, box); - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.antenna, (TileEntityChest)world.getTileEntity(this.getXWithOffset(featureSizeX - 5, 1), - this.getYWithOffset(1), this.getZWithOffset(featureSizeX - 5, 1)), 10); - this.hasPlacedLoot[1] = true; - } - this.placeBlockAtCurrentPosition(world, ModBlocks.bobblehead, rand.nextInt(16), featureSizeX - 5, 1, 4, box); - TileEntityBobble bobble = (TileEntityBobble) world.getTileEntity(this.getXWithOffset(featureSizeX - 5, 4), this.getYWithOffset(1), this.getZWithOffset(featureSizeX - 5, 4)); - - if(bobble != null) { - bobble.type = BobbleType.values()[rand.nextInt(BobbleType.values().length - 1) + 1]; - bobble.markDirty(); - } - - this.randomlyFillWithBlocks(world, box, rand, 0.25F, featureSizeX - 4, 1, 1, featureSizeX - 1, 1, featureSizeZ - 1, Blocks.sand, Blocks.air, false); - - return true; - } - } - - public static class NTMLab1 extends ComponentNTMFeatures.Feature { - - private static ComponentNTMFeatures.ConcreteBricks RandomConcreteBricks = new ComponentNTMFeatures.ConcreteBricks(); - private static ComponentNTMFeatures.LabTiles RandomLabTiles = new ComponentNTMFeatures.LabTiles(); - - private boolean[] hasPlacedLoot = new boolean[2]; - - public NTMLab1() { - super(); - } - - /** Constructor for this feature; takes coordinates for bounding box */ - protected NTMLab1(Random rand, int minX, int minY, int minZ) { - super(rand, minX, minY, minZ, 9, 4, 7); - this.hasPlacedLoot[0] = false; - this.hasPlacedLoot[1] = false; - } - - @Override - protected void func_143012_a(NBTTagCompound nbt) { - super.func_143012_a(nbt); - nbt.setBoolean("hasLoot1", this.hasPlacedLoot[0]); - nbt.setBoolean("hasLoot2", this.hasPlacedLoot[1]); - } - - @Override - protected void func_143011_b(NBTTagCompound nbt) { - super.func_143011_b(nbt); - this.hasPlacedLoot[0] = nbt.getBoolean("hasLoot1"); - this.hasPlacedLoot[1] = nbt.getBoolean("hasLoot2"); - } - - @Override - public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { - - //System.out.println(this.coordBaseMode); - if(!this.setAverageHeight(world, box, this.boundingBox.minY)) { - return false; - } - //System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); - - for(byte i = 0; i < this.featureSizeX + 1; i++) { - for(byte j = 0; j < this.featureSizeZ - 1; j++) { - this.func_151554_b(world, Blocks.stonebrick, 0, i, -1, j, box); - } - } - - for(byte i = 3; i < this.featureSizeX + 1; i++) { - for(byte j = 6; j < this.featureSizeZ + 1; j++) { - this.func_151554_b(world, Blocks.stonebrick, 0, i, -1, j, box); - } - } - - int stairsMeta = this.getMetadataWithOffset(Blocks.stone_brick_stairs, 0); - if(this.getBlockAtCurrentPosition(world, 2, 0, featureSizeZ - 1, box).getMaterial().isReplaceable() - || this.getBlockAtCurrentPosition(world, 2, 0, featureSizeZ - 1, box) == Blocks.air) { - this.func_151554_b(world, Blocks.stonebrick, 0, 2, -1, featureSizeZ - 1, box); - this.placeBlockAtCurrentPosition(world, Blocks.stone_brick_stairs, stairsMeta, 2, 0, featureSizeZ - 1, box); - } - - this.fillWithAir(world, box, 1, 0, 1, featureSizeX - 1, featureSizeY, 4); - this.fillWithAir(world, box, 4, 0, 4, featureSizeX - 1, featureSizeY, featureSizeZ - 1); - this.fillWithAir(world, box, 3, 1, featureSizeZ - 1, 3, 2, featureSizeZ - 1); - - int pillarMeta = this.getPillarMeta(8); - - //Pillars - this.fillWithBlocks(world, box, 0, 0, 0, 0, 3, 0, ModBlocks.concrete_pillar, Blocks.air, false); - this.fillWithBlocks(world, box, featureSizeX, 0, 0, featureSizeX, 3, 0, ModBlocks.concrete_pillar, Blocks.air, false); - this.fillWithMetadataBlocks(world, box, 0, 0, 1, 0, 0, 4, ModBlocks.concrete_pillar, pillarMeta, Blocks.air, 0, false); - this.fillWithMetadataBlocks(world, box, featureSizeX, 0, 1, featureSizeX, 0, featureSizeZ - 1, ModBlocks.concrete_pillar, pillarMeta, Blocks.air, 0, false); - this.fillWithBlocks(world, box, 0, 0, featureSizeZ - 2, 0, 3, featureSizeZ - 2, ModBlocks.concrete_pillar, Blocks.air, false); - this.fillWithBlocks(world, box, 3, 0, featureSizeZ - 2, 3, 3, featureSizeZ - 2, ModBlocks.concrete_pillar, Blocks.air, false); - this.fillWithBlocks(world, box, 3, 0, featureSizeZ, 3, 3, featureSizeZ, ModBlocks.concrete_pillar, Blocks.air, false); - this.fillWithBlocks(world, box, featureSizeX, 0, featureSizeZ, featureSizeX, 3, featureSizeZ, ModBlocks.concrete_pillar, Blocks.air, false); - - //Walls - this.fillWithRandomizedBlocks(world, box, 1, 0, 0, featureSizeX - 1, featureSizeY - 1, 0, false, rand, RandomConcreteBricks); //Back Wall - this.fillWithRandomizedBlocks(world, box, 0, featureSizeY, 0, featureSizeX, featureSizeY, 0, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 0, 1, 1, 0, featureSizeY - 1, 4, false, rand, RandomConcreteBricks); //Left Wall - this.fillWithRandomizedBlocks(world, box, 0, featureSizeY, 0, 0, featureSizeY, featureSizeZ - 2, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 1, 0, featureSizeZ - 2, 2, featureSizeY, featureSizeZ - 2, false, rand, RandomConcreteBricks); //Front Wall Pt. 1 - this.placeBlockAtCurrentPosition(world, ModBlocks.brick_concrete_broken, 0, 3, featureSizeY, featureSizeZ - 2, box); - this.fillWithRandomizedBlocks(world, box, 3, featureSizeY - 1, featureSizeZ - 1, 3, featureSizeY, featureSizeZ - 1, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 4, 0, featureSizeZ, featureSizeX - 1, 1, featureSizeZ, false, rand, RandomConcreteBricks); //Front Wall Pt. 2 - this.fillWithRandomizedBlocks(world, box, 4, 2, featureSizeZ, 4, 3, featureSizeZ, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, featureSizeX - 1, 2, featureSizeZ, featureSizeX - 1, 3, featureSizeZ, false, rand, RandomConcreteBricks); - this.randomlyFillWithBlocks(world, box, rand, 0.75F, 5, 2, featureSizeZ, featureSizeX - 2, 3, featureSizeZ, Blocks.glass_pane, Blocks.air, false); - this.fillWithRandomizedBlocks(world, box, 3, featureSizeY, featureSizeZ, featureSizeX, featureSizeY, featureSizeZ, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, featureSizeX, 1, 1, featureSizeX, featureSizeY, featureSizeZ - 1, false, rand, RandomConcreteBricks); //Right Wall - - //Floor & Ceiling - this.fillWithRandomizedBlocks(world, box, 1, 0, 1, featureSizeX - 1, 0, 4, false, rand, RandomLabTiles); //Floor - this.fillWithRandomizedBlocks(world, box, 4, 0, featureSizeZ - 2, featureSizeX - 1, 0, featureSizeZ - 1, false, rand, RandomLabTiles); - this.placeBlockAtCurrentPosition(world, ModBlocks.tile_lab_cracked, 0, 3, 0, featureSizeZ - 1, box); - - this.fillWithBlocks(world, box, 1, featureSizeY - 1, 1, 1, featureSizeY, 4, ModBlocks.reinforced_glass, Blocks.air, false); //Ceiling - this.fillWithBlocks(world, box, 2, featureSizeY, 1, featureSizeX - 1, featureSizeY, 4, ModBlocks.brick_light, Blocks.air, false); - this.fillWithBlocks(world, box, 4, featureSizeY, featureSizeZ - 2, featureSizeX - 1, featureSizeY, featureSizeZ - 1, ModBlocks.brick_light, Blocks.air, false); - - //Decorations & Loot - this.fillWithMetadataBlocks(world, box, 1, 1, 1, 1, 1, 4, Blocks.dirt, 2, Blocks.air, 0, false); - int westDecoMeta = this.getDecoMeta(5); - this.fillWithMetadataBlocks(world, box, 2, 1, 1, 2, 1, 4, ModBlocks.steel_wall, westDecoMeta, Blocks.air, 0, false); - this.fillWithMetadataBlocks(world, box, 2, featureSizeY - 1, 1, 2, featureSizeY - 1, 4, ModBlocks.steel_wall, westDecoMeta, Blocks.air, 0, false); - for(byte i = 0; i < 4; i++) { - this.placeBlockAtCurrentPosition(world, ModBlocks.plant_flower, i, 1, 2, 1 + i, box); - } - - int doorMeta = this.getMetadataWithOffset(Blocks.wooden_door, 2); - this.placeBlockAtCurrentPosition(world, ModBlocks.door_office, doorMeta, 3, 1, featureSizeZ - 1, box); - ItemDoor.placeDoorBlock(world, this.getXWithOffset(3, featureSizeZ - 1), this.getYWithOffset(1), this.getZWithOffset(3, featureSizeZ - 1), doorMeta, ModBlocks.door_office); - - int northDecoMeta = this.getDecoMeta(3); - this.fillWithMetadataBlocks(world, box, 5, featureSizeY - 1, 1, featureSizeX - 1, featureSizeY - 1, 1, ModBlocks.steel_scaffold, westDecoMeta, Blocks.air, 0, false); - this.fillWithMetadataBlocks(world, box, 5, featureSizeY - 1, 2, featureSizeX - 1, featureSizeY - 1, 2, ModBlocks.steel_wall, northDecoMeta, Blocks.air, 0, false); - this.placeBlockAtCurrentPosition(world, ModBlocks.machine_electric_furnace_off, northDecoMeta, 5, 1, 1, box); - this.placeBlockAtCurrentPosition(world, ModBlocks.machine_microwave, northDecoMeta, 5, 2, 1, box); - this.placeBlockAtCurrentPosition(world, ModBlocks.deco_titanium, 0, 6, 1, 1, box); - this.placeBlockAtCurrentPosition(world, ModBlocks.machine_shredder, 0, featureSizeX - 2, 1, 1, box); - this.placeBlockAtCurrentPosition(world, ModBlocks.deco_titanium, 0, featureSizeX - 1, 1, 1, box); - this.fillWithBlocks(world, box, 5, 1, 3, featureSizeX - 1, 1, 3, ModBlocks.deco_titanium, Blocks.air, false); - if(!hasPlacedLoot[0]) { - this.placeBlockAtCurrentPosition(world, ModBlocks.deco_loot, 0, 6, 2, 3, box); - LootGenerator.lootMedicine(world, this.getXWithOffset(6, 3), this.getYWithOffset(2), this.getZWithOffset(6, 3)); - this.hasPlacedLoot[0] = true; - } - - this.placeBlockAtCurrentPosition(world, ModBlocks.crate_can, 0, featureSizeX - 1, 1, featureSizeZ - 2, box); - if(!hasPlacedLoot[1]) { - this.hasPlacedLoot[1] = this.generateIronCrateContents(world, box, rand, featureSizeX - 1, 1, featureSizeZ - 1, HbmChestContents.modGeneric, 8); - } - - return true; - } - } - - public static class NTMLab2 extends ComponentNTMFeatures.Feature { - - private static ComponentNTMFeatures.SuperConcrete RandomSuperConcrete = new ComponentNTMFeatures.SuperConcrete(); - private static ComponentNTMFeatures.ConcreteBricks RandomConcreteBricks = new ComponentNTMFeatures.ConcreteBricks(); - private static ComponentNTMFeatures.LabTiles RandomLabTiles = new ComponentNTMFeatures.LabTiles(); - - private boolean[] hasPlacedLoot = new boolean[2]; - - public NTMLab2() { - super(); - } - - protected NTMLab2(Random rand, int minX, int minY, int minZ) { - super(rand, minX, minY, minZ, 12, 11, 8); - this.hasPlacedLoot[0] = false; - this.hasPlacedLoot[1] = false; - } - - @Override - protected void func_143012_a(NBTTagCompound nbt) { - super.func_143012_a(nbt); - nbt.setBoolean("hasLoot1", this.hasPlacedLoot[0]); - nbt.setBoolean("hasLoot2", this.hasPlacedLoot[1]); - } - - @Override - protected void func_143011_b(NBTTagCompound nbt) { - super.func_143011_b(nbt); - this.hasPlacedLoot[0] = nbt.getBoolean("hasLoot1"); - this.hasPlacedLoot[1] = nbt.getBoolean("hasLoot2"); - } - - @Override - public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { - - //System.out.println(this.coordBaseMode); - if(!this.setAverageHeight(world, box, this.boundingBox.minY)) { - return false; - } - this.boundingBox.offset(0, -7, 0); - //System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); - - for(byte i = 0; i < featureSizeX + 1; i++) { - for(byte j = 0; j < featureSizeZ - 1; j++) { - this.func_151554_b(world, Blocks.stonebrick, 0, i, 6, j, box); - } - } - - for(byte i = 0; i < 7; i++) { - for(byte j = 7; j < featureSizeZ + 1; j++) { - this.func_151554_b(world, Blocks.stonebrick, 0, i, 6, j, box); - } - } - - if(this.getBlockAtCurrentPosition(world, featureSizeX - 3, featureSizeY - 4, 7, box).getMaterial().isReplaceable() - || this.getBlockAtCurrentPosition(world, featureSizeX - 3, featureSizeY - 4, 7, box) == Blocks.air) { - int stairMeta = this.getMetadataWithOffset(Blocks.stone_brick_stairs, 2); - this.func_151554_b(world, Blocks.stonebrick, 0, featureSizeX - 3, featureSizeY - 4, 7, box); - this.func_151554_b(world, Blocks.stonebrick, 0, featureSizeX - 2, featureSizeY - 4, 7, box); - this.fillWithMetadataBlocks(world, box, featureSizeX - 3, featureSizeY - 4, 7, featureSizeX - 2, featureSizeY - 4, 7, Blocks.stone_brick_stairs, stairMeta, Blocks.air, 0, false); - } - - - this.fillWithAir(world, box, 1, featureSizeY - 4, 1, featureSizeX - 1, featureSizeY, featureSizeZ - 3); - this.fillWithAir(world, box, 1, featureSizeY - 4, featureSizeZ - 2, 5, featureSizeY, featureSizeZ - 1); - this.fillWithAir(world, box, featureSizeX - 3, featureSizeY - 3, featureSizeZ - 2, featureSizeX - 2, featureSizeY - 2, featureSizeZ - 2); - this.fillWithAir(world, box, 5, 5, 1, 6, 6, 2); - this.fillWithAir(world, box, 2, 0, 2, featureSizeX - 2, 3, featureSizeZ - 2); - - //Walls - this.fillWithRandomizedBlocks(world, box, 0, featureSizeY - 4, 0, featureSizeX, featureSizeY, 0, false, rand, RandomSuperConcrete); //Back Wall - this.fillWithRandomizedBlocks(world, box, 0, featureSizeY - 4, 0, 0, featureSizeY, featureSizeZ, false, rand, RandomSuperConcrete); //Left Wall - this.fillWithRandomizedBlocks(world, box, 1, featureSizeY - 4, featureSizeZ, 5, featureSizeY - 4, featureSizeZ, false, rand, RandomSuperConcrete); //Front Wall pt. 1 - this.fillWithBlocks(world, box, 1, featureSizeY - 3, featureSizeZ, 1, featureSizeY - 1, featureSizeZ, ModBlocks.reinforced_glass, Blocks.air, false); - this.fillWithRandomizedBlocks(world, box, 2, featureSizeY - 4, featureSizeZ, 2, featureSizeY - 1, featureSizeZ, false, rand, RandomSuperConcrete); - this.fillWithBlocks(world, box, 3, featureSizeY - 3, featureSizeZ, 3, featureSizeY - 1, featureSizeZ, ModBlocks.reinforced_glass, Blocks.air, false); - this.fillWithRandomizedBlocks(world, box, 4, featureSizeY - 4, featureSizeZ, 4, featureSizeY - 1, featureSizeZ, false, rand, RandomSuperConcrete); - this.fillWithBlocks(world, box, 5, featureSizeY - 3, featureSizeZ, 5, featureSizeY - 1, featureSizeZ, ModBlocks.reinforced_glass, Blocks.air, false); - this.fillWithRandomizedBlocks(world, box, 1, featureSizeY, featureSizeZ, 5, featureSizeY, featureSizeZ, false, rand, RandomSuperConcrete); - this.fillWithRandomizedBlocks(world, box, 6, featureSizeY - 4, featureSizeZ - 1, 6, featureSizeY, featureSizeZ, false, rand, RandomSuperConcrete); //Front Wall pt. 2 - this.fillWithRandomizedBlocks(world, box, 6, featureSizeY - 4, featureSizeZ - 2, 7, featureSizeY - 2, featureSizeZ - 2, false, rand, RandomSuperConcrete); //Front Wall pt. 3 - this.fillWithBlocks(world, box, 6, featureSizeY - 1, featureSizeZ - 2, 7, featureSizeY - 1, featureSizeZ - 2, ModBlocks.concrete_super_broken, Blocks.air, false); - this.fillWithRandomizedBlocks(world, box, featureSizeX - 4, featureSizeY - 4, featureSizeZ - 2, featureSizeX, featureSizeY - 4, featureSizeZ - 2, false, rand, RandomSuperConcrete); - this.fillWithRandomizedBlocks(world, box, featureSizeX - 4, featureSizeY - 3, featureSizeZ - 2, featureSizeX - 4, featureSizeY, featureSizeZ - 2, false, rand, RandomSuperConcrete); - this.fillWithRandomizedBlocks(world, box, featureSizeX - 3, featureSizeY - 1, featureSizeZ - 2, featureSizeX - 2, featureSizeY, featureSizeZ - 2, false, rand, RandomSuperConcrete); - this.fillWithRandomizedBlocks(world, box, featureSizeX - 1, featureSizeY - 4, featureSizeZ - 2, featureSizeX, featureSizeY, featureSizeZ - 2, false, rand, RandomSuperConcrete); - this.fillWithRandomizedBlocks(world, box, featureSizeX, featureSizeY - 4, 1, featureSizeX, featureSizeY - 4, featureSizeZ - 3, false, rand, RandomSuperConcrete); //Right Wall - this.fillWithBlocks(world, box, featureSizeX, featureSizeY - 3, featureSizeZ - 3, featureSizeX, featureSizeY - 1, featureSizeZ - 3, ModBlocks.reinforced_glass, Blocks.air, false); - this.fillWithRandomizedBlocks(world, box, featureSizeX, featureSizeY - 3, 4, featureSizeX, featureSizeY - 1, 4, false, rand, RandomSuperConcrete); - this.fillWithBlocks(world, box, featureSizeX, featureSizeY - 3, 3, featureSizeX, featureSizeY - 1, 3, ModBlocks.reinforced_glass, Blocks.air, false); - this.fillWithRandomizedBlocks(world, box, featureSizeX, featureSizeY - 3, 2, featureSizeX, featureSizeY - 1, 2, false, rand, RandomSuperConcrete); - this.fillWithBlocks(world, box, featureSizeX, featureSizeY - 3, 1, featureSizeX, featureSizeY - 1, 1, ModBlocks.reinforced_glass, Blocks.air, false); - this.fillWithRandomizedBlocks(world, box, featureSizeX, featureSizeY, 1, featureSizeX, featureSizeY, featureSizeZ - 3, false, rand, RandomSuperConcrete); - - this.fillWithBlocks(world, box, 1, 0, 1, featureSizeX - 1, 3, 1, ModBlocks.reinforced_stone, Blocks.air, false); //Back Wall - this.fillWithBlocks(world, box, 1, 0, 2, 1, 3, featureSizeZ - 2, ModBlocks.reinforced_stone, Blocks.air, false); //Left Wall - this.fillWithBlocks(world, box, 1, 0, featureSizeZ - 1, featureSizeX - 1, 3, featureSizeZ - 1, ModBlocks.reinforced_stone, Blocks.air, false); //Front Wall - this.fillWithBlocks(world, box, featureSizeX - 1, 0, 2, featureSizeX - 1, 3, featureSizeZ - 2, ModBlocks.reinforced_stone, Blocks.air, false); // Right Wall - this.fillWithBlocks(world, box, 6, 0, 3, 6, 3, featureSizeZ - 2, ModBlocks.reinforced_stone, Blocks.air, false); //Internal Wall - - //Floors & Ceiling - this.fillWithRandomizedBlocks(world, box, 1, featureSizeY - 4, 1, 3, featureSizeY - 4, featureSizeZ - 1, false, rand, RandomLabTiles); //Left Floor - this.fillWithRandomizedBlocks(world, box, 4, featureSizeY - 4, featureSizeZ - 2, 5, featureSizeY - 4, featureSizeZ - 1, false, rand, RandomLabTiles); - this.fillWithRandomizedBlocks(world, box, featureSizeX - 4, featureSizeY - 4, 1, featureSizeX - 1, featureSizeY - 4, featureSizeZ - 3, false, rand, RandomLabTiles); //Right Floor - this.fillWithRandomizedBlocks(world, box, featureSizeX - 3, featureSizeY - 4, featureSizeZ - 2, featureSizeX - 2, featureSizeY - 4, featureSizeZ - 2, false, rand, RandomLabTiles); - this.fillWithBlocks(world, box, 4, featureSizeY - 4, 1, 7, featureSizeY - 4, 1, ModBlocks.tile_lab_broken, Blocks.air, false); //Center Floor (Pain) - this.placeBlockAtCurrentPosition(world, ModBlocks.tile_lab_broken, 0, 4, featureSizeY - 4, 2, box); - this.fillWithBlocks(world, box, 4, featureSizeY - 4, 3, 4, featureSizeY - 4, 5, ModBlocks.tile_lab_cracked, Blocks.air, false); - this.placeBlockAtCurrentPosition(world, ModBlocks.tile_lab_broken, 0, 5, featureSizeY - 4, 3, box); - this.fillWithBlocks(world, box, 5, featureSizeY - 4, 4, 5, featureSizeY - 4, 5, ModBlocks.tile_lab_cracked, Blocks.air, false); - this.placeBlockAtCurrentPosition(world, ModBlocks.tile_lab_broken, 0, 6, featureSizeY - 4, 4, box); - this.placeBlockAtCurrentPosition(world, ModBlocks.tile_lab_cracked, 0, 6, featureSizeY - 4, 5, box); - this.fillWithBlocks(world, box, 7, featureSizeY - 4, 2, 7, featureSizeY - 4, 3, ModBlocks.tile_lab_broken, Blocks.air, false); - this.fillWithBlocks(world, box, 7, featureSizeY - 4, 4, 7, featureSizeY - 4, 5, ModBlocks.tile_lab_cracked, Blocks.air, false); - - this.fillWithBlocks(world, box, 1, featureSizeY, 1, 2, featureSizeY, featureSizeZ - 1, ModBlocks.brick_light, Blocks.air, false); //Left Ceiling - this.fillWithBlocks(world, box, 3, featureSizeY, featureSizeZ - 2, 4, featureSizeY, featureSizeZ - 1, ModBlocks.brick_light, Blocks.air, false); - this.fillWithBlocks(world, box, featureSizeX - 3, featureSizeY, 1, featureSizeX - 1, featureSizeY, featureSizeZ - 3, ModBlocks.brick_light, Blocks.air, false); //Right Ceiling - this.fillWithBlocks(world, box, 3, featureSizeY, 1, 8, featureSizeY, 1, ModBlocks.waste_planks, Blocks.air, false); //Center Ceiling (Pain) - this.fillWithBlocks(world, box, 3, featureSizeY, 2, 4, featureSizeY, 2, ModBlocks.waste_planks, Blocks.air, false); - this.fillWithBlocks(world, box, 7, featureSizeY, 2, 8, featureSizeY, 2, ModBlocks.waste_planks, Blocks.air, false); - this.fillWithBlocks(world, box, 3, featureSizeY, 3, 3, featureSizeY, 5, ModBlocks.waste_planks, Blocks.air, false); - this.fillWithBlocks(world, box, 4, featureSizeY, 4, 4, featureSizeY, 5, ModBlocks.waste_planks, Blocks.air, false); - this.fillWithBlocks(world, box, 5, featureSizeY, 6, 5, featureSizeY, featureSizeZ - 1, ModBlocks.waste_planks, Blocks.air, false); - this.fillWithBlocks(world, box, 8, featureSizeY, 3, 8, featureSizeY, 5, ModBlocks.waste_planks, Blocks.air, false); - - this.fillWithRandomizedBlocks(world, box, 2, 0, 2, 5, 0, featureSizeZ - 2, false, rand, RandomLabTiles); //Floor - this.fillWithRandomizedBlocks(world, box, 6, 0, 2, 6, 0, 3, false, rand, RandomLabTiles); - this.fillWithRandomizedBlocks(world, box, 7, 0, 2, featureSizeX - 2, 0, featureSizeZ - 2, false, rand, RandomLabTiles); - - this.fillWithRandomizedBlocks(world, box, 1, 4, 1, featureSizeX - 1, 4, featureSizeZ - 1, false, rand, RandomConcreteBricks); //Ceiling - - //Decorations & Loot - int eastMeta = this.getDecoMeta(4); - int westMeta = this.getDecoMeta(5); - int northMeta = this.getDecoMeta(3); - int southMeta = this.getDecoMeta(2); - this.placeBlockAtCurrentPosition(world, ModBlocks.crashed_balefire, southMeta, 6, featureSizeY - 2, 3, box); - - int doorMeta = this.getMetadataWithOffset(Blocks.wooden_door, 1); - this.placeBlockAtCurrentPosition(world, ModBlocks.door_office, doorMeta, featureSizeX - 3, featureSizeY - 3, featureSizeZ - 2, box); - ItemDoor.placeDoorBlock(world, this.getXWithOffset(featureSizeX - 3, featureSizeZ - 2), this.getYWithOffset(featureSizeY - 3), this.getZWithOffset(featureSizeX - 3, featureSizeZ - 2), - doorMeta, ModBlocks.door_office); - this.placeBlockAtCurrentPosition(world, ModBlocks.door_office, doorMeta, featureSizeX - 2, featureSizeY - 3, featureSizeZ - 2, box); - ItemDoor.placeDoorBlock(world, this.getXWithOffset(featureSizeX - 2, featureSizeZ - 2), this.getYWithOffset(featureSizeY - 3), this.getZWithOffset(featureSizeX - 2, featureSizeZ - 2), - doorMeta, ModBlocks.door_office); - - this.fillWithBlocks(world, box, 1, featureSizeY - 3, 1, 1, featureSizeY - 1, 1, ModBlocks.deco_steel, Blocks.air, false); - this.fillWithMetadataBlocks(world, box, 1, featureSizeY - 3, 2, 1, featureSizeY - 2, 3, ModBlocks.steel_grate, 7, Blocks.air, 0, false); - this.placeBlockAtCurrentPosition(world, ModBlocks.tape_recorder, westMeta, 1, featureSizeY - 1, 2, box); - this.placeBlockAtCurrentPosition(world, ModBlocks.steel_beam, 0, 1, featureSizeY - 1, 3, box); - this.fillWithBlocks(world, box, 1, featureSizeY - 3, 6, 1, featureSizeY - 1, 6, ModBlocks.deco_pipe_framed_rusted, Blocks.air, false); - - this.fillWithMetadataBlocks(world, box, featureSizeX - 4, featureSizeY - 3, 1, featureSizeX - 4, featureSizeY - 1, 1, ModBlocks.steel_wall, eastMeta, Blocks.air, 0, false); - this.fillWithMetadataBlocks(world, box, featureSizeX - 3, featureSizeY - 1, 1, featureSizeX - 2, featureSizeY - 1, 1, ModBlocks.steel_grate, 0, Blocks.air, 0, false); - this.fillWithMetadataBlocks(world, box, featureSizeX - 3, featureSizeY - 2, 1, featureSizeX - 2, featureSizeY - 2, 1, ModBlocks.tape_recorder, northMeta, Blocks.air, 0, false); - this.fillWithBlocks(world, box, featureSizeX - 3, featureSizeY - 3, 1, featureSizeX - 2, featureSizeY - 3, 1, ModBlocks.deco_steel, Blocks.air, false); - this.fillWithMetadataBlocks(world, box, featureSizeX - 1, featureSizeY - 3, 1, featureSizeX - 1, featureSizeY - 1, 1, ModBlocks.steel_wall, westMeta, Blocks.air, 0, false); - - this.fillWithMetadataBlocks(world, box, 2, 1, 2, 2, 1, featureSizeZ - 2, ModBlocks.steel_grate, 7, Blocks.air, 0, false); - this.placeBlockAtCurrentPosition(world, ModBlocks.vitrified_barrel, 0, 2, 2, 2, box); - this.fillWithMetadataBlocks(world, box, 3, 1, 2, 3, 3, 2, ModBlocks.steel_wall, westMeta, Blocks.air, 0, false); - this.fillWithMetadataBlocks(world, box, 3, 1, 4, 3, 3, 4, ModBlocks.steel_wall, westMeta, Blocks.air, 0, false); - this.fillWithMetadataBlocks(world, box, 3, 1, featureSizeZ - 2, 3, 3, featureSizeZ - 2, ModBlocks.steel_wall, westMeta, Blocks.air, 0, false); - this.placeBlockAtCurrentPosition(world, ModBlocks.crate, 0, 4, 1, featureSizeZ - 2, box); - this.placeBlockAtCurrentPosition(world, ModBlocks.crate_lead, 0, 4, 2, featureSizeZ - 2, box); - if(!hasPlacedLoot[0]) { - this.hasPlacedLoot[0] = this.generateIronCrateContents(world, box, rand, 5, 1, featureSizeZ - 2, HbmChestContents.nuclearFuel, 10); - } - this.fillWithBlocks(world, box, 4, 1, featureSizeZ - 3, 5, 1, featureSizeZ - 3, ModBlocks.crate_lead, Blocks.air, false); - - this.fillWithBlocks(world, box, featureSizeX - 5, 1, featureSizeZ - 2, featureSizeX - 5, 3, featureSizeZ - 2, ModBlocks.deco_steel, Blocks.air, false);; - this.fillWithMetadataBlocks(world, box, featureSizeX - 4, 1, featureSizeZ - 2, featureSizeX - 2, 1, featureSizeZ - 2, ModBlocks.steel_grate, 7, Blocks.air, 0, false); - this.fillWithMetadataBlocks(world, box, featureSizeX - 4, 2, featureSizeZ - 2, featureSizeX - 3, 2, featureSizeZ - 2, ModBlocks.tape_recorder, southMeta, Blocks.air, 0, false); - this.placeBlockAtCurrentPosition(world, ModBlocks.steel_beam, 0, featureSizeX - 2, 2, featureSizeZ - 2, box); - this.fillWithBlocks(world, box, featureSizeX - 4, 3, featureSizeZ - 2, featureSizeX - 2, 3, featureSizeZ - 2, ModBlocks.steel_roof, Blocks.air, false); - if(!hasPlacedLoot[1]) { - this.hasPlacedLoot[1] = this.generateIronCrateContents(world, box, rand, featureSizeX - 2, 1, 3, HbmChestContents.nukeTrash, 9); - } - - return true; - } - } - - public static class NTMWorkshop1 extends ComponentNTMFeatures.Feature { - - private static ComponentNTMFeatures.SuperConcrete RandomSuperConcrete = new ComponentNTMFeatures.SuperConcrete(); - - private boolean hasPlacedLoot; - - public NTMWorkshop1() { - super(); - } - - protected NTMWorkshop1(Random rand, int minX, int minY, int minZ) { - super(rand, minX, minY, minZ, 10, 6, 8); - this.hasPlacedLoot = false; - } - - @Override - protected void func_143012_a(NBTTagCompound nbt) { - super.func_143012_a(nbt); - nbt.setBoolean("hasLoot", this.hasPlacedLoot); - } - - @Override - protected void func_143011_b(NBTTagCompound nbt) { - super.func_143011_b(nbt); - this.hasPlacedLoot = nbt.getBoolean("hasLoot"); - } - - @Override - public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { - - ////System.out.println(this.coordBaseMode); - if(!this.setAverageHeight(world, box, this.boundingBox.minY)) { - return false; - } - //System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); - - for(byte i = 1; i < featureSizeX - 2; i++) { - for(byte j = 0; j < featureSizeZ + 1; j++) { - this.func_151554_b(world, Blocks.stonebrick, 0, i, -1, j, box); - } - } - - for(byte i = 8; i < featureSizeX + 1; i++) { - for(byte j = 1; j < 7; j++) { - this.func_151554_b(world, Blocks.dirt, 0, i, -1, j, box); - } - } - - this.fillWithAir(world, box, 1, 0, 0, featureSizeX - 3, featureSizeY - 2, featureSizeZ); - this.fillWithAir(world, box, featureSizeX - 2, 0, 2, featureSizeX - 1, 2, 5); - - if(this.getBlockAtCurrentPosition(world, 0, 0, 5, box).getMaterial().isReplaceable() - || this.getBlockAtCurrentPosition(world, 0, 0, 5, box) == Blocks.air) { - int stairMeta = this.getMetadataWithOffset(Blocks.stone_brick_stairs, 1); - this.placeBlockAtCurrentPosition(world, Blocks.stone_brick_stairs, stairMeta, 0, 0, 5, box); - - for(byte i = 1; 1 < featureSizeZ; i++) { - this.func_151554_b(world, Blocks.stonebrick, 0, 0, -1, i, box); - } - - this.fillWithMetadataBlocks(world, box, 0, 0, 1, 0, 0, featureSizeZ - 1, Blocks.stone_slab, 5, Blocks.air, 0, false); - } - - //Walls - int pillarMetaWE = this.getPillarMeta(4); - int pillarMetaNS = this.getPillarMeta(8); - this.fillWithBlocks(world, box, 1, 0, 0, 1, 3, 0, ModBlocks.concrete_pillar, Blocks.air, false); //Back Wall - this.placeBlockAtCurrentPosition(world, ModBlocks.concrete, 0, 1, 4, 0, box); - this.fillWithMetadataBlocks(world, box, 2, 4, 0, featureSizeX - 4, 4, 0, ModBlocks.concrete_pillar, pillarMetaWE, Blocks.air, 0, false); - this.placeBlockAtCurrentPosition(world, ModBlocks.concrete, 0, featureSizeX - 3, 4, 0, box); - this.fillWithBlocks(world, box, featureSizeX - 3, 0, 0, featureSizeX - 3, 3, 0, ModBlocks.concrete_pillar, Blocks.air, false); - this.fillWithRandomizedBlocks(world, box, 2, 0, 0, featureSizeX - 4, 1, 0, false, rand, RandomSuperConcrete); - this.fillWithRandomizedBlocks(world, box, 2, 2, 0, 2, 2, 0, false, rand, RandomSuperConcrete); - this.fillWithBlocks(world, box, 3, 2, 0, 5, 2, 0, ModBlocks.reinforced_glass, Blocks.air, false); - this.fillWithRandomizedBlocks(world, box, featureSizeX - 4, 2, 0, featureSizeX - 4, 2, 0, false, rand, RandomSuperConcrete); - this.fillWithRandomizedBlocks(world, box, 2, 3, 0, featureSizeX - 4, 3, 0, false, rand, RandomSuperConcrete); - this.fillWithMetadataBlocks(world, box, 1, 4, 1, 1, 4, featureSizeZ - 1, ModBlocks.concrete_pillar, pillarMetaNS, Blocks.air, 0, false); //Left Wall - this.placeBlockAtCurrentPosition(world, ModBlocks.concrete, 0, 1, 4, featureSizeZ, box); - this.fillWithBlocks(world, box, 1, 0, featureSizeZ, 1, 3, featureSizeZ, ModBlocks.concrete_pillar, Blocks.air, false); - this.fillWithRandomizedBlocks(world, box, 1, 0, 1, 1, 1, 4, false, rand, RandomSuperConcrete); - this.fillWithRandomizedBlocks(world, box, 1, 2, 1, 1, 2, 1, false, rand, RandomSuperConcrete); - this.fillWithBlocks(world, box, 1, 2, 2, 1, 2, 3, ModBlocks.reinforced_glass, Blocks.air, false); - this.fillWithRandomizedBlocks(world, box, 1, 2, 4, 1, 2, 4, false, rand, RandomSuperConcrete); - this.fillWithRandomizedBlocks(world, box, 1, 3, 1, 1, 3, featureSizeZ - 1, false, rand, RandomSuperConcrete); - this.fillWithRandomizedBlocks(world, box, 1, 0, featureSizeZ - 2, 1, 3, featureSizeZ - 1, false, rand, RandomSuperConcrete); - this.fillWithMetadataBlocks(world, box, 2, 4, featureSizeZ, featureSizeX - 4, 4, featureSizeZ, ModBlocks.concrete_pillar, pillarMetaWE, Blocks.air, 0, false); //Front Wall - this.placeBlockAtCurrentPosition(world, ModBlocks.concrete, 0, featureSizeX - 3, 4, featureSizeZ, box); - this.fillWithBlocks(world, box, featureSizeX - 3, 0, featureSizeZ, featureSizeX - 3, 3, featureSizeZ, ModBlocks.concrete_pillar, Blocks.air, false); - this.fillWithRandomizedBlocks(world, box, 2, 0, featureSizeZ, featureSizeX - 4, 1, featureSizeZ, false, rand, RandomSuperConcrete); - this.fillWithRandomizedBlocks(world, box, 2, 2, featureSizeZ, 2, 2, featureSizeZ, false, rand, RandomSuperConcrete); - this.fillWithBlocks(world, box, 3, 2, featureSizeZ, 5, 2, featureSizeZ, ModBlocks.reinforced_glass, Blocks.air, false); - this.fillWithRandomizedBlocks(world, box, featureSizeX - 4, 2, featureSizeZ, featureSizeX - 4, 2, featureSizeZ, false, rand, RandomSuperConcrete); - this.fillWithRandomizedBlocks(world, box, 2, 3, featureSizeZ, featureSizeX - 4, 3, featureSizeZ, false, rand, RandomSuperConcrete); - this.fillWithMetadataBlocks(world, box, featureSizeX - 3, 4, 1, featureSizeX - 3, 4, featureSizeZ - 1, ModBlocks.concrete_pillar, pillarMetaNS, Blocks.air, 0, false); //Right Wall - this.fillWithRandomizedBlocks(world, box, featureSizeX - 3, 0, 1, featureSizeX - 3, 3, featureSizeZ - 1, false, rand, RandomSuperConcrete); - - pillarMetaWE = this.getPillarMeta(5); - pillarMetaNS = this.getPillarMeta(9); - this.fillWithMetadataBlocks(world, box, featureSizeX - 2, 2, 1, featureSizeX - 1, 2, 1, Blocks.log, pillarMetaWE, Blocks.air, 0, false); //Back Wall - this.fillWithMetadataBlocks(world, box, featureSizeX, 0, 1, featureSizeX, 2, 1, Blocks.log, 1, Blocks.air, 0, false); - this.fillWithMetadataBlocks(world, box, featureSizeX - 2, 0, 1, featureSizeX - 1, 1, 1, Blocks.planks, 1, Blocks.air, 0, false); - this.fillWithMetadataBlocks(world, box, featureSizeX, 2, 2, featureSizeX, 2, 5, Blocks.log, pillarMetaNS, Blocks.air, 0, false); //Right Wall - this.fillWithMetadataBlocks(world, box, featureSizeX, 0, 6, featureSizeX, 2, 6, Blocks.log, 1, Blocks.air, 0, false); - this.fillWithMetadataBlocks(world, box, featureSizeX, 0, 3, featureSizeX, 1, 5, Blocks.planks, 1, Blocks.air, 0, false); - this.fillWithMetadataBlocks(world, box, featureSizeX - 2, 2, 6, featureSizeX - 1, 2, 6, Blocks.log, pillarMetaWE, Blocks.air, 0, false); //Front Wall - this.fillWithMetadataBlocks(world, box, featureSizeX - 2, 0, 6, featureSizeX - 1, 1, 6, Blocks.planks, 1, Blocks.air, 0, false); - - //Floor & Ceiling - this.fillWithBlocks(world, box, 2, 0, 1, 6, 0, featureSizeZ - 1, ModBlocks.brick_light, Blocks.air, false); //Floor - this.placeBlockAtCurrentPosition(world, ModBlocks.brick_light, 0, 1, 0, 5, box); - this.fillWithRandomizedBlocks(world, box, 2, 4, 1, 6, 4, 3, false, rand, RandomSuperConcrete); //Ceiling - this.fillWithRandomizedBlocks(world, box, 2, 4, 4, 2, 4, 4, false, rand, RandomSuperConcrete); - this.fillWithRandomizedBlocks(world, box, 5, 4, 4, 6, 4, 4, false, rand, RandomSuperConcrete); - this.fillWithRandomizedBlocks(world, box, 2, 4, featureSizeZ - 3, 6, 4, featureSizeZ - 1, false, rand, RandomSuperConcrete); - - this.fillWithBlocks(world, box, featureSizeX - 2, 2, 2, featureSizeX - 1, 2, 5, ModBlocks.deco_steel, Blocks.air, false); - - //Loot & Decorations - int southMeta = this.getDecoMeta(2); - int eastMeta = this.getDecoMeta(5); - this.placeBlockAtCurrentPosition(world, ModBlocks.pole_satellite_receiver, eastMeta, 2, featureSizeY - 1, 1, box); - this.fillWithBlocks(world, box, 3, featureSizeY - 1, 1, 4, featureSizeY - 1, 1, ModBlocks.deco_steel, Blocks.air, false); - this.fillWithBlocks(world, box, 2, featureSizeY - 1, 2, 4, featureSizeY - 1, 2, ModBlocks.deco_steel, Blocks.air, false); - this.fillWithBlocks(world, box, 2, featureSizeY, 1, 4, featureSizeY, 2, ModBlocks.steel_roof, Blocks.air, false); - this.fillWithBlocks(world, box, 2, 1, 1, 2, 3, 1, ModBlocks.deco_red_copper, Blocks.air, false); - this.fillWithBlocks(world, box, 3, 1, 1, 3, 1, 2, ModBlocks.deco_beryllium, Blocks.air, false); - this.placeBlockAtCurrentPosition(world, ModBlocks.machine_generator, 0, 4, 1, 1, box); - this.placeBlockAtCurrentPosition(world, ModBlocks.machine_detector, 0, 4, 1, 2, box); - this.fillWithBlocks(world, box, 5, 1, 1, 5, 1, 2, ModBlocks.deco_beryllium, Blocks.air, false); - this.fillWithBlocks(world, box, 6, 1, 1, 6, 3, 1, ModBlocks.deco_red_copper, Blocks.air, false); - this.fillWithBlocks(world, box, 3, 1, 4, 4, 1, 4, ModBlocks.concrete_super_broken, Blocks.air, false); - this.fillWithMetadataBlocks(world, box, 6, 1, 4, 6, 3, 4, ModBlocks.steel_scaffold, eastMeta, Blocks.air, 0, false); - this.fillWithMetadataBlocks(world, box, 6, 1, 5, 6, 1, 7, ModBlocks.steel_grate, 7, Blocks.air, 0, false); - this.placeBlockAtCurrentPosition(world, ModBlocks.radiorec, eastMeta, 6, 2, featureSizeZ - 1, box); - this.fillWithMetadataBlocks(world, box, 2, 1, featureSizeZ - 1, 3, 1, featureSizeZ - 1, ModBlocks.machine_electric_furnace_off, southMeta, Blocks.air, 0, false); - if(!hasPlacedLoot) { - this.hasPlacedLoot = this.generateIronCrateContents(world, box, rand, 4, 1, featureSizeZ - 1, HbmChestContents.machineParts, 11); - } - this.placeBlockAtCurrentPosition(world, Blocks.web, 0, 5, 3, 1, box); - this.placeBlockAtCurrentPosition(world, Blocks.web, 0, 2, 1, 2, box); - this.placeBlockAtCurrentPosition(world, Blocks.web, 0, 6, 1, 2, box); - this.placeBlockAtCurrentPosition(world, Blocks.web, 0, 6, 2, 5, box); - - this.fillWithMetadataBlocks(world, box, featureSizeX - 2, 0, 5, featureSizeX - 1, 0, 5, ModBlocks.steel_grate, 7, Blocks.air, 0, false); - this.placeBlockAtCurrentPosition(world, ModBlocks.tape_recorder, southMeta, featureSizeX - 2, 1, 5, box); - this.placeBlockAtCurrentPosition(world, ModBlocks.bobblehead, rand.nextInt(16), featureSizeX - 1, 1, 5, box); - TileEntityBobble bobble = (TileEntityBobble) world.getTileEntity(this.getXWithOffset(featureSizeX - 1, 5), this.getYWithOffset(1), this.getZWithOffset(featureSizeX - 1, 5)); - - if(bobble != null) { - bobble.type = BobbleType.values()[rand.nextInt(BobbleType.values().length - 1) + 1]; - bobble.markDirty(); - } - this.fillWithMetadataBlocks(world, box, featureSizeX - 2, 0, 2, featureSizeX - 2, 0, 3, Blocks.log, pillarMetaWE, Blocks.air, 0, false); - this.placeBlockAtCurrentPosition(world, Blocks.log, pillarMetaWE, featureSizeX - 2, 1, 2, box); - this.placeBlockAtCurrentPosition(world, Blocks.web, 0, featureSizeX - 2, 1, 3, box); - - return true; - } - } - - public static class NTMRuin1 extends ComponentNTMFeatures.Feature { - - private static ComponentNTMFeatures.ConcreteBricks RandomConcreteBricks = new ComponentNTMFeatures.ConcreteBricks(); - - public NTMRuin1() { - super(); - } - - protected NTMRuin1(Random rand, int minX, int minY, int minZ) { - super(rand, minX, minY, minZ, 8, 6, 10); - } - - @Override - public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { - - //System.out.println(this.coordBaseMode); - if(!this.setAverageHeight(world, box, this.boundingBox.minY)) { - return false; - } - //System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); - - for(byte i = 0; i < featureSizeX + 1; i++) { - for(byte j = 0; j < featureSizeZ + 1; j++) { - this.func_151554_b(world, Blocks.stonebrick, 0, i, -1, j, box); - } - } - - int pillarMetaWE = this.getPillarMeta(4); - int pillarMetaNS = this.getPillarMeta(8); - - this.fillWithBlocks(world, box, 0, 0, 0, 0, featureSizeY, 0, ModBlocks.concrete_pillar, Blocks.air, false); //Back Wall - this.fillWithMetadataBlocks(world, box, 1, 3, 0, 3, 3, 0, ModBlocks.concrete_pillar, pillarMetaWE, Blocks.air, 0, false); - this.fillWithBlocks(world, box, 4, 0, 0, 4, featureSizeY - 1, 0, ModBlocks.concrete_pillar, Blocks.air, false); - this.fillWithMetadataBlocks(world, box, 5, 3, 0, featureSizeX - 1, 3, 0, ModBlocks.concrete_pillar, pillarMetaWE, Blocks.air, 0, false); - this.fillWithBlocks(world, box, featureSizeX, 0, 0, featureSizeX, featureSizeY - 1, 0, ModBlocks.concrete_pillar, Blocks.air, false); - this.fillWithRandomizedBlocks(world, box, 1, 0, 0, 3, 0, 0, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 5, 0, 0, featureSizeX - 1, 0, 0, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 1, 1, 0, 1, 2, 0, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 3, 1, 0, 3, 2, 0, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 5, 1, 0, 5, 2, 0, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, featureSizeX - 1, 1, 0, featureSizeX - 1, 2, 0, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 1, 4, 0, 3, 4, 0, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 5, 4, 0, featureSizeX - 1, 4, 0, false, rand, RandomConcreteBricks); - this.fillWithMetadataBlocks(world, box, 0, 3, 1, 0, 3, featureSizeZ - 1, ModBlocks.concrete_pillar, pillarMetaNS, Blocks.air, 0, false); //Left Wall - this.fillWithBlocks(world, box, 0, 0, featureSizeZ, 0, featureSizeY - 1, featureSizeZ, ModBlocks.concrete_pillar, Blocks.air, false); - this.fillWithRandomizedBlocks(world, box, 0, 0, 1, 0, 0, featureSizeZ - 1, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 0, 1, 1, 0, 2, 2, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 0, 1, 4, 0, 2, 6, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 0, 1, featureSizeZ - 2, 0, 2, featureSizeZ - 1, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 0, 4, 1, 0, 4, 5, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 0, 5, 1, 0, 5, 2, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 0, 4, featureSizeZ - 2, 0, 4, featureSizeZ - 1, false, rand, RandomConcreteBricks); - this.fillWithMetadataBlocks(world, box, 1, 3, featureSizeZ, 3, 3, featureSizeZ, ModBlocks.concrete_pillar, pillarMetaWE, Blocks.air, 0, false); //Front Wall - this.fillWithBlocks(world, box, 4, 0, featureSizeZ, 4, featureSizeY - 2, featureSizeZ, ModBlocks.concrete_pillar, Blocks.air, false); - this.fillWithMetadataBlocks(world, box, 5, 3, featureSizeZ, featureSizeX - 1, 3, featureSizeZ, ModBlocks.concrete_pillar, pillarMetaWE, Blocks.air, 0, false); - this.fillWithBlocks(world, box, featureSizeX, 0, featureSizeZ, featureSizeX, featureSizeY - 2, featureSizeZ, ModBlocks.concrete_pillar, Blocks.air, false); - this.fillWithRandomizedBlocks(world, box, 1, 0, featureSizeZ, 3, 0, featureSizeZ, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 5, 0, featureSizeZ, featureSizeX - 1, 0, featureSizeZ, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 1, 1, featureSizeZ, 1, 2, featureSizeZ, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 3, 1, featureSizeZ, 3, 2, featureSizeZ, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 5, 1, featureSizeZ, 5, 2, featureSizeZ, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, featureSizeX - 1, 1, featureSizeZ, featureSizeX - 1, 2, featureSizeZ, false, rand, RandomConcreteBricks); - this.fillWithMetadataBlocks(world, box, featureSizeX, 3, 1, featureSizeX, 3, 2, ModBlocks.concrete_pillar, pillarMetaNS, Blocks.air, 0, false); //Right Wall - this.fillWithMetadataBlocks(world, box, featureSizeX, 3, featureSizeZ - 1, featureSizeX, 3, featureSizeZ - 1, ModBlocks.concrete_pillar, pillarMetaNS, Blocks.air, 0, false); - this.fillWithRandomizedBlocks(world, box, featureSizeX, 0, 1, featureSizeX, 0, 4, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, featureSizeX, 1, 1, featureSizeX, 2, 2, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, featureSizeX, 0, 6, featureSizeX, 0, 6, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, featureSizeX, 0, featureSizeZ - 2, featureSizeX, 1, featureSizeZ - 1, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, featureSizeX, 2, featureSizeZ - 1, featureSizeX, 2, featureSizeZ - 1, false, rand, RandomConcreteBricks); - - this.randomlyFillWithBlocks(world, box, rand, 0.25F, 1, 0, 1, featureSizeX - 1, 0, featureSizeZ - 1, Blocks.gravel, Blocks.air, false); - - return true; - } - } - - public static class NTMRuin2 extends ComponentNTMFeatures.Feature { - - private static ComponentNTMFeatures.ConcreteBricks RandomConcreteBricks = new ComponentNTMFeatures.ConcreteBricks(); - - public NTMRuin2() { - super(); - } - - protected NTMRuin2(Random rand, int minX, int minY, int minZ) { - super(rand, minX, minY, minZ, 7, 5, 10); - } - - @Override - public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { - - //System.out.println(this.coordBaseMode); - if(!this.setAverageHeight(world, box, this.boundingBox.minY)) { - return false; - } - //System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); - - for(byte i = 0; i < featureSizeX + 1; i++) { - for(byte j = 0; j < featureSizeZ + 1; j++) { - this.func_151554_b(world, Blocks.stonebrick, 0, i, -1, j, box); - } - } - - int pillarMetaWE = this.getPillarMeta(4); - int pillarMetaNS = this.getPillarMeta(8); - - this.fillWithBlocks(world, box, 0, 0, 0, 0, 3, 0, ModBlocks.concrete_pillar, Blocks.air, false); //Back Wall - this.fillWithMetadataBlocks(world, box, 1, 3, 0, featureSizeX - 1, 3, 0, ModBlocks.concrete_pillar, pillarMetaWE, Blocks.air, 0, false); - this.fillWithBlocks(world, box, featureSizeX, 0, 0, featureSizeX, featureSizeY, 0, ModBlocks.concrete_pillar, Blocks.air, false); - this.fillWithRandomizedBlocks(world, box, 1, 0, 0, featureSizeX - 1, 0, 0, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 1, 1, 0, 1, 2, 0, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 3, 1, 0, 4, 2, 0, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, featureSizeX - 1, 1, 0, featureSizeX - 1, 2, 0, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 3, 4, 0, featureSizeX - 1, 4, 0, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, featureSizeX - 1, featureSizeY, 0, featureSizeX - 1, featureSizeY, 0, false, rand, RandomConcreteBricks); - this.fillWithMetadataBlocks(world, box, 0, 3, 1, 0, 3, 4, ModBlocks.concrete_pillar, pillarMetaNS, Blocks.air, 0, false); //Left Wall - this.fillWithBlocks(world, box, 0, 0, 5, 0, 0, 5, ModBlocks.concrete_pillar, Blocks.air, false); - this.fillWithBlocks(world, box, 0, 0, featureSizeZ, 0, 2, featureSizeZ, ModBlocks.concrete_pillar, Blocks.air, false); - this.fillWithRandomizedBlocks(world, box, 0, 0, 1, 0, 2, 3, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 0, 0, featureSizeZ - 3, 0, 0, featureSizeZ - 1, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 0, 1, featureSizeZ - 1, 0, 1, featureSizeZ - 1, false, rand, RandomConcreteBricks); - this.fillWithMetadataBlocks(world, box, featureSizeX - 1, 3, featureSizeZ, featureSizeX - 1, 3, featureSizeZ, ModBlocks.concrete_pillar, pillarMetaWE, Blocks.air, 0, false); //Front Wall - this.fillWithBlocks(world, box, featureSizeX, 0, featureSizeZ, featureSizeX, 3, featureSizeZ, ModBlocks.concrete_pillar, Blocks.air, false); - this.fillWithRandomizedBlocks(world, box, 1, 0, featureSizeZ, featureSizeX - 1, 0, featureSizeZ, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 1, 1, featureSizeZ, 1, 2, featureSizeZ, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, featureSizeX - 1, 1, featureSizeZ, featureSizeX - 1, 2, featureSizeZ, false, rand, RandomConcreteBricks); - this.fillWithMetadataBlocks(world, box, featureSizeX, 3, 1, featureSizeX, 3, 4, ModBlocks.concrete_pillar, pillarMetaNS, Blocks.air, 0, false); //Right Wall - this.fillWithBlocks(world, box, featureSizeX, 0, 5, featureSizeX, 4, 5, ModBlocks.concrete_pillar, Blocks.air, false); - this.fillWithMetadataBlocks(world, box, featureSizeX, 3, featureSizeZ - 2, featureSizeX, 3, featureSizeZ - 1, ModBlocks.concrete_pillar, pillarMetaNS, Blocks.air, 0, false); - this.fillWithRandomizedBlocks(world, box, featureSizeX, 0, 1, featureSizeX, 0, 4, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, featureSizeX, 1, 1, featureSizeX, 2, 1, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, featureSizeX, 1, 3, featureSizeX, 2, 3, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, featureSizeX, 1, 4, featureSizeX, 1, 4, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, featureSizeX, 0, 6, featureSizeX, 0, featureSizeZ - 1, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, featureSizeX, 1, 6, featureSizeX, 1, 7, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, featureSizeX, 1, featureSizeZ - 1, featureSizeX, 2, featureSizeZ - 1, false, rand, RandomConcreteBricks); - - this.randomlyFillWithBlocks(world, box, rand, 0.25F, 1, 0, 1, featureSizeX - 1, 0, featureSizeZ - 1, Blocks.gravel, Blocks.air, false); - - return true; - } - } - - public static class NTMRuin3 extends ComponentNTMFeatures.Feature { - - private static ComponentNTMFeatures.ConcreteBricks RandomConcreteBricks = new ComponentNTMFeatures.ConcreteBricks(); - - public NTMRuin3() { - super(); - } - - protected NTMRuin3(Random rand, int minX, int minY, int minZ) { - super(rand, minX, minY, minZ, 8, 3, 10); - } - - @Override - public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { - - //System.out.println(this.coordBaseMode); - if(!this.setAverageHeight(world, box, this.boundingBox.minY)) { - return false; - } - //System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); - - for(byte i = 0; i < featureSizeZ + 1; i++) { - this.func_151554_b(world, Blocks.stonebrick, 0, 0, -1, i, box); - this.func_151554_b(world, Blocks.stonebrick, 0, featureSizeX, -1, i, box); - } - - for(byte i = 1; i < featureSizeX; i++) { - this.func_151554_b(world, Blocks.stonebrick, 0, i, -1, 0, box); - this.func_151554_b(world, Blocks.stonebrick, 0, i, -1, 4, box); - } - - this.fillWithBlocks(world, box, 0, 0, 0, 0, featureSizeY, 0, ModBlocks.concrete_pillar, Blocks.air, false); //Back Wall - this.fillWithBlocks(world, box, featureSizeX, 0, 0, featureSizeX, 1, 0, ModBlocks.concrete_pillar, Blocks.air, false); - this.fillWithRandomizedBlocks(world, box, 1, 0, 0, featureSizeX - 1, 0, 0, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 1, 1, 0, 1, 1, 0, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 4, 1, 0, 4, 1, 0, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, featureSizeX - 1, 1, 0, featureSizeX - 1, 1, 0, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 1, 2, 0, featureSizeX - 2, 2, 0, false, rand, RandomConcreteBricks); - this.fillWithBlocks(world, box, 0, 0, 4, 0, 1, 4, ModBlocks.concrete_pillar, Blocks.air, false); //Left Wall - this.placeBlockAtCurrentPosition(world, ModBlocks.concrete_pillar, 0, 0, 0, featureSizeZ, box); - this.fillWithRandomizedBlocks(world, box, 0, 0, 1, 0, 0, 3, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 0, 0, 5, 0, 0, featureSizeZ - 1, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 0, 1, 5, 0, 1, 5, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 0, 1, 7, 0, 1, 7, false, rand, RandomConcreteBricks); - this.fillWithBlocks(world, box, featureSizeX, 0, 4, featureSizeX, 1, 4, ModBlocks.concrete_pillar, Blocks.air, false); //Right Wall - this.fillWithBlocks(world, box, featureSizeX, 0, featureSizeZ, featureSizeX, 1, featureSizeZ, ModBlocks.concrete_pillar, Blocks.air, false); - this.fillWithRandomizedBlocks(world, box, featureSizeX, 0, 1, featureSizeX, 1, 3, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, featureSizeX, 0, 5, featureSizeX, 0, 6, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, featureSizeX, 0, featureSizeZ - 1, featureSizeX, 0, featureSizeZ - 1, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, featureSizeX - 1, 0, featureSizeZ, featureSizeX - 1, 0, featureSizeZ, false, rand, RandomConcreteBricks); - this.fillWithBlocks(world, box, 4, 0, 4, 4, 2, 4, ModBlocks.concrete_pillar, Blocks.air, false); //Center Wall - this.fillWithRandomizedBlocks(world, box, 3, 0, 4, 3, 1, 4, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 5, 0, 4, featureSizeX - 1, 1, 4, false, rand, RandomConcreteBricks); - - this.randomlyFillWithBlocks(world, box, rand, 0.05F, 1, 0, 1, featureSizeX - 1, 0, 3, Blocks.gravel, Blocks.air, false); - this.randomlyFillWithBlocks(world, box, rand, 0.05F, 1, 0, 5, featureSizeX - 1, 0, featureSizeZ - 1, Blocks.gravel, Blocks.air, false); - - return true; - } - } - - public static class NTMRuin4 extends ComponentNTMFeatures.Feature { - - private static ComponentNTMFeatures.ConcreteBricks RandomConcreteBricks = new ComponentNTMFeatures.ConcreteBricks(); - - public NTMRuin4() { - super(); - } - - protected NTMRuin4(Random rand, int minX, int minY, int minZ) { - super(rand, minX, minY, minZ, 10, 2, 11); - } - - @Override - public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { - - //System.out.println(this.coordBaseMode); - if(!this.setAverageHeight(world, box, this.boundingBox.minY)) { - return false; - } - //System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); - - for(byte i = 0; i < featureSizeZ + 1; i++) { - this.func_151554_b(world, Blocks.stonebrick, 0, 0, -1, i, box); - this.func_151554_b(world, Blocks.stonebrick, 0, i >= 5 ? featureSizeX : 5, -1, i, box); //elegant solution - } - - for(byte i = 1; i < featureSizeX; i++) { - this.func_151554_b(world, Blocks.stonebrick, 0, i, -1, featureSizeZ, box); - this.func_151554_b(world, Blocks.stonebrick, 0, i, -1, i > 4 ? 5 : 0, box); //ternary operators my beloved - } - - this.fillWithBlocks(world, box, 0, 0, 0, 0, 1, 0, ModBlocks.concrete_pillar, Blocks.air, false); //Back Wall Pt. 1 - this.fillWithBlocks(world, box, 5, 0, 0, 5, featureSizeY, 0, ModBlocks.concrete_pillar, Blocks.air, false); - this.fillWithRandomizedBlocks(world, box, 1, 0, 0, 4, 0, 0, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 4, 1, 0, 4, 1, 0, false, rand, RandomConcreteBricks); - this.fillWithBlocks(world, box, 5, 0, 5, 5, featureSizeY, 5, ModBlocks.concrete_pillar, Blocks.air, false); //Right Wall Pt. 1 - this.fillWithRandomizedBlocks(world, box, 5, 0, 1, 5, 0, 4, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 5, 1, 1, 5, 1, 1, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 5, 1, 4, 5, 1, 4, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 5, 2, 1, 5, 2, 4, false, rand, RandomConcreteBricks); - this.fillWithBlocks(world, box, featureSizeX, 0, 5, featureSizeX, 1, 5, ModBlocks.concrete_pillar, Blocks.air, false); //Back Wall Pt. 2 - this.fillWithRandomizedBlocks(world, box, 6, 0, 5, featureSizeX - 1, 0, 5, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 6, 1, 5, 6, 1, 5, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, featureSizeX - 1, 1, 5, featureSizeX - 1, 1, 5, false, rand, RandomConcreteBricks); - this.fillWithBlocks(world, box, featureSizeX, 0, featureSizeZ, featureSizeX, 1, featureSizeZ, ModBlocks.concrete_pillar, Blocks.air, false); //Right Wall Pt. 2 - this.fillWithRandomizedBlocks(world, box, featureSizeX, 0, 6, featureSizeX, 0, featureSizeZ - 1, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, featureSizeX, 1, 6, featureSizeX, 1, featureSizeZ - 3, false, rand, RandomConcreteBricks); - this.fillWithBlocks(world, box, 0, 0, featureSizeZ, 0, 0, featureSizeZ, ModBlocks.concrete_pillar, Blocks.air, false); //Front Wall - this.fillWithRandomizedBlocks(world, box, 1, 0, featureSizeZ, 1, 0, featureSizeZ, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 6, 0, featureSizeZ, 7, 0, featureSizeZ, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, featureSizeX - 1, 0, featureSizeZ, featureSizeX - 1, 0, featureSizeZ, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 0, 0, 1, 0, 0, featureSizeZ - 1, false, rand, RandomConcreteBricks); //Left Wall - this.fillWithRandomizedBlocks(world, box, 0, 1, 1, 0, 1, 1, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 0, 1, 4, 0, 1, 7, false, rand, RandomConcreteBricks); - - this.randomlyFillWithBlocks(world, box, rand, 0.05F, 1, 0, 1, 4, 0, 5, Blocks.gravel, Blocks.air, false); - this.randomlyFillWithBlocks(world, box, rand, 0.05F, 1, 0, 6, featureSizeX - 1, 0, featureSizeZ - 1, Blocks.gravel, Blocks.air, false); - - return true; - } -} - - /*Worrying: StructureStart checks for not addComponentParts to remove structure components from iterator, but here successful builds return true. - may be issue with multiple components.*/ - abstract static class Feature extends StructureComponent { - /** The size of the bounding box for this feature in the X axis */ - protected int featureSizeX; - /** The size of the bounding box for this feature in the Y axis */ - protected int featureSizeY; - /** The size of the bounding box for this feature in the Z axis */ - protected int featureSizeZ; - /** Average height? */ - protected int hpos = -1; - - - protected Feature() { - super(0); - } - - protected Feature(Random rand, int minX, int minY, int minZ, int maxX, int maxY, int maxZ ) { - super(0); - this.featureSizeX = maxX; - this.featureSizeY = maxY; - this.featureSizeZ = maxZ; - this.coordBaseMode = rand.nextInt(4); - - switch(this.coordBaseMode) { - case 0: - this.boundingBox = new StructureBoundingBox(minX, minY, minZ, minX + maxX, minY + maxY, minZ + maxZ); - break; - case 1: - this.boundingBox = new StructureBoundingBox(minX, minY, minZ, minX + maxZ, minY + maxY, minZ + maxX); - break; - case 2: - //North (2) and East (3) will result in mirrored structures. Not an issue, but keep in mind. - this.boundingBox = new StructureBoundingBox(minX, minY, minZ, minX + maxX, minY + maxY, minZ + maxZ); - break; - case 3: - this.boundingBox = new StructureBoundingBox(minX, minY, minZ, minX + maxX, minY + maxY, minZ + maxZ); - break; - default: - this.boundingBox = new StructureBoundingBox(minX, minY, minZ, minX + maxX, minY + maxY, minZ + maxZ); - - } - } - - /** Set to NBT */ - protected void func_143012_a(NBTTagCompound nbt) { - nbt.setInteger("Width", this.featureSizeX); - nbt.setInteger("Height", this.featureSizeY); - nbt.setInteger("Depth", this.featureSizeZ); - nbt.setInteger("HPos", this.hpos); - } - - /** Get from NBT */ - protected void func_143011_b(NBTTagCompound nbt) { - this.featureSizeX = nbt.getInteger("Width"); - this.featureSizeY = nbt.getInteger("Height"); - this.featureSizeZ = nbt.getInteger("Depth"); - this.hpos = nbt.getInteger("HPos"); - } - - protected boolean setAverageHeight(World world, StructureBoundingBox box, int y) { - - int j = 0; - int k = 0; - - for(int l = this.boundingBox.minZ; l <= this.boundingBox.maxZ; l++) { - for(int i = this.boundingBox.minX; i <= this.boundingBox.maxX; i++) { - if(box.isVecInside(i, y, l)) { - j += Math.max(world.getTopSolidOrLiquidBlock(i, l), world.provider.getAverageGroundLevel()); - k++; - } - } - } - - if(k == 0) - return false; - - this.hpos = j / k; - this.boundingBox.offset(0, this.hpos - this.boundingBox.minY, 0); - return true; - } - - /** - * Gets metadata for rotatable pillars. - * @param metadata (First two digits are equal to block metadata, other two are equal to orientation - * @return metadata adjusted for random orientation - */ - protected int getPillarMeta(int metadata) { - int blockMeta = metadata & 3; - int rotationMeta = metadata >> 2; - - if(rotationMeta == 0) - return metadata; - - if(this.coordBaseMode == 0 || this.coordBaseMode == 2) { //North & South - switch(rotationMeta) { - case 1: - rotationMeta = 4; - break; - case 2: - rotationMeta = 8; - break; - } - } else if(this.coordBaseMode == 1 || this.coordBaseMode == 3) { //East & West - switch(rotationMeta) { - case 1: - rotationMeta = 8; - break; - case 2: - rotationMeta = 4; - break; - } - } - - return blockMeta | rotationMeta; - } - - /** - * Gets metadata for rotatable DecoBlock - * @param metadata (2 for facing South, 3 for facing North, 4 for facing East, 5 for facing West - * @return metadata adjusted for random orientation - */ - protected int getDecoMeta(int metadata) { - switch(this.coordBaseMode) { - case 0: //South - switch(metadata) { - case 2: - return 2; - case 3: - return 3; - case 4: - return 4; - case 5: - return 5; - } - case 1: //West - switch(metadata) { - case 2: - return 5; - case 3: - return 4; - case 4: - return 2; - case 5: - return 3; - } - case 2: //North - switch(metadata) { - case 2: - return 3; - case 3: - return 2; - case 4: - return 4; - case 5: - return 5; - } - case 3: //East - switch(metadata) { - case 2: - return 4; - case 3: - return 5; - case 4: - return 2; - case 5: - return 3; - } - } - return 0; - } - - //TODO: Make a lot of these orientation/rotation methods much more transparent about what - //direction they will actually face - - /** - * Places door at specified location with orientation-adjusted meta - * don't ask me which directions are what - */ - protected void placeDoor(World world, StructureBoundingBox box, Block door, int direction, int featureX, int featureY, int featureZ) { - int meta = getMetadataWithOffset(Blocks.wooden_door, direction); - int posX = this.getXWithOffset(featureX, featureZ); - int posY = this.getYWithOffset(featureY); - int posZ = this.getZWithOffset(featureX, featureZ); - - this.placeBlockAtCurrentPosition(world, door, meta, featureX, featureY, featureZ, box); - ItemDoor.placeDoorBlock(world, posX, posY, posZ, meta, door); - } - - /** - * Places random bobblehead with a randomized orientation at specified location - */ - protected void placeRandomBobble(World world, StructureBoundingBox box, Random rand, int featureX, int featureY, int featureZ) { - int posX = this.getXWithOffset(featureX, featureZ); - int posY = this.getYWithOffset(featureY); - int posZ = this.getZWithOffset(featureX, featureZ); - - placeBlockAtCurrentPosition(world, ModBlocks.bobblehead, rand.nextInt(16), featureX, featureY, featureZ, box); - TileEntityBobble bobble = (TileEntityBobble) world.getTileEntity(posX, posY, posZ); - - if(bobble != null) { - bobble.type = BobbleType.values()[rand.nextInt(BobbleType.values().length - 1) + 1]; - bobble.markDirty(); - } - } - - /** - * it feels disgusting to make a method with this many parameters but fuck it, it's easier - * @return iron crate with generated content - */ - protected boolean generateIronCrateContents(World world, StructureBoundingBox box, Random rand, int featureX, int featureY, int featureZ, WeightedRandomChestContent[] content, int amount) { - int posX = this.getXWithOffset(featureX, featureZ); - int posY = this.getYWithOffset(featureY); - int posZ = this.getZWithOffset(featureX, featureZ); - - this.placeBlockAtCurrentPosition(world, ModBlocks.crate_iron, 0, featureX, featureY, featureZ, box); - TileEntityCrateIron crate = (TileEntityCrateIron)world.getTileEntity(posX, posY, posZ); - - if(crate != null) { - WeightedRandomChestContent.generateChestContents(rand, content, crate, amount); - return true; - } - - return false; - } - - @Override - protected void func_151554_b(World world, Block placeBlock, int meta, int featureX, int featureY, int featureZ, StructureBoundingBox box) { - int posX = this.getXWithOffset(featureX, featureZ); - int posY = this.getYWithOffset(featureY); - int posZ = this.getZWithOffset(featureX, featureZ); - - if(box.isVecInside(posX, posY, posZ)) { - Block block = world.getBlock(posX, posY, posZ); - - while ((world.isAirBlock(posX, posY, posZ) || !block.getMaterial().isSolid() || (block.isFoliage(world, posX, posY, posZ) || block.getMaterial() == Material.leaves)) && posY > 1) { - world.setBlock(posX, posY, posZ, placeBlock, meta, 2); - block = world.getBlock(posX, --posY, posZ); - } - } - } - - /** - * Places specified blocks on top of pre-existing blocks in a given area, up to a certain height. Does NOT place blocks on top of liquids. - * Useful for stuff like fences and walls most likely. - */ - protected void placeBlocksOnTop(World world, StructureBoundingBox box, Block block, int minX, int minZ, int maxX, int maxZ, int height) { - - for(int x = minX; x <= maxX; x++) { - for(int z = minZ; z <= maxZ; z++) { - int posX = this.getXWithOffset(x, z); - int posZ = this.getZWithOffset(x, z); - int topHeight = world.getTopSolidOrLiquidBlock(posX, posZ); - - if(!world.getBlock(posX, topHeight, posZ).getMaterial().isLiquid()) { - - for(int i = 0; i < height; i++) { - int posY = topHeight + i; - - world.setBlock(posX, posY, posZ, block, 0, 2); - } - } - } - } - } - - } - - //Block Selectors - - static class Sandstone extends StructureComponent.BlockSelector { - - Sandstone() { } - - /** Selects blocks */ - @Override - public void selectBlocks(Random rand, int posX, int posY, int posZ, boolean p_75062_5_) { - float chance = rand.nextFloat(); - - if(chance > 0.6F) { - this.field_151562_a = Blocks.sandstone; - } else if (chance < 0.5F ) { - this.field_151562_a = ModBlocks.reinforced_sand; - } else { - this.field_151562_a = Blocks.sand; - } - } - } - - static class ConcreteBricks extends StructureComponent.BlockSelector { - - ConcreteBricks() { } - - /** Selects blocks */ - @Override - public void selectBlocks(Random rand, int posX, int posY, int posZ, boolean p_75062_5_) { - float chance = rand.nextFloat(); - - if(chance < 0.2F) { - this.field_151562_a = ModBlocks.brick_concrete; - } else if (chance < 0.55F) { - this.field_151562_a = ModBlocks.brick_concrete_mossy; - } else if (chance < 0.75F) { - this.field_151562_a = ModBlocks.brick_concrete_cracked; - } else { - this.field_151562_a = ModBlocks.brick_concrete_broken; - } - } - } - - //ag - static class LabTiles extends StructureComponent.BlockSelector { - - LabTiles() { } - - /** Selects blocks */ - @Override - public void selectBlocks(Random rand, int posX, int posY, int posZ, boolean p_75062_5_) { - float chance = rand.nextFloat(); - - if(chance < 0.5F) { - this.field_151562_a = ModBlocks.tile_lab; - } else if (chance < 0.9F) { - this.field_151562_a = ModBlocks.tile_lab_cracked; - } else { - this.field_151562_a = ModBlocks.tile_lab_broken; - } - } - } - - static class SuperConcrete extends StructureComponent.BlockSelector { - - SuperConcrete() { - this.field_151562_a = ModBlocks.concrete_super; - } - - /** Selects blocks */ - @Override - public void selectBlocks(Random rand, int posX, int posY, int posZ, boolean p_75062_5_) { - this.selectedBlockMetaData = rand.nextInt(6) + 10; - } - } -} diff --git a/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java b/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java index 666f892a3..59fe2c35c 100644 --- a/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java +++ b/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java @@ -7,7 +7,11 @@ import java.util.List; import java.util.Random; import com.hbm.config.GeneralConfig; +import com.hbm.config.StructureConfig; +import com.hbm.world.worldgen.components.CivilianFeatures.*; import com.hbm.world.worldgen.components.MilitaryBaseFeatures; +import com.hbm.world.worldgen.components.MilitaryBaseFeatures.*; +import com.hbm.world.worldgen.components.RuinFeatures.*; import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase; @@ -28,8 +32,8 @@ public class MapGenNTMFeatures extends MapGenStructure { private int minDistanceBetweenScatteredFeatures; public MapGenNTMFeatures() { - this.maxDistanceBetweenScatteredFeatures = 24; - this.minDistanceBetweenScatteredFeatures = 8; + this.maxDistanceBetweenScatteredFeatures = StructureConfig.structureMaxChunks; + this.minDistanceBetweenScatteredFeatures = StructureConfig.structureMinChunks; } /** String ID for this MapGen */ @@ -107,43 +111,43 @@ public class MapGenNTMFeatures extends MapGenStructure { if(rand.nextBoolean()) { //Empty Ruin Structures switch(rand.nextInt(4)) { case 0: - ComponentNTMFeatures.NTMRuin1 ruin1 = new ComponentNTMFeatures.NTMRuin1(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); + NTMRuin1 ruin1 = new NTMRuin1(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); this.components.add(ruin1); break; case 1: - ComponentNTMFeatures.NTMRuin2 ruin2 = new ComponentNTMFeatures.NTMRuin2(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); + NTMRuin2 ruin2 = new NTMRuin2(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); this.components.add(ruin2); break; case 2: - ComponentNTMFeatures.NTMRuin3 ruin3 = new ComponentNTMFeatures.NTMRuin3(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); + NTMRuin3 ruin3 = new NTMRuin3(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); this.components.add(ruin3); break; case 3: - ComponentNTMFeatures.NTMRuin4 ruin4 = new ComponentNTMFeatures.NTMRuin4(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); + NTMRuin4 ruin4 = new NTMRuin4(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); this.components.add(ruin4); } } else if(biome.temperature >= 1.0 && biome.rainfall == 0 && !(biome instanceof BiomeGenMesa)) { //Desert & Savannah if(rand.nextBoolean()) { - ComponentNTMFeatures.NTMHouse1 house1 = new ComponentNTMFeatures.NTMHouse1(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); + NTMHouse1 house1 = new NTMHouse1(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); this.components.add(house1); } else { - ComponentNTMFeatures.NTMHouse2 house2 = new ComponentNTMFeatures.NTMHouse2(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); + NTMHouse2 house2 = new NTMHouse2(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); this.components.add(house2); } } else if(biome.temperature >= 0.25 && biome.temperature <= 0.3 && biome.rainfall >= 0.6 && biome.rainfall <= 0.9) { //Taiga & Mega Taiga if(rand.nextBoolean()) { - ComponentNTMFeatures.NTMWorkshop1 workshop1 = new ComponentNTMFeatures.NTMWorkshop1(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); + NTMWorkshop1 workshop1 = new NTMWorkshop1(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); this.components.add(workshop1); } } else if(biome.heightVariation <= 0.2 && biome.rainfall <= 0.5 && !(biome instanceof BiomeGenBeach) && rand.nextBoolean()) { MilitaryBaseFeatures.smallHelipad(components, chunkX, posY, chunkZ, rand); //agggggggg } else { //Everything else if(rand.nextBoolean()) { - ComponentNTMFeatures.NTMLab2 lab2 = new ComponentNTMFeatures.NTMLab2(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); + NTMLab2 lab2 = new NTMLab2(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); this.components.add(lab2); } else { - ComponentNTMFeatures.NTMLab1 lab1 = new ComponentNTMFeatures.NTMLab1(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); + NTMLab1 lab1 = new NTMLab1(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); this.components.add(lab1); } } diff --git a/src/main/java/com/hbm/world/worldgen/NTMWorldGenerator.java b/src/main/java/com/hbm/world/worldgen/NTMWorldGenerator.java index 1205d04ac..01c7b7acc 100644 --- a/src/main/java/com/hbm/world/worldgen/NTMWorldGenerator.java +++ b/src/main/java/com/hbm/world/worldgen/NTMWorldGenerator.java @@ -2,7 +2,7 @@ package com.hbm.world.worldgen; import java.util.Random; -import com.hbm.config.GeneralConfig; +import com.hbm.config.StructureConfig; import cpw.mods.fml.common.IWorldGenerator; import net.minecraft.block.Block; @@ -39,12 +39,12 @@ public class NTMWorldGenerator implements IWorldGenerator { //WorldConfig.enableStructures /** Spawns structure starts. Utilizes canSpawnStructureAtCoords() + if else checks in Start constructor */ - if(GeneralConfig.enableDungeons) { + if(StructureConfig.enableStructures) { this.NTMFeatureGenerator.func_151539_a(chunkGenerator, world, chunkX, chunkZ, ablock); } /** Actually generates structures in a given chunk. */ - if(GeneralConfig.enableDungeons) { + if(StructureConfig.enableStructures) { this.NTMFeatureGenerator.generateStructuresInChunk(world, rand, chunkX, chunkZ); } } diff --git a/src/main/java/com/hbm/world/worldgen/components/CivilianFeatures.java b/src/main/java/com/hbm/world/worldgen/components/CivilianFeatures.java new file mode 100644 index 000000000..88b2e9d9c --- /dev/null +++ b/src/main/java/com/hbm/world/worldgen/components/CivilianFeatures.java @@ -0,0 +1,761 @@ +package com.hbm.world.worldgen.components; + +import java.util.Random; + +import com.hbm.blocks.ModBlocks; +import com.hbm.blocks.generic.BlockBobble.BobbleType; +import com.hbm.blocks.generic.BlockBobble.TileEntityBobble; +import com.hbm.lib.HbmChestContents; +import com.hbm.util.LootGenerator; + +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemDoor; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.World; +import net.minecraft.world.gen.structure.StructureBoundingBox; + +/* Described as "Civilian", as that's the overarching connection between all of these structures. Unlike the ruins, there's not enough to + * compartmentalize even further. Just in general many of the structures I consider lower-quality (except for the sandstone houses; those are actually pretty nice). + */ +public class CivilianFeatures { + + /** Sandstone Ruin 1 */ + public static class NTMHouse1 extends Feature { + + private boolean hasPlacedChest; + + private static Sandstone RandomSandstone = new Sandstone(); + + public NTMHouse1() { + super(); + } + + /** Constructor for this feature; takes coordinates for bounding box */ + public NTMHouse1(Random rand, int minX, int minY, int minZ) { + super(rand, minX, minY, minZ, 9, 4, 6); + this.hasPlacedChest = false; + } + + @Override + protected void func_143012_a(NBTTagCompound nbt) { + super.func_143012_a(nbt); + nbt.setBoolean("hasChest", this.hasPlacedChest); + } + + @Override + protected void func_143011_b(NBTTagCompound nbt) { + super.func_143011_b(nbt); + this.hasPlacedChest = nbt.getBoolean("hasChest"); + } + + /** + * Generates structures. + */ + @Override + public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { + /* + * Places block at current position. Dependent on coordinate mode, i.e. will allow for random rotation, so use this instead of setBlock! + * this.placeBlockAtCurrentPosition(world, block, minX, metadata, x, y, z, box); + * Fills an area with air, self-explanatory. Use to clear interiors of unwanted blocks. + * this.fillWithAir(world, box, minX, minY, minZ, maxX, maxY, maxZ); + * Fills an area with blocks, self-explanatory. + * this.fillWithBlocks(world, box, minX, minY, minZ, maxX, maxY, maxZ, blockToPlace, blockToReplace, alwaysReplace); + * Fills an area with metadata blocks, self-explanatory. + * this.fillWithMetadataBlocks(world, box, minX, minY, minZ, maxX, maxY, maxZ, blockToPlace, blockPlaceMeta, blockToReplace, replaceBlockMeta, alwaysReplace); + * Fills an area with randomized blocks, self-explanatory. + * this.fillWithRandomizedBlocks(world, box, minX, minY, minZ, maxX, maxY, maxZ, alwaysReplace, rand, StructureComponent.blockSelector); + * (BlockSelector is basically a list of blocks that can be randomly picked, except that it can actually be weighted) + * Replaces any air or water blocks with this block down. Useful for foundations + * this.func_151554_b(world, block, metadata, x, startAtY, z, box + * Fills an area with blocks randomly - look into randLimit? + * this.randomlyFillWithBlocks(world, box, rand, randLimit, minX, minY, minZ, maxX, maxY, maxZ, blockToPlace, blockToReplace, alwaysReplace); + */ + + //System.out.println(this.coordBaseMode); + if(!this.setAverageHeight(world, box, this.boundingBox.minY)) { + return false; + } + //System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); + + for(byte i = 0; i < this.sizeX + 1; i++) { + for(byte j = 0; j < this.sizeZ + 1; j++) { + this.func_151554_b(world, Blocks.sandstone, 0, i, -1, j, box); + } + } + + //Walls + this.fillWithRandomizedBlocks(world, box, 0, 0, 0, sizeX, 0, 0, false, rand, RandomSandstone); //Back Wall + this.fillWithRandomizedBlocks(world, box, 0, 1, 0, 1, 1, 0, false, rand, RandomSandstone); + this.placeBlockAtCurrentPosition(world, Blocks.fence, 0, 2, 1, 0, box); + this.fillWithRandomizedBlocks(world, box, 3, 1, 0, 5, 1, 0, false, rand, RandomSandstone); + this.placeBlockAtCurrentPosition(world, Blocks.fence, 0, 6, 1, 0, box); + this.placeBlockAtCurrentPosition(world, Blocks.fence, 0, 7, 1, 0, box); + this.fillWithRandomizedBlocks(world, box, sizeX - 1, 1, 0, sizeX, 1, 0, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, 0, 2, 0, sizeX - 2, 2, 0, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, 0, 0, 0, 0, 1, sizeZ, false, rand, RandomSandstone); //Left Wall + this.placeBlockAtCurrentPosition(world, Blocks.stone_slab, 1, 0, 2, 1, box); + this.fillWithMetadataBlocks(world, box, 0, 2, 3, 0, 2, sizeZ, Blocks.stone_slab, 1, Blocks.air, 0, false); + this.fillWithRandomizedBlocks(world, box, 1, 0, sizeZ, 1, 1, sizeZ, false, rand, RandomSandstone); //Front Wall + this.fillWithRandomizedBlocks(world, box, 3, 0, sizeZ, sizeX, 1, sizeZ, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, 1, 2, sizeZ, 3, 2, sizeZ, false, rand, RandomSandstone); + this.fillWithMetadataBlocks(world, box, 4, 2, sizeZ, 5, 2, sizeZ, Blocks.stone_slab, 1, Blocks.air, 0, false); + this.placeBlockAtCurrentPosition(world, Blocks.stone_slab, 1, sizeX - 2, 2, sizeZ, box); + this.fillWithRandomizedBlocks(world, box, sizeX, 0, 0, sizeX, 0, sizeZ, false, rand, RandomSandstone); //Right Wall + this.randomlyFillWithBlocks(world, box, rand, 0.65F, sizeX, 1, 1, sizeX, 1, sizeZ - 1, Blocks.sand, Blocks.air, false); + + this.fillWithRandomizedBlocks(world, box, 4, 0, 1, 4, 1, 3, false, rand, RandomSandstone); + this.placeBlockAtCurrentPosition(world, ModBlocks.reinforced_sand, 0, 4, 0, 4, box); + + //Loot/Sand + this.placeBlockAtCurrentPosition(world, ModBlocks.crate_weapon, 0, 1, 0, 1, box); + if(!this.hasPlacedChest) + this.hasPlacedChest = this.generateStructureChestContents(world, box, rand, 3, 0, 1, HbmChestContents.modGeneric, rand.nextInt(2) + 8); + this.fillWithBlocks(world, box, 5, 0, 1, 6, 0, 1, ModBlocks.crate, Blocks.air, false); + this.placeBlockAtCurrentPosition(world, Blocks.sand, 0, 7, 0, 1, box); + if(rand.nextFloat() <= 0.25) + this.placeBlockAtCurrentPosition(world, ModBlocks.crate_metal, 0, sizeX - 1, 0, 1, box); + this.randomlyFillWithBlocks(world, box, rand, 0.25F, 1, 0, 2, 3, 0, sizeZ - 1, Blocks.sand, Blocks.air, false); + this.randomlyFillWithBlocks(world, box, rand, 0.25F, 5, 0, 2, sizeX - 1, 0, sizeZ - 1, Blocks.sand, Blocks.air, false); + + return true; + } + + } + + public static class NTMHouse2 extends Feature { + + private static Sandstone RandomSandstone = new Sandstone(); + + private boolean[] hasPlacedLoot = new boolean[2]; + + public NTMHouse2() { + super(); + } + + public NTMHouse2(Random rand, int minX, int minY, int minZ) { + super(rand, minX, minY, minZ, 15, 5, 9); + this.hasPlacedLoot[0] = false; + this.hasPlacedLoot[1] = false; + } + + @Override + protected void func_143012_a(NBTTagCompound nbt) { + super.func_143012_a(nbt); + nbt.setBoolean("hasLoot1", this.hasPlacedLoot[0]); + nbt.setBoolean("hasLoot2", this.hasPlacedLoot[1]); + } + + @Override + protected void func_143011_b(NBTTagCompound nbt) { + super.func_143011_b(nbt); + this.hasPlacedLoot[0] = nbt.getBoolean("hasLoot1"); + this.hasPlacedLoot[1] = nbt.getBoolean("hasLoot2"); + } + + @Override + public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { + + //System.out.print(this.coordBaseMode); + if(!this.setAverageHeight(world, box, this.boundingBox.minY)) { + return false; + } + //System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); + + for(byte i = 0; i < 7; i++) { + for(byte j = 0; j < this.sizeZ + 1; j++) { + this.func_151554_b(world, Blocks.sandstone, 0, i, -1, j, box); + } + } + + for(byte i = 9; i < this.sizeX + 1; i++) { + for(byte j = 0; j < this.sizeZ + 1; j++) { + this.func_151554_b(world, Blocks.sandstone, 0, i, -1, j, box); + } + } + + this.fillWithAir(world, box, 1, 0, 1, 5, sizeY, sizeZ - 1); + + //House 1 + this.fillWithRandomizedBlocks(world, box, 0, 0, 0, 6, 1, 0, false, rand, RandomSandstone); //Back Wall + this.fillWithRandomizedBlocks(world, box, 0, 2, 0, 1, 2, 0, false, rand, RandomSandstone); + this.placeBlockAtCurrentPosition(world, Blocks.fence, 0, 2, 2, 0, box); + this.fillWithRandomizedBlocks(world, box, 3, 2, 0, 3, 2, 0, false, rand, RandomSandstone); + this.placeBlockAtCurrentPosition(world, Blocks.fence, 0, 4, 2, 0, box); + this.fillWithRandomizedBlocks(world, box, 5, 2, 0, 6, 2, 0, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, 0, 3, 0, 6, 3, 0, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, 0, 0, 1, 0, 3, sizeZ, false, rand, RandomSandstone); //Left Wall + this.fillWithRandomizedBlocks(world, box, 1, 0, sizeZ, 6, 1, sizeZ, false, rand, RandomSandstone); //Front Wall + this.fillWithRandomizedBlocks(world, box, 1, 2, sizeZ, 1, 2, sizeZ, false, rand, RandomSandstone); + this.fillWithBlocks(world, box, 2, 2, sizeZ, 4, 2, sizeZ, Blocks.fence, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 5, 2, sizeZ, 6, 2, sizeZ, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, 1, 3, sizeZ, 6, 3, sizeZ, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, 6, 0, sizeZ - 1, 6, 3, sizeZ - 1, false, rand, RandomSandstone); //Right Wall + this.fillWithRandomizedBlocks(world, box, 6, 0, sizeZ - 2, 6, 0, sizeZ - 2, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, 6, 3, sizeZ - 2, 6, 3, sizeZ - 2, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, 6, 0, 1, 6, 3, sizeZ - 3, false, rand, RandomSandstone); + + this.fillWithBlocks(world, box, 1, 0, 1, 5, 0, sizeZ - 1, Blocks.sandstone, Blocks.air, false); //Floor + //this.fillWithRandomizedBlocks(world, box, 1, sizeY - 1, 0, 5, sizeY - 1, sizeZ, false, rand, RandomSandstone); //Ceiling + this.fillWithBlocks(world, box, 1, sizeY - 1, 0, 5, sizeY - 1, sizeZ, Blocks.sandstone, Blocks.air, false); + this.fillWithMetadataBlocks(world, box, 0, sizeY - 1, 0, 0, sizeY - 1, sizeZ, Blocks.stone_slab, 1, Blocks.air, 0, false); //Roof + this.fillWithMetadataBlocks(world, box, 6, sizeY - 1, 0, 6, sizeY - 1, sizeZ, Blocks.stone_slab, 1, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, 2, sizeY, 0, 4, sizeY, 0, Blocks.stone_slab, 1, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, 3, sizeY, 1, 3, sizeY, 2, Blocks.stone_slab, 1, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, 3, sizeY, 4, 3, sizeY, 6, Blocks.stone_slab, 1, Blocks.air, 0, false); + this.placeBlockAtCurrentPosition(world, Blocks.stone_slab, 1, 3, sizeY, sizeZ - 1, box); + this.fillWithMetadataBlocks(world, box, 2, sizeY, sizeZ, 4, sizeY, sizeZ, Blocks.stone_slab, 1, Blocks.air, 0, false); + + //House 2 + this.fillWithRandomizedBlocks(world, box, sizeX - 6, 0, 0, sizeX, 0, 0, false, rand, RandomSandstone); //Back Wall + this.fillWithRandomizedBlocks(world, box, sizeX - 6, 1, 0, sizeX - 2, 1, 0, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, sizeX - 6, 2, 0, sizeX - 6, 2, 0, false, rand, RandomSandstone); + this.placeBlockAtCurrentPosition(world, Blocks.stone_slab, 1, sizeX - 6, 2, 0, box); + this.placeBlockAtCurrentPosition(world, Blocks.stone_slab, 1, sizeX - 3, 2, 0, box); + this.fillWithRandomizedBlocks(world, box, sizeX - 6, 0, 1, sizeX - 6, 3, 1, false, rand, RandomSandstone); //Left Wall + this.fillWithRandomizedBlocks(world, box, sizeX - 6, 0, 2, sizeX - 6, 0, 2, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, sizeX - 6, 3, 2, sizeX - 6, 3, sizeZ - 1, false, rand, RandomSandstone); + this.placeBlockAtCurrentPosition(world, Blocks.stone_slab, 1, sizeX - 6, sizeY - 1, 2, box); + this.fillWithMetadataBlocks(world, box, sizeX - 6, sizeY - 1, 4, sizeX - 6, sizeY - 1, sizeZ - 2, Blocks.stone_slab, 1, Blocks.air, 0, false); + this.fillWithRandomizedBlocks(world, box, sizeX - 6, 0, 3, sizeX - 6, 1, sizeZ, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, sizeX - 6, 0, 2, sizeX - 6, 0, 2, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, sizeX - 6, 2, 3, sizeX - 6, 2, 3, false, rand, RandomSandstone); + this.placeBlockAtCurrentPosition(world, Blocks.fence, 0, sizeX - 6, 2, 4, box); + this.fillWithRandomizedBlocks(world, box, sizeX - 6, 2, 5, sizeX - 6, 2, 5, false, rand, RandomSandstone); + this.fillWithBlocks(world, box, sizeX - 6, 2, sizeZ - 3, sizeX - 6, 2, sizeZ - 2, Blocks.fence, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, sizeX - 6, 2, sizeZ - 1, sizeX - 6, 2, sizeZ, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, sizeX - 5, 0, sizeZ, sizeX, 1, sizeZ, false, rand, RandomSandstone); //Front Wall + this.fillWithRandomizedBlocks(world, box, sizeX - 5, 2, sizeZ, sizeX - 5, 2, sizeZ, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, sizeX - 1, 2, sizeZ, sizeX, 2, sizeZ, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, sizeX, 0, 1, sizeX, 0, sizeZ - 1, false, rand, RandomSandstone); //Right Wall + this.fillWithRandomizedBlocks(world, box, sizeX, 1, 3, sizeX, 1, 3, false, rand, RandomSandstone); + this.fillWithMetadataBlocks(world, box, sizeX, 1, 4, sizeX, 1, 5, Blocks.stone_slab, 1, Blocks.air, 0, false); + this.fillWithRandomizedBlocks(world, box, sizeX, 1, sizeZ - 1, sizeX, 1, sizeZ - 3, false, rand, RandomSandstone); + this.placeBlockAtCurrentPosition(world, Blocks.stone_slab, 1, sizeX, 1, sizeZ - 1, box); + + this.fillWithBlocks(world, box, sizeX - 5, 0, 1, sizeX - 1, 0, sizeZ - 1, Blocks.sandstone, Blocks.air, false); //Floor + + //Loot & Decorations + //House 1 + int eastMeta = this.getDecoMeta(4); + this.placeBlockAtCurrentPosition(world, ModBlocks.machine_boiler_off, 4, 1, 1, 1, box); + this.fillWithBlocks(world, box, 1, 2, 1, 1, 3, 1, ModBlocks.deco_pipe_quad_rusted, Blocks.air, false); + this.placeBlockAtCurrentPosition(world, ModBlocks.deco_pipe_rim_rusted, 0, 1, sizeY, 1, box); + this.placeBlockAtCurrentPosition(world, ModBlocks.crate, 0, 2, 1, 3, box); + this.placeBlockAtCurrentPosition(world, ModBlocks.crate_can, 0, 1, 1, sizeZ - 4, box); + if(!hasPlacedLoot[0]) { + this.placeBlockAtCurrentPosition(world, Blocks.chest, this.getMetadataWithOffset(Blocks.chest, 3), 1, 1, sizeZ - 2, box); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.machineParts, (TileEntityChest)world.getTileEntity(this.getXWithOffset(1, sizeZ - 2), + this.getYWithOffset(1), this.getZWithOffset(1, sizeZ - 2)), 10); + this.hasPlacedLoot[0] = true; + } + this.fillWithBlocks(world, box, 4, 1, sizeZ - 1, 5, 1, sizeZ - 1, ModBlocks.crate, Blocks.air, false); + this.fillWithMetadataBlocks(world, box, 5, 1, 4, 5, 3, 4, ModBlocks.steel_scaffold, eastMeta, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, 5, 1, 6, 5, 3, 6, ModBlocks.steel_scaffold, eastMeta, Blocks.air, 0, false); + this.placeBlockAtCurrentPosition(world, ModBlocks.steel_grate, 7, 5, 1, 5, box); + this.placeBlockAtCurrentPosition(world, ModBlocks.crate_weapon, 0, 5, 2, 5, box); + + //House 2 + if(!hasPlacedLoot[1]) { + this.placeBlockAtCurrentPosition(world, Blocks.chest, this.getMetadataWithOffset(Blocks.chest, 3), sizeX - 5, 1, 1, box); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.antenna, (TileEntityChest)world.getTileEntity(this.getXWithOffset(sizeX - 5, 1), + this.getYWithOffset(1), this.getZWithOffset(sizeX - 5, 1)), 10); + this.hasPlacedLoot[1] = true; + } + this.placeBlockAtCurrentPosition(world, ModBlocks.bobblehead, rand.nextInt(16), sizeX - 5, 1, 4, box); + TileEntityBobble bobble = (TileEntityBobble) world.getTileEntity(this.getXWithOffset(sizeX - 5, 4), this.getYWithOffset(1), this.getZWithOffset(sizeX - 5, 4)); + + if(bobble != null) { + bobble.type = BobbleType.values()[rand.nextInt(BobbleType.values().length - 1) + 1]; + bobble.markDirty(); + } + + this.randomlyFillWithBlocks(world, box, rand, 0.25F, sizeX - 4, 1, 1, sizeX - 1, 1, sizeZ - 1, Blocks.sand, Blocks.air, false); + + return true; + } + } + + public static class NTMLab1 extends Feature { + + private static ConcreteBricks RandomConcreteBricks = new ConcreteBricks(); + private static LabTiles RandomLabTiles = new LabTiles(); + + private boolean[] hasPlacedLoot = new boolean[2]; + + public NTMLab1() { + super(); + } + + /** Constructor for this feature; takes coordinates for bounding box */ + public NTMLab1(Random rand, int minX, int minY, int minZ) { + super(rand, minX, minY, minZ, 9, 4, 7); + this.hasPlacedLoot[0] = false; + this.hasPlacedLoot[1] = false; + } + + @Override + protected void func_143012_a(NBTTagCompound nbt) { + super.func_143012_a(nbt); + nbt.setBoolean("hasLoot1", this.hasPlacedLoot[0]); + nbt.setBoolean("hasLoot2", this.hasPlacedLoot[1]); + } + + @Override + protected void func_143011_b(NBTTagCompound nbt) { + super.func_143011_b(nbt); + this.hasPlacedLoot[0] = nbt.getBoolean("hasLoot1"); + this.hasPlacedLoot[1] = nbt.getBoolean("hasLoot2"); + } + + @Override + public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { + + //System.out.println(this.coordBaseMode); + if(!this.setAverageHeight(world, box, this.boundingBox.minY)) { + return false; + } + //System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); + + for(byte i = 0; i < this.sizeX + 1; i++) { + for(byte j = 0; j < this.sizeZ - 1; j++) { + this.func_151554_b(world, Blocks.stonebrick, 0, i, -1, j, box); + } + } + + for(byte i = 3; i < this.sizeX + 1; i++) { + for(byte j = 6; j < this.sizeZ + 1; j++) { + this.func_151554_b(world, Blocks.stonebrick, 0, i, -1, j, box); + } + } + + int stairsMeta = this.getMetadataWithOffset(Blocks.stone_brick_stairs, 0); + if(this.getBlockAtCurrentPosition(world, 2, 0, sizeZ - 1, box).getMaterial().isReplaceable() + || this.getBlockAtCurrentPosition(world, 2, 0, sizeZ - 1, box) == Blocks.air) { + this.func_151554_b(world, Blocks.stonebrick, 0, 2, -1, sizeZ - 1, box); + this.placeBlockAtCurrentPosition(world, Blocks.stone_brick_stairs, stairsMeta, 2, 0, sizeZ - 1, box); + } + + this.fillWithAir(world, box, 1, 0, 1, sizeX - 1, sizeY, 4); + this.fillWithAir(world, box, 4, 0, 4, sizeX - 1, sizeY, sizeZ - 1); + this.fillWithAir(world, box, 3, 1, sizeZ - 1, 3, 2, sizeZ - 1); + + int pillarMeta = this.getPillarMeta(8); + + //Pillars + this.fillWithBlocks(world, box, 0, 0, 0, 0, 3, 0, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithBlocks(world, box, sizeX, 0, 0, sizeX, 3, 0, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithMetadataBlocks(world, box, 0, 0, 1, 0, 0, 4, ModBlocks.concrete_pillar, pillarMeta, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, sizeX, 0, 1, sizeX, 0, sizeZ - 1, ModBlocks.concrete_pillar, pillarMeta, Blocks.air, 0, false); + this.fillWithBlocks(world, box, 0, 0, sizeZ - 2, 0, 3, sizeZ - 2, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithBlocks(world, box, 3, 0, sizeZ - 2, 3, 3, sizeZ - 2, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithBlocks(world, box, 3, 0, sizeZ, 3, 3, sizeZ, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithBlocks(world, box, sizeX, 0, sizeZ, sizeX, 3, sizeZ, ModBlocks.concrete_pillar, Blocks.air, false); + + //Walls + this.fillWithRandomizedBlocks(world, box, 1, 0, 0, sizeX - 1, sizeY - 1, 0, false, rand, RandomConcreteBricks); //Back Wall + this.fillWithRandomizedBlocks(world, box, 0, sizeY, 0, sizeX, sizeY, 0, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 0, 1, 1, 0, sizeY - 1, 4, false, rand, RandomConcreteBricks); //Left Wall + this.fillWithRandomizedBlocks(world, box, 0, sizeY, 0, 0, sizeY, sizeZ - 2, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 1, 0, sizeZ - 2, 2, sizeY, sizeZ - 2, false, rand, RandomConcreteBricks); //Front Wall Pt. 1 + this.placeBlockAtCurrentPosition(world, ModBlocks.brick_concrete_broken, 0, 3, sizeY, sizeZ - 2, box); + this.fillWithRandomizedBlocks(world, box, 3, sizeY - 1, sizeZ - 1, 3, sizeY, sizeZ - 1, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 4, 0, sizeZ, sizeX - 1, 1, sizeZ, false, rand, RandomConcreteBricks); //Front Wall Pt. 2 + this.fillWithRandomizedBlocks(world, box, 4, 2, sizeZ, 4, 3, sizeZ, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, sizeX - 1, 2, sizeZ, sizeX - 1, 3, sizeZ, false, rand, RandomConcreteBricks); + this.randomlyFillWithBlocks(world, box, rand, 0.75F, 5, 2, sizeZ, sizeX - 2, 3, sizeZ, Blocks.glass_pane, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 3, sizeY, sizeZ, sizeX, sizeY, sizeZ, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, sizeX, 1, 1, sizeX, sizeY, sizeZ - 1, false, rand, RandomConcreteBricks); //Right Wall + + //Floor & Ceiling + this.fillWithRandomizedBlocks(world, box, 1, 0, 1, sizeX - 1, 0, 4, false, rand, RandomLabTiles); //Floor + this.fillWithRandomizedBlocks(world, box, 4, 0, sizeZ - 2, sizeX - 1, 0, sizeZ - 1, false, rand, RandomLabTiles); + this.placeBlockAtCurrentPosition(world, ModBlocks.tile_lab_cracked, 0, 3, 0, sizeZ - 1, box); + + this.fillWithBlocks(world, box, 1, sizeY - 1, 1, 1, sizeY, 4, ModBlocks.reinforced_glass, Blocks.air, false); //Ceiling + this.fillWithBlocks(world, box, 2, sizeY, 1, sizeX - 1, sizeY, 4, ModBlocks.brick_light, Blocks.air, false); + this.fillWithBlocks(world, box, 4, sizeY, sizeZ - 2, sizeX - 1, sizeY, sizeZ - 1, ModBlocks.brick_light, Blocks.air, false); + + //Decorations & Loot + this.fillWithMetadataBlocks(world, box, 1, 1, 1, 1, 1, 4, Blocks.dirt, 2, Blocks.air, 0, false); + int westDecoMeta = this.getDecoMeta(5); + this.fillWithMetadataBlocks(world, box, 2, 1, 1, 2, 1, 4, ModBlocks.steel_wall, westDecoMeta, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, 2, sizeY - 1, 1, 2, sizeY - 1, 4, ModBlocks.steel_wall, westDecoMeta, Blocks.air, 0, false); + for(byte i = 0; i < 4; i++) { + this.placeBlockAtCurrentPosition(world, ModBlocks.plant_flower, i, 1, 2, 1 + i, box); + } + + int doorMeta = this.getMetadataWithOffset(Blocks.wooden_door, 2); + this.placeBlockAtCurrentPosition(world, ModBlocks.door_office, doorMeta, 3, 1, sizeZ - 1, box); + ItemDoor.placeDoorBlock(world, this.getXWithOffset(3, sizeZ - 1), this.getYWithOffset(1), this.getZWithOffset(3, sizeZ - 1), doorMeta, ModBlocks.door_office); + + int northDecoMeta = this.getDecoMeta(3); + this.fillWithMetadataBlocks(world, box, 5, sizeY - 1, 1, sizeX - 1, sizeY - 1, 1, ModBlocks.steel_scaffold, westDecoMeta, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, 5, sizeY - 1, 2, sizeX - 1, sizeY - 1, 2, ModBlocks.steel_wall, northDecoMeta, Blocks.air, 0, false); + this.placeBlockAtCurrentPosition(world, ModBlocks.machine_electric_furnace_off, northDecoMeta, 5, 1, 1, box); + this.placeBlockAtCurrentPosition(world, ModBlocks.machine_microwave, northDecoMeta, 5, 2, 1, box); + this.placeBlockAtCurrentPosition(world, ModBlocks.deco_titanium, 0, 6, 1, 1, box); + this.placeBlockAtCurrentPosition(world, ModBlocks.machine_shredder, 0, sizeX - 2, 1, 1, box); + this.placeBlockAtCurrentPosition(world, ModBlocks.deco_titanium, 0, sizeX - 1, 1, 1, box); + this.fillWithBlocks(world, box, 5, 1, 3, sizeX - 1, 1, 3, ModBlocks.deco_titanium, Blocks.air, false); + if(!hasPlacedLoot[0]) { + this.placeBlockAtCurrentPosition(world, ModBlocks.deco_loot, 0, 6, 2, 3, box); + LootGenerator.lootMedicine(world, this.getXWithOffset(6, 3), this.getYWithOffset(2), this.getZWithOffset(6, 3)); + this.hasPlacedLoot[0] = true; + } + + this.placeBlockAtCurrentPosition(world, ModBlocks.crate_can, 0, sizeX - 1, 1, sizeZ - 2, box); + if(!hasPlacedLoot[1]) { + this.hasPlacedLoot[1] = this.generateInvContents(world, box, rand, ModBlocks.crate_iron, sizeX - 1, 1, sizeZ - 1, HbmChestContents.modGeneric, 8); + } + + return true; + } + } + + public static class NTMLab2 extends Feature { + + private static SuperConcrete RandomSuperConcrete = new SuperConcrete(); + private static ConcreteBricks RandomConcreteBricks = new ConcreteBricks(); + private static LabTiles RandomLabTiles = new LabTiles(); + + private boolean[] hasPlacedLoot = new boolean[2]; + + public NTMLab2() { + super(); + } + + public NTMLab2(Random rand, int minX, int minY, int minZ) { + super(rand, minX, minY, minZ, 12, 11, 8); + this.hasPlacedLoot[0] = false; + this.hasPlacedLoot[1] = false; + } + + @Override + protected void func_143012_a(NBTTagCompound nbt) { + super.func_143012_a(nbt); + nbt.setBoolean("hasLoot1", this.hasPlacedLoot[0]); + nbt.setBoolean("hasLoot2", this.hasPlacedLoot[1]); + } + + @Override + protected void func_143011_b(NBTTagCompound nbt) { + super.func_143011_b(nbt); + this.hasPlacedLoot[0] = nbt.getBoolean("hasLoot1"); + this.hasPlacedLoot[1] = nbt.getBoolean("hasLoot2"); + } + + @Override + public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { + + //System.out.println(this.coordBaseMode); + if(!this.setAverageHeight(world, box, this.boundingBox.minY)) { + return false; + } + this.boundingBox.offset(0, -7, 0); + //System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); + + for(byte i = 0; i < sizeX + 1; i++) { + for(byte j = 0; j < sizeZ - 1; j++) { + this.func_151554_b(world, Blocks.stonebrick, 0, i, 6, j, box); + } + } + + for(byte i = 0; i < 7; i++) { + for(byte j = 7; j < sizeZ + 1; j++) { + this.func_151554_b(world, Blocks.stonebrick, 0, i, 6, j, box); + } + } + + if(this.getBlockAtCurrentPosition(world, sizeX - 3, sizeY - 4, 7, box).getMaterial().isReplaceable() + || this.getBlockAtCurrentPosition(world, sizeX - 3, sizeY - 4, 7, box) == Blocks.air) { + int stairMeta = this.getMetadataWithOffset(Blocks.stone_brick_stairs, 2); + this.func_151554_b(world, Blocks.stonebrick, 0, sizeX - 3, sizeY - 4, 7, box); + this.func_151554_b(world, Blocks.stonebrick, 0, sizeX - 2, sizeY - 4, 7, box); + this.fillWithMetadataBlocks(world, box, sizeX - 3, sizeY - 4, 7, sizeX - 2, sizeY - 4, 7, Blocks.stone_brick_stairs, stairMeta, Blocks.air, 0, false); + } + + + this.fillWithAir(world, box, 1, sizeY - 4, 1, sizeX - 1, sizeY, sizeZ - 3); + this.fillWithAir(world, box, 1, sizeY - 4, sizeZ - 2, 5, sizeY, sizeZ - 1); + this.fillWithAir(world, box, sizeX - 3, sizeY - 3, sizeZ - 2, sizeX - 2, sizeY - 2, sizeZ - 2); + this.fillWithAir(world, box, 5, 5, 1, 6, 6, 2); + this.fillWithAir(world, box, 2, 0, 2, sizeX - 2, 3, sizeZ - 2); + + //Walls + this.fillWithRandomizedBlocks(world, box, 0, sizeY - 4, 0, sizeX, sizeY, 0, false, rand, RandomSuperConcrete); //Back Wall + this.fillWithRandomizedBlocks(world, box, 0, sizeY - 4, 0, 0, sizeY, sizeZ, false, rand, RandomSuperConcrete); //Left Wall + this.fillWithRandomizedBlocks(world, box, 1, sizeY - 4, sizeZ, 5, sizeY - 4, sizeZ, false, rand, RandomSuperConcrete); //Front Wall pt. 1 + this.fillWithBlocks(world, box, 1, sizeY - 3, sizeZ, 1, sizeY - 1, sizeZ, ModBlocks.reinforced_glass, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 2, sizeY - 4, sizeZ, 2, sizeY - 1, sizeZ, false, rand, RandomSuperConcrete); + this.fillWithBlocks(world, box, 3, sizeY - 3, sizeZ, 3, sizeY - 1, sizeZ, ModBlocks.reinforced_glass, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 4, sizeY - 4, sizeZ, 4, sizeY - 1, sizeZ, false, rand, RandomSuperConcrete); + this.fillWithBlocks(world, box, 5, sizeY - 3, sizeZ, 5, sizeY - 1, sizeZ, ModBlocks.reinforced_glass, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 1, sizeY, sizeZ, 5, sizeY, sizeZ, false, rand, RandomSuperConcrete); + this.fillWithRandomizedBlocks(world, box, 6, sizeY - 4, sizeZ - 1, 6, sizeY, sizeZ, false, rand, RandomSuperConcrete); //Front Wall pt. 2 + this.fillWithRandomizedBlocks(world, box, 6, sizeY - 4, sizeZ - 2, 7, sizeY - 2, sizeZ - 2, false, rand, RandomSuperConcrete); //Front Wall pt. 3 + this.fillWithBlocks(world, box, 6, sizeY - 1, sizeZ - 2, 7, sizeY - 1, sizeZ - 2, ModBlocks.concrete_super_broken, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, sizeX - 4, sizeY - 4, sizeZ - 2, sizeX, sizeY - 4, sizeZ - 2, false, rand, RandomSuperConcrete); + this.fillWithRandomizedBlocks(world, box, sizeX - 4, sizeY - 3, sizeZ - 2, sizeX - 4, sizeY, sizeZ - 2, false, rand, RandomSuperConcrete); + this.fillWithRandomizedBlocks(world, box, sizeX - 3, sizeY - 1, sizeZ - 2, sizeX - 2, sizeY, sizeZ - 2, false, rand, RandomSuperConcrete); + this.fillWithRandomizedBlocks(world, box, sizeX - 1, sizeY - 4, sizeZ - 2, sizeX, sizeY, sizeZ - 2, false, rand, RandomSuperConcrete); + this.fillWithRandomizedBlocks(world, box, sizeX, sizeY - 4, 1, sizeX, sizeY - 4, sizeZ - 3, false, rand, RandomSuperConcrete); //Right Wall + this.fillWithBlocks(world, box, sizeX, sizeY - 3, sizeZ - 3, sizeX, sizeY - 1, sizeZ - 3, ModBlocks.reinforced_glass, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, sizeX, sizeY - 3, 4, sizeX, sizeY - 1, 4, false, rand, RandomSuperConcrete); + this.fillWithBlocks(world, box, sizeX, sizeY - 3, 3, sizeX, sizeY - 1, 3, ModBlocks.reinforced_glass, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, sizeX, sizeY - 3, 2, sizeX, sizeY - 1, 2, false, rand, RandomSuperConcrete); + this.fillWithBlocks(world, box, sizeX, sizeY - 3, 1, sizeX, sizeY - 1, 1, ModBlocks.reinforced_glass, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, sizeX, sizeY, 1, sizeX, sizeY, sizeZ - 3, false, rand, RandomSuperConcrete); + + this.fillWithBlocks(world, box, 1, 0, 1, sizeX - 1, 3, 1, ModBlocks.reinforced_stone, Blocks.air, false); //Back Wall + this.fillWithBlocks(world, box, 1, 0, 2, 1, 3, sizeZ - 2, ModBlocks.reinforced_stone, Blocks.air, false); //Left Wall + this.fillWithBlocks(world, box, 1, 0, sizeZ - 1, sizeX - 1, 3, sizeZ - 1, ModBlocks.reinforced_stone, Blocks.air, false); //Front Wall + this.fillWithBlocks(world, box, sizeX - 1, 0, 2, sizeX - 1, 3, sizeZ - 2, ModBlocks.reinforced_stone, Blocks.air, false); // Right Wall + this.fillWithBlocks(world, box, 6, 0, 3, 6, 3, sizeZ - 2, ModBlocks.reinforced_stone, Blocks.air, false); //Internal Wall + + //Floors & Ceiling + this.fillWithRandomizedBlocks(world, box, 1, sizeY - 4, 1, 3, sizeY - 4, sizeZ - 1, false, rand, RandomLabTiles); //Left Floor + this.fillWithRandomizedBlocks(world, box, 4, sizeY - 4, sizeZ - 2, 5, sizeY - 4, sizeZ - 1, false, rand, RandomLabTiles); + this.fillWithRandomizedBlocks(world, box, sizeX - 4, sizeY - 4, 1, sizeX - 1, sizeY - 4, sizeZ - 3, false, rand, RandomLabTiles); //Right Floor + this.fillWithRandomizedBlocks(world, box, sizeX - 3, sizeY - 4, sizeZ - 2, sizeX - 2, sizeY - 4, sizeZ - 2, false, rand, RandomLabTiles); + this.fillWithBlocks(world, box, 4, sizeY - 4, 1, 7, sizeY - 4, 1, ModBlocks.tile_lab_broken, Blocks.air, false); //Center Floor (Pain) + this.placeBlockAtCurrentPosition(world, ModBlocks.tile_lab_broken, 0, 4, sizeY - 4, 2, box); + this.fillWithBlocks(world, box, 4, sizeY - 4, 3, 4, sizeY - 4, 5, ModBlocks.tile_lab_cracked, Blocks.air, false); + this.placeBlockAtCurrentPosition(world, ModBlocks.tile_lab_broken, 0, 5, sizeY - 4, 3, box); + this.fillWithBlocks(world, box, 5, sizeY - 4, 4, 5, sizeY - 4, 5, ModBlocks.tile_lab_cracked, Blocks.air, false); + this.placeBlockAtCurrentPosition(world, ModBlocks.tile_lab_broken, 0, 6, sizeY - 4, 4, box); + this.placeBlockAtCurrentPosition(world, ModBlocks.tile_lab_cracked, 0, 6, sizeY - 4, 5, box); + this.fillWithBlocks(world, box, 7, sizeY - 4, 2, 7, sizeY - 4, 3, ModBlocks.tile_lab_broken, Blocks.air, false); + this.fillWithBlocks(world, box, 7, sizeY - 4, 4, 7, sizeY - 4, 5, ModBlocks.tile_lab_cracked, Blocks.air, false); + + this.fillWithBlocks(world, box, 1, sizeY, 1, 2, sizeY, sizeZ - 1, ModBlocks.brick_light, Blocks.air, false); //Left Ceiling + this.fillWithBlocks(world, box, 3, sizeY, sizeZ - 2, 4, sizeY, sizeZ - 1, ModBlocks.brick_light, Blocks.air, false); + this.fillWithBlocks(world, box, sizeX - 3, sizeY, 1, sizeX - 1, sizeY, sizeZ - 3, ModBlocks.brick_light, Blocks.air, false); //Right Ceiling + this.fillWithBlocks(world, box, 3, sizeY, 1, 8, sizeY, 1, ModBlocks.waste_planks, Blocks.air, false); //Center Ceiling (Pain) + this.fillWithBlocks(world, box, 3, sizeY, 2, 4, sizeY, 2, ModBlocks.waste_planks, Blocks.air, false); + this.fillWithBlocks(world, box, 7, sizeY, 2, 8, sizeY, 2, ModBlocks.waste_planks, Blocks.air, false); + this.fillWithBlocks(world, box, 3, sizeY, 3, 3, sizeY, 5, ModBlocks.waste_planks, Blocks.air, false); + this.fillWithBlocks(world, box, 4, sizeY, 4, 4, sizeY, 5, ModBlocks.waste_planks, Blocks.air, false); + this.fillWithBlocks(world, box, 5, sizeY, 6, 5, sizeY, sizeZ - 1, ModBlocks.waste_planks, Blocks.air, false); + this.fillWithBlocks(world, box, 8, sizeY, 3, 8, sizeY, 5, ModBlocks.waste_planks, Blocks.air, false); + + this.fillWithRandomizedBlocks(world, box, 2, 0, 2, 5, 0, sizeZ - 2, false, rand, RandomLabTiles); //Floor + this.fillWithRandomizedBlocks(world, box, 6, 0, 2, 6, 0, 3, false, rand, RandomLabTiles); + this.fillWithRandomizedBlocks(world, box, 7, 0, 2, sizeX - 2, 0, sizeZ - 2, false, rand, RandomLabTiles); + + this.fillWithRandomizedBlocks(world, box, 1, 4, 1, sizeX - 1, 4, sizeZ - 1, false, rand, RandomConcreteBricks); //Ceiling + + //Decorations & Loot + int eastMeta = this.getDecoMeta(4); + int westMeta = this.getDecoMeta(5); + int northMeta = this.getDecoMeta(3); + int southMeta = this.getDecoMeta(2); + this.placeBlockAtCurrentPosition(world, ModBlocks.crashed_balefire, southMeta, 6, sizeY - 2, 3, box); + + int doorMeta = this.getMetadataWithOffset(Blocks.wooden_door, 1); + this.placeBlockAtCurrentPosition(world, ModBlocks.door_office, doorMeta, sizeX - 3, sizeY - 3, sizeZ - 2, box); + ItemDoor.placeDoorBlock(world, this.getXWithOffset(sizeX - 3, sizeZ - 2), this.getYWithOffset(sizeY - 3), this.getZWithOffset(sizeX - 3, sizeZ - 2), + doorMeta, ModBlocks.door_office); + this.placeBlockAtCurrentPosition(world, ModBlocks.door_office, doorMeta, sizeX - 2, sizeY - 3, sizeZ - 2, box); + ItemDoor.placeDoorBlock(world, this.getXWithOffset(sizeX - 2, sizeZ - 2), this.getYWithOffset(sizeY - 3), this.getZWithOffset(sizeX - 2, sizeZ - 2), + doorMeta, ModBlocks.door_office); + + this.fillWithBlocks(world, box, 1, sizeY - 3, 1, 1, sizeY - 1, 1, ModBlocks.deco_steel, Blocks.air, false); + this.fillWithMetadataBlocks(world, box, 1, sizeY - 3, 2, 1, sizeY - 2, 3, ModBlocks.steel_grate, 7, Blocks.air, 0, false); + this.placeBlockAtCurrentPosition(world, ModBlocks.tape_recorder, westMeta, 1, sizeY - 1, 2, box); + this.placeBlockAtCurrentPosition(world, ModBlocks.steel_beam, 0, 1, sizeY - 1, 3, box); + this.fillWithBlocks(world, box, 1, sizeY - 3, 6, 1, sizeY - 1, 6, ModBlocks.deco_pipe_framed_rusted, Blocks.air, false); + + this.fillWithMetadataBlocks(world, box, sizeX - 4, sizeY - 3, 1, sizeX - 4, sizeY - 1, 1, ModBlocks.steel_wall, eastMeta, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, sizeX - 3, sizeY - 1, 1, sizeX - 2, sizeY - 1, 1, ModBlocks.steel_grate, 0, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, sizeX - 3, sizeY - 2, 1, sizeX - 2, sizeY - 2, 1, ModBlocks.tape_recorder, northMeta, Blocks.air, 0, false); + this.fillWithBlocks(world, box, sizeX - 3, sizeY - 3, 1, sizeX - 2, sizeY - 3, 1, ModBlocks.deco_steel, Blocks.air, false); + this.fillWithMetadataBlocks(world, box, sizeX - 1, sizeY - 3, 1, sizeX - 1, sizeY - 1, 1, ModBlocks.steel_wall, westMeta, Blocks.air, 0, false); + + this.fillWithMetadataBlocks(world, box, 2, 1, 2, 2, 1, sizeZ - 2, ModBlocks.steel_grate, 7, Blocks.air, 0, false); + this.placeBlockAtCurrentPosition(world, ModBlocks.vitrified_barrel, 0, 2, 2, 2, box); + this.fillWithMetadataBlocks(world, box, 3, 1, 2, 3, 3, 2, ModBlocks.steel_wall, westMeta, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, 3, 1, 4, 3, 3, 4, ModBlocks.steel_wall, westMeta, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, 3, 1, sizeZ - 2, 3, 3, sizeZ - 2, ModBlocks.steel_wall, westMeta, Blocks.air, 0, false); + this.placeBlockAtCurrentPosition(world, ModBlocks.crate, 0, 4, 1, sizeZ - 2, box); + this.placeBlockAtCurrentPosition(world, ModBlocks.crate_lead, 0, 4, 2, sizeZ - 2, box); + if(!hasPlacedLoot[0]) { + this.hasPlacedLoot[0] = this.generateInvContents(world, box, rand, ModBlocks.crate_iron, 5, 1, sizeZ - 2, HbmChestContents.nuclearFuel, 10); + } + this.fillWithBlocks(world, box, 4, 1, sizeZ - 3, 5, 1, sizeZ - 3, ModBlocks.crate_lead, Blocks.air, false); + + this.fillWithBlocks(world, box, sizeX - 5, 1, sizeZ - 2, sizeX - 5, 3, sizeZ - 2, ModBlocks.deco_steel, Blocks.air, false);; + this.fillWithMetadataBlocks(world, box, sizeX - 4, 1, sizeZ - 2, sizeX - 2, 1, sizeZ - 2, ModBlocks.steel_grate, 7, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, sizeX - 4, 2, sizeZ - 2, sizeX - 3, 2, sizeZ - 2, ModBlocks.tape_recorder, southMeta, Blocks.air, 0, false); + this.placeBlockAtCurrentPosition(world, ModBlocks.steel_beam, 0, sizeX - 2, 2, sizeZ - 2, box); + this.fillWithBlocks(world, box, sizeX - 4, 3, sizeZ - 2, sizeX - 2, 3, sizeZ - 2, ModBlocks.steel_roof, Blocks.air, false); + if(!hasPlacedLoot[1]) { + this.hasPlacedLoot[1] = this.generateInvContents(world, box, rand, ModBlocks.crate_iron, sizeX - 2, 1, 3, HbmChestContents.nukeTrash, 9); + } + + return true; + } + } + + public static class NTMWorkshop1 extends Feature { + + private static SuperConcrete RandomSuperConcrete = new SuperConcrete(); + + private boolean hasPlacedLoot; + + public NTMWorkshop1() { + super(); + } + + public NTMWorkshop1(Random rand, int minX, int minY, int minZ) { + super(rand, minX, minY, minZ, 10, 6, 8); + this.hasPlacedLoot = false; + } + + @Override + protected void func_143012_a(NBTTagCompound nbt) { + super.func_143012_a(nbt); + nbt.setBoolean("hasLoot", this.hasPlacedLoot); + } + + @Override + protected void func_143011_b(NBTTagCompound nbt) { + super.func_143011_b(nbt); + this.hasPlacedLoot = nbt.getBoolean("hasLoot"); + } + + @Override + public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { + + ////System.out.println(this.coordBaseMode); + if(!this.setAverageHeight(world, box, this.boundingBox.minY)) { + return false; + } + //System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); + + for(byte i = 1; i < sizeX - 2; i++) { + for(byte j = 0; j < sizeZ + 1; j++) { + this.func_151554_b(world, Blocks.stonebrick, 0, i, -1, j, box); + } + } + + for(byte i = 8; i < sizeX + 1; i++) { + for(byte j = 1; j < 7; j++) { + this.func_151554_b(world, Blocks.dirt, 0, i, -1, j, box); + } + } + + this.fillWithAir(world, box, 1, 0, 0, sizeX - 3, sizeY - 2, sizeZ); + this.fillWithAir(world, box, sizeX - 2, 0, 2, sizeX - 1, 2, 5); + + if(this.getBlockAtCurrentPosition(world, 0, 0, 5, box).getMaterial().isReplaceable() + || this.getBlockAtCurrentPosition(world, 0, 0, 5, box) == Blocks.air) { + int stairMeta = this.getMetadataWithOffset(Blocks.stone_brick_stairs, 1); + this.placeBlockAtCurrentPosition(world, Blocks.stone_brick_stairs, stairMeta, 0, 0, 5, box); + + for(byte i = 1; 1 < sizeZ; i++) { + this.func_151554_b(world, Blocks.stonebrick, 0, 0, -1, i, box); + } + + this.fillWithMetadataBlocks(world, box, 0, 0, 1, 0, 0, sizeZ - 1, Blocks.stone_slab, 5, Blocks.air, 0, false); + } + + //Walls + int pillarMetaWE = this.getPillarMeta(4); + int pillarMetaNS = this.getPillarMeta(8); + this.fillWithBlocks(world, box, 1, 0, 0, 1, 3, 0, ModBlocks.concrete_pillar, Blocks.air, false); //Back Wall + this.placeBlockAtCurrentPosition(world, ModBlocks.concrete, 0, 1, 4, 0, box); + this.fillWithMetadataBlocks(world, box, 2, 4, 0, sizeX - 4, 4, 0, ModBlocks.concrete_pillar, pillarMetaWE, Blocks.air, 0, false); + this.placeBlockAtCurrentPosition(world, ModBlocks.concrete, 0, sizeX - 3, 4, 0, box); + this.fillWithBlocks(world, box, sizeX - 3, 0, 0, sizeX - 3, 3, 0, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 2, 0, 0, sizeX - 4, 1, 0, false, rand, RandomSuperConcrete); + this.fillWithRandomizedBlocks(world, box, 2, 2, 0, 2, 2, 0, false, rand, RandomSuperConcrete); + this.fillWithBlocks(world, box, 3, 2, 0, 5, 2, 0, ModBlocks.reinforced_glass, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, sizeX - 4, 2, 0, sizeX - 4, 2, 0, false, rand, RandomSuperConcrete); + this.fillWithRandomizedBlocks(world, box, 2, 3, 0, sizeX - 4, 3, 0, false, rand, RandomSuperConcrete); + this.fillWithMetadataBlocks(world, box, 1, 4, 1, 1, 4, sizeZ - 1, ModBlocks.concrete_pillar, pillarMetaNS, Blocks.air, 0, false); //Left Wall + this.placeBlockAtCurrentPosition(world, ModBlocks.concrete, 0, 1, 4, sizeZ, box); + this.fillWithBlocks(world, box, 1, 0, sizeZ, 1, 3, sizeZ, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 1, 0, 1, 1, 1, 4, false, rand, RandomSuperConcrete); + this.fillWithRandomizedBlocks(world, box, 1, 2, 1, 1, 2, 1, false, rand, RandomSuperConcrete); + this.fillWithBlocks(world, box, 1, 2, 2, 1, 2, 3, ModBlocks.reinforced_glass, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 1, 2, 4, 1, 2, 4, false, rand, RandomSuperConcrete); + this.fillWithRandomizedBlocks(world, box, 1, 3, 1, 1, 3, sizeZ - 1, false, rand, RandomSuperConcrete); + this.fillWithRandomizedBlocks(world, box, 1, 0, sizeZ - 2, 1, 3, sizeZ - 1, false, rand, RandomSuperConcrete); + this.fillWithMetadataBlocks(world, box, 2, 4, sizeZ, sizeX - 4, 4, sizeZ, ModBlocks.concrete_pillar, pillarMetaWE, Blocks.air, 0, false); //Front Wall + this.placeBlockAtCurrentPosition(world, ModBlocks.concrete, 0, sizeX - 3, 4, sizeZ, box); + this.fillWithBlocks(world, box, sizeX - 3, 0, sizeZ, sizeX - 3, 3, sizeZ, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 2, 0, sizeZ, sizeX - 4, 1, sizeZ, false, rand, RandomSuperConcrete); + this.fillWithRandomizedBlocks(world, box, 2, 2, sizeZ, 2, 2, sizeZ, false, rand, RandomSuperConcrete); + this.fillWithBlocks(world, box, 3, 2, sizeZ, 5, 2, sizeZ, ModBlocks.reinforced_glass, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, sizeX - 4, 2, sizeZ, sizeX - 4, 2, sizeZ, false, rand, RandomSuperConcrete); + this.fillWithRandomizedBlocks(world, box, 2, 3, sizeZ, sizeX - 4, 3, sizeZ, false, rand, RandomSuperConcrete); + this.fillWithMetadataBlocks(world, box, sizeX - 3, 4, 1, sizeX - 3, 4, sizeZ - 1, ModBlocks.concrete_pillar, pillarMetaNS, Blocks.air, 0, false); //Right Wall + this.fillWithRandomizedBlocks(world, box, sizeX - 3, 0, 1, sizeX - 3, 3, sizeZ - 1, false, rand, RandomSuperConcrete); + + pillarMetaWE = this.getPillarMeta(5); + pillarMetaNS = this.getPillarMeta(9); + this.fillWithMetadataBlocks(world, box, sizeX - 2, 2, 1, sizeX - 1, 2, 1, Blocks.log, pillarMetaWE, Blocks.air, 0, false); //Back Wall + this.fillWithMetadataBlocks(world, box, sizeX, 0, 1, sizeX, 2, 1, Blocks.log, 1, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, sizeX - 2, 0, 1, sizeX - 1, 1, 1, Blocks.planks, 1, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, sizeX, 2, 2, sizeX, 2, 5, Blocks.log, pillarMetaNS, Blocks.air, 0, false); //Right Wall + this.fillWithMetadataBlocks(world, box, sizeX, 0, 6, sizeX, 2, 6, Blocks.log, 1, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, sizeX, 0, 3, sizeX, 1, 5, Blocks.planks, 1, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, sizeX - 2, 2, 6, sizeX - 1, 2, 6, Blocks.log, pillarMetaWE, Blocks.air, 0, false); //Front Wall + this.fillWithMetadataBlocks(world, box, sizeX - 2, 0, 6, sizeX - 1, 1, 6, Blocks.planks, 1, Blocks.air, 0, false); + + //Floor & Ceiling + this.fillWithBlocks(world, box, 2, 0, 1, 6, 0, sizeZ - 1, ModBlocks.brick_light, Blocks.air, false); //Floor + this.placeBlockAtCurrentPosition(world, ModBlocks.brick_light, 0, 1, 0, 5, box); + this.fillWithRandomizedBlocks(world, box, 2, 4, 1, 6, 4, 3, false, rand, RandomSuperConcrete); //Ceiling + this.fillWithRandomizedBlocks(world, box, 2, 4, 4, 2, 4, 4, false, rand, RandomSuperConcrete); + this.fillWithRandomizedBlocks(world, box, 5, 4, 4, 6, 4, 4, false, rand, RandomSuperConcrete); + this.fillWithRandomizedBlocks(world, box, 2, 4, sizeZ - 3, 6, 4, sizeZ - 1, false, rand, RandomSuperConcrete); + + this.fillWithBlocks(world, box, sizeX - 2, 2, 2, sizeX - 1, 2, 5, ModBlocks.deco_steel, Blocks.air, false); + + //Loot & Decorations + int southMeta = this.getDecoMeta(2); + int eastMeta = this.getDecoMeta(5); + this.placeBlockAtCurrentPosition(world, ModBlocks.pole_satellite_receiver, eastMeta, 2, sizeY - 1, 1, box); + this.fillWithBlocks(world, box, 3, sizeY - 1, 1, 4, sizeY - 1, 1, ModBlocks.deco_steel, Blocks.air, false); + this.fillWithBlocks(world, box, 2, sizeY - 1, 2, 4, sizeY - 1, 2, ModBlocks.deco_steel, Blocks.air, false); + this.fillWithBlocks(world, box, 2, sizeY, 1, 4, sizeY, 2, ModBlocks.steel_roof, Blocks.air, false); + this.fillWithBlocks(world, box, 2, 1, 1, 2, 3, 1, ModBlocks.deco_red_copper, Blocks.air, false); + this.fillWithBlocks(world, box, 3, 1, 1, 3, 1, 2, ModBlocks.deco_beryllium, Blocks.air, false); + this.placeBlockAtCurrentPosition(world, ModBlocks.machine_generator, 0, 4, 1, 1, box); + this.placeBlockAtCurrentPosition(world, ModBlocks.machine_detector, 0, 4, 1, 2, box); + this.fillWithBlocks(world, box, 5, 1, 1, 5, 1, 2, ModBlocks.deco_beryllium, Blocks.air, false); + this.fillWithBlocks(world, box, 6, 1, 1, 6, 3, 1, ModBlocks.deco_red_copper, Blocks.air, false); + this.fillWithBlocks(world, box, 3, 1, 4, 4, 1, 4, ModBlocks.concrete_super_broken, Blocks.air, false); + this.fillWithMetadataBlocks(world, box, 6, 1, 4, 6, 3, 4, ModBlocks.steel_scaffold, eastMeta, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, 6, 1, 5, 6, 1, 7, ModBlocks.steel_grate, 7, Blocks.air, 0, false); + this.placeBlockAtCurrentPosition(world, ModBlocks.radiorec, eastMeta, 6, 2, sizeZ - 1, box); + this.fillWithMetadataBlocks(world, box, 2, 1, sizeZ - 1, 3, 1, sizeZ - 1, ModBlocks.machine_electric_furnace_off, southMeta, Blocks.air, 0, false); + if(!hasPlacedLoot) { + this.hasPlacedLoot = this.generateInvContents(world, box, rand, ModBlocks.crate_iron, 4, 1, sizeZ - 1, HbmChestContents.machineParts, 11); + } + this.placeBlockAtCurrentPosition(world, Blocks.web, 0, 5, 3, 1, box); + this.placeBlockAtCurrentPosition(world, Blocks.web, 0, 2, 1, 2, box); + this.placeBlockAtCurrentPosition(world, Blocks.web, 0, 6, 1, 2, box); + this.placeBlockAtCurrentPosition(world, Blocks.web, 0, 6, 2, 5, box); + + this.fillWithMetadataBlocks(world, box, sizeX - 2, 0, 5, sizeX - 1, 0, 5, ModBlocks.steel_grate, 7, Blocks.air, 0, false); + this.placeBlockAtCurrentPosition(world, ModBlocks.tape_recorder, southMeta, sizeX - 2, 1, 5, box); + this.placeBlockAtCurrentPosition(world, ModBlocks.bobblehead, rand.nextInt(16), sizeX - 1, 1, 5, box); + TileEntityBobble bobble = (TileEntityBobble) world.getTileEntity(this.getXWithOffset(sizeX - 1, 5), this.getYWithOffset(1), this.getZWithOffset(sizeX - 1, 5)); + + if(bobble != null) { + bobble.type = BobbleType.values()[rand.nextInt(BobbleType.values().length - 1) + 1]; + bobble.markDirty(); + } + this.fillWithMetadataBlocks(world, box, sizeX - 2, 0, 2, sizeX - 2, 0, 3, Blocks.log, pillarMetaWE, Blocks.air, 0, false); + this.placeBlockAtCurrentPosition(world, Blocks.log, pillarMetaWE, sizeX - 2, 1, 2, box); + this.placeBlockAtCurrentPosition(world, Blocks.web, 0, sizeX - 2, 1, 3, box); + + return true; + } + } + +} diff --git a/src/main/java/com/hbm/world/worldgen/components/Feature.java b/src/main/java/com/hbm/world/worldgen/components/Feature.java index 0ffce977c..8eb36dc6a 100644 --- a/src/main/java/com/hbm/world/worldgen/components/Feature.java +++ b/src/main/java/com/hbm/world/worldgen/components/Feature.java @@ -5,6 +5,7 @@ import java.util.Random; import com.hbm.blocks.ModBlocks; import com.hbm.blocks.generic.BlockBobble.BobbleType; import com.hbm.blocks.generic.BlockBobble.TileEntityBobble; +import com.hbm.config.StructureConfig; import com.hbm.tileentity.machine.storage.TileEntityCrateIron; import net.minecraft.block.Block; @@ -180,6 +181,7 @@ abstract public class Feature extends StructureComponent { IInventory inventory = (IInventory)world.getTileEntity(posX, posY, posZ); if(inventory != null) { + amount = (int)Math.floor(amount * StructureConfig.lootAmountFactor); WeightedRandomChestContent.generateChestContents(rand, content, inventory, amount); return true; } diff --git a/src/main/java/com/hbm/world/worldgen/components/MilitaryBaseFeatures.java b/src/main/java/com/hbm/world/worldgen/components/MilitaryBaseFeatures.java index 49bf2cad6..d6dcbfe9a 100644 --- a/src/main/java/com/hbm/world/worldgen/components/MilitaryBaseFeatures.java +++ b/src/main/java/com/hbm/world/worldgen/components/MilitaryBaseFeatures.java @@ -4,12 +4,12 @@ import java.util.LinkedList; import java.util.Random; import com.hbm.blocks.ModBlocks; -import com.hbm.world.worldgen.ComponentNTMFeatures; import net.minecraft.init.Blocks; import net.minecraft.world.World; import net.minecraft.world.gen.structure.StructureBoundingBox; +//These structures are... kind of? low quality, but they test out new methods so whatev. public class MilitaryBaseFeatures { //stop-gap methods until this entire mess can be organized into proper classes/structure groups @@ -21,7 +21,8 @@ public class MilitaryBaseFeatures { components.add(helipad); components.add(radio); } - + + //ugh public static int[] getAdjacentChunk(int chunkX, int chunkZ, Random rand) { int[] chunkPos = new int[2]; diff --git a/src/main/java/com/hbm/world/worldgen/components/RuinFeatures.java b/src/main/java/com/hbm/world/worldgen/components/RuinFeatures.java new file mode 100644 index 000000000..7dd67bd39 --- /dev/null +++ b/src/main/java/com/hbm/world/worldgen/components/RuinFeatures.java @@ -0,0 +1,279 @@ +package com.hbm.world.worldgen.components; + +import java.util.Random; + +import com.hbm.blocks.ModBlocks; + +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.gen.structure.StructureBoundingBox; + +public class RuinFeatures { + + public static class NTMRuin1 extends Feature { + + private static ConcreteBricks RandomConcreteBricks = new ConcreteBricks(); + + public NTMRuin1() { + super(); + } + + public NTMRuin1(Random rand, int minX, int minY, int minZ) { + super(rand, minX, minY, minZ, 8, 6, 10); + } + + @Override + public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { + + //System.out.println(this.coordBaseMode); + if(!this.setAverageHeight(world, box, this.boundingBox.minY)) { + return false; + } + //System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); + + for(byte i = 0; i < sizeX + 1; i++) { + for(byte j = 0; j < sizeZ + 1; j++) { + this.func_151554_b(world, Blocks.stonebrick, 0, i, -1, j, box); + } + } + + int pillarMetaWE = this.getPillarMeta(4); + int pillarMetaNS = this.getPillarMeta(8); + + this.fillWithBlocks(world, box, 0, 0, 0, 0, sizeY, 0, ModBlocks.concrete_pillar, Blocks.air, false); //Back Wall + this.fillWithMetadataBlocks(world, box, 1, 3, 0, 3, 3, 0, ModBlocks.concrete_pillar, pillarMetaWE, Blocks.air, 0, false); + this.fillWithBlocks(world, box, 4, 0, 0, 4, sizeY - 1, 0, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithMetadataBlocks(world, box, 5, 3, 0, sizeX - 1, 3, 0, ModBlocks.concrete_pillar, pillarMetaWE, Blocks.air, 0, false); + this.fillWithBlocks(world, box, sizeX, 0, 0, sizeX, sizeY - 1, 0, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 1, 0, 0, 3, 0, 0, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 5, 0, 0, sizeX - 1, 0, 0, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 1, 1, 0, 1, 2, 0, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 3, 1, 0, 3, 2, 0, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 5, 1, 0, 5, 2, 0, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, sizeX - 1, 1, 0, sizeX - 1, 2, 0, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 1, 4, 0, 3, 4, 0, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 5, 4, 0, sizeX - 1, 4, 0, false, rand, RandomConcreteBricks); + this.fillWithMetadataBlocks(world, box, 0, 3, 1, 0, 3, sizeZ - 1, ModBlocks.concrete_pillar, pillarMetaNS, Blocks.air, 0, false); //Left Wall + this.fillWithBlocks(world, box, 0, 0, sizeZ, 0, sizeY - 1, sizeZ, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 0, 0, 1, 0, 0, sizeZ - 1, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 0, 1, 1, 0, 2, 2, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 0, 1, 4, 0, 2, 6, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 0, 1, sizeZ - 2, 0, 2, sizeZ - 1, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 0, 4, 1, 0, 4, 5, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 0, 5, 1, 0, 5, 2, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 0, 4, sizeZ - 2, 0, 4, sizeZ - 1, false, rand, RandomConcreteBricks); + this.fillWithMetadataBlocks(world, box, 1, 3, sizeZ, 3, 3, sizeZ, ModBlocks.concrete_pillar, pillarMetaWE, Blocks.air, 0, false); //Front Wall + this.fillWithBlocks(world, box, 4, 0, sizeZ, 4, sizeY - 2, sizeZ, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithMetadataBlocks(world, box, 5, 3, sizeZ, sizeX - 1, 3, sizeZ, ModBlocks.concrete_pillar, pillarMetaWE, Blocks.air, 0, false); + this.fillWithBlocks(world, box, sizeX, 0, sizeZ, sizeX, sizeY - 2, sizeZ, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 1, 0, sizeZ, 3, 0, sizeZ, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 5, 0, sizeZ, sizeX - 1, 0, sizeZ, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 1, 1, sizeZ, 1, 2, sizeZ, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 3, 1, sizeZ, 3, 2, sizeZ, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 5, 1, sizeZ, 5, 2, sizeZ, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, sizeX - 1, 1, sizeZ, sizeX - 1, 2, sizeZ, false, rand, RandomConcreteBricks); + this.fillWithMetadataBlocks(world, box, sizeX, 3, 1, sizeX, 3, 2, ModBlocks.concrete_pillar, pillarMetaNS, Blocks.air, 0, false); //Right Wall + this.fillWithMetadataBlocks(world, box, sizeX, 3, sizeZ - 1, sizeX, 3, sizeZ - 1, ModBlocks.concrete_pillar, pillarMetaNS, Blocks.air, 0, false); + this.fillWithRandomizedBlocks(world, box, sizeX, 0, 1, sizeX, 0, 4, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, sizeX, 1, 1, sizeX, 2, 2, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, sizeX, 0, 6, sizeX, 0, 6, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, sizeX, 0, sizeZ - 2, sizeX, 1, sizeZ - 1, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, sizeX, 2, sizeZ - 1, sizeX, 2, sizeZ - 1, false, rand, RandomConcreteBricks); + + this.randomlyFillWithBlocks(world, box, rand, 0.25F, 1, 0, 1, sizeX - 1, 0, sizeZ - 1, Blocks.gravel, Blocks.air, false); + + return true; + } + } + + public static class NTMRuin2 extends Feature { + + private static ConcreteBricks RandomConcreteBricks = new ConcreteBricks(); + + public NTMRuin2() { + super(); + } + + public NTMRuin2(Random rand, int minX, int minY, int minZ) { + super(rand, minX, minY, minZ, 7, 5, 10); + } + + @Override + public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { + + //System.out.println(this.coordBaseMode); + if(!this.setAverageHeight(world, box, this.boundingBox.minY)) { + return false; + } + //System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); + + for(byte i = 0; i < sizeX + 1; i++) { + for(byte j = 0; j < sizeZ + 1; j++) { + this.func_151554_b(world, Blocks.stonebrick, 0, i, -1, j, box); + } + } + + int pillarMetaWE = this.getPillarMeta(4); + int pillarMetaNS = this.getPillarMeta(8); + + this.fillWithBlocks(world, box, 0, 0, 0, 0, 3, 0, ModBlocks.concrete_pillar, Blocks.air, false); //Back Wall + this.fillWithMetadataBlocks(world, box, 1, 3, 0, sizeX - 1, 3, 0, ModBlocks.concrete_pillar, pillarMetaWE, Blocks.air, 0, false); + this.fillWithBlocks(world, box, sizeX, 0, 0, sizeX, sizeY, 0, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 1, 0, 0, sizeX - 1, 0, 0, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 1, 1, 0, 1, 2, 0, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 3, 1, 0, 4, 2, 0, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, sizeX - 1, 1, 0, sizeX - 1, 2, 0, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 3, 4, 0, sizeX - 1, 4, 0, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, sizeX - 1, sizeY, 0, sizeX - 1, sizeY, 0, false, rand, RandomConcreteBricks); + this.fillWithMetadataBlocks(world, box, 0, 3, 1, 0, 3, 4, ModBlocks.concrete_pillar, pillarMetaNS, Blocks.air, 0, false); //Left Wall + this.fillWithBlocks(world, box, 0, 0, 5, 0, 0, 5, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithBlocks(world, box, 0, 0, sizeZ, 0, 2, sizeZ, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 0, 0, 1, 0, 2, 3, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 0, 0, sizeZ - 3, 0, 0, sizeZ - 1, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 0, 1, sizeZ - 1, 0, 1, sizeZ - 1, false, rand, RandomConcreteBricks); + this.fillWithMetadataBlocks(world, box, sizeX - 1, 3, sizeZ, sizeX - 1, 3, sizeZ, ModBlocks.concrete_pillar, pillarMetaWE, Blocks.air, 0, false); //Front Wall + this.fillWithBlocks(world, box, sizeX, 0, sizeZ, sizeX, 3, sizeZ, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 1, 0, sizeZ, sizeX - 1, 0, sizeZ, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 1, 1, sizeZ, 1, 2, sizeZ, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, sizeX - 1, 1, sizeZ, sizeX - 1, 2, sizeZ, false, rand, RandomConcreteBricks); + this.fillWithMetadataBlocks(world, box, sizeX, 3, 1, sizeX, 3, 4, ModBlocks.concrete_pillar, pillarMetaNS, Blocks.air, 0, false); //Right Wall + this.fillWithBlocks(world, box, sizeX, 0, 5, sizeX, 4, 5, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithMetadataBlocks(world, box, sizeX, 3, sizeZ - 2, sizeX, 3, sizeZ - 1, ModBlocks.concrete_pillar, pillarMetaNS, Blocks.air, 0, false); + this.fillWithRandomizedBlocks(world, box, sizeX, 0, 1, sizeX, 0, 4, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, sizeX, 1, 1, sizeX, 2, 1, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, sizeX, 1, 3, sizeX, 2, 3, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, sizeX, 1, 4, sizeX, 1, 4, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, sizeX, 0, 6, sizeX, 0, sizeZ - 1, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, sizeX, 1, 6, sizeX, 1, 7, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, sizeX, 1, sizeZ - 1, sizeX, 2, sizeZ - 1, false, rand, RandomConcreteBricks); + + this.randomlyFillWithBlocks(world, box, rand, 0.25F, 1, 0, 1, sizeX - 1, 0, sizeZ - 1, Blocks.gravel, Blocks.air, false); + + return true; + } + } + + public static class NTMRuin3 extends Feature { + + private static ConcreteBricks RandomConcreteBricks = new ConcreteBricks(); + + public NTMRuin3() { + super(); + } + + public NTMRuin3(Random rand, int minX, int minY, int minZ) { + super(rand, minX, minY, minZ, 8, 3, 10); + } + + @Override + public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { + + //System.out.println(this.coordBaseMode); + if(!this.setAverageHeight(world, box, this.boundingBox.minY)) { + return false; + } + //System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); + + for(byte i = 0; i < sizeZ + 1; i++) { + this.func_151554_b(world, Blocks.stonebrick, 0, 0, -1, i, box); + this.func_151554_b(world, Blocks.stonebrick, 0, sizeX, -1, i, box); + } + + for(byte i = 1; i < sizeX; i++) { + this.func_151554_b(world, Blocks.stonebrick, 0, i, -1, 0, box); + this.func_151554_b(world, Blocks.stonebrick, 0, i, -1, 4, box); + } + + this.fillWithBlocks(world, box, 0, 0, 0, 0, sizeY, 0, ModBlocks.concrete_pillar, Blocks.air, false); //Back Wall + this.fillWithBlocks(world, box, sizeX, 0, 0, sizeX, 1, 0, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 1, 0, 0, sizeX - 1, 0, 0, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 1, 1, 0, 1, 1, 0, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 4, 1, 0, 4, 1, 0, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, sizeX - 1, 1, 0, sizeX - 1, 1, 0, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 1, 2, 0, sizeX - 2, 2, 0, false, rand, RandomConcreteBricks); + this.fillWithBlocks(world, box, 0, 0, 4, 0, 1, 4, ModBlocks.concrete_pillar, Blocks.air, false); //Left Wall + this.placeBlockAtCurrentPosition(world, ModBlocks.concrete_pillar, 0, 0, 0, sizeZ, box); + this.fillWithRandomizedBlocks(world, box, 0, 0, 1, 0, 0, 3, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 0, 0, 5, 0, 0, sizeZ - 1, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 0, 1, 5, 0, 1, 5, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 0, 1, 7, 0, 1, 7, false, rand, RandomConcreteBricks); + this.fillWithBlocks(world, box, sizeX, 0, 4, sizeX, 1, 4, ModBlocks.concrete_pillar, Blocks.air, false); //Right Wall + this.fillWithBlocks(world, box, sizeX, 0, sizeZ, sizeX, 1, sizeZ, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, sizeX, 0, 1, sizeX, 1, 3, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, sizeX, 0, 5, sizeX, 0, 6, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, sizeX, 0, sizeZ - 1, sizeX, 0, sizeZ - 1, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, sizeX - 1, 0, sizeZ, sizeX - 1, 0, sizeZ, false, rand, RandomConcreteBricks); + this.fillWithBlocks(world, box, 4, 0, 4, 4, 2, 4, ModBlocks.concrete_pillar, Blocks.air, false); //Center Wall + this.fillWithRandomizedBlocks(world, box, 3, 0, 4, 3, 1, 4, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 5, 0, 4, sizeX - 1, 1, 4, false, rand, RandomConcreteBricks); + + this.randomlyFillWithBlocks(world, box, rand, 0.05F, 1, 0, 1, sizeX - 1, 0, 3, Blocks.gravel, Blocks.air, false); + this.randomlyFillWithBlocks(world, box, rand, 0.05F, 1, 0, 5, sizeX - 1, 0, sizeZ - 1, Blocks.gravel, Blocks.air, false); + + return true; + } + } + + public static class NTMRuin4 extends Feature { + + private static ConcreteBricks RandomConcreteBricks = new ConcreteBricks(); + + public NTMRuin4() { + super(); + } + + public NTMRuin4(Random rand, int minX, int minY, int minZ) { + super(rand, minX, minY, minZ, 10, 2, 11); + } + + @Override + public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { + + //System.out.println(this.coordBaseMode); + if(!this.setAverageHeight(world, box, this.boundingBox.minY)) { + return false; + } + //System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); + + for(byte i = 0; i < sizeZ + 1; i++) { + this.func_151554_b(world, Blocks.stonebrick, 0, 0, -1, i, box); + this.func_151554_b(world, Blocks.stonebrick, 0, i >= 5 ? sizeX : 5, -1, i, box); //elegant solution + } + + for(byte i = 1; i < sizeX; i++) { + this.func_151554_b(world, Blocks.stonebrick, 0, i, -1, sizeZ, box); + this.func_151554_b(world, Blocks.stonebrick, 0, i, -1, i > 4 ? 5 : 0, box); //ternary operators my beloved + } + + this.fillWithBlocks(world, box, 0, 0, 0, 0, 1, 0, ModBlocks.concrete_pillar, Blocks.air, false); //Back Wall Pt. 1 + this.fillWithBlocks(world, box, 5, 0, 0, 5, sizeY, 0, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 1, 0, 0, 4, 0, 0, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 4, 1, 0, 4, 1, 0, false, rand, RandomConcreteBricks); + this.fillWithBlocks(world, box, 5, 0, 5, 5, sizeY, 5, ModBlocks.concrete_pillar, Blocks.air, false); //Right Wall Pt. 1 + this.fillWithRandomizedBlocks(world, box, 5, 0, 1, 5, 0, 4, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 5, 1, 1, 5, 1, 1, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 5, 1, 4, 5, 1, 4, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 5, 2, 1, 5, 2, 4, false, rand, RandomConcreteBricks); + this.fillWithBlocks(world, box, sizeX, 0, 5, sizeX, 1, 5, ModBlocks.concrete_pillar, Blocks.air, false); //Back Wall Pt. 2 + this.fillWithRandomizedBlocks(world, box, 6, 0, 5, sizeX - 1, 0, 5, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 6, 1, 5, 6, 1, 5, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, sizeX - 1, 1, 5, sizeX - 1, 1, 5, false, rand, RandomConcreteBricks); + this.fillWithBlocks(world, box, sizeX, 0, sizeZ, sizeX, 1, sizeZ, ModBlocks.concrete_pillar, Blocks.air, false); //Right Wall Pt. 2 + this.fillWithRandomizedBlocks(world, box, sizeX, 0, 6, sizeX, 0, sizeZ - 1, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, sizeX, 1, 6, sizeX, 1, sizeZ - 3, false, rand, RandomConcreteBricks); + this.fillWithBlocks(world, box, 0, 0, sizeZ, 0, 0, sizeZ, ModBlocks.concrete_pillar, Blocks.air, false); //Front Wall + this.fillWithRandomizedBlocks(world, box, 1, 0, sizeZ, 1, 0, sizeZ, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 6, 0, sizeZ, 7, 0, sizeZ, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, sizeX - 1, 0, sizeZ, sizeX - 1, 0, sizeZ, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 0, 0, 1, 0, 0, sizeZ - 1, false, rand, RandomConcreteBricks); //Left Wall + this.fillWithRandomizedBlocks(world, box, 0, 1, 1, 0, 1, 1, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 0, 1, 4, 0, 1, 7, false, rand, RandomConcreteBricks); + + this.randomlyFillWithBlocks(world, box, rand, 0.05F, 1, 0, 1, 4, 0, 5, Blocks.gravel, Blocks.air, false); + this.randomlyFillWithBlocks(world, box, rand, 0.05F, 1, 0, 6, sizeX - 1, 0, sizeZ - 1, Blocks.gravel, Blocks.air, false); + + return true; + } + } + +} From 5060276173b026e4885a5f95f9b85bca876a6880 Mon Sep 17 00:00:00 2001 From: Vaern Date: Sun, 4 Sep 2022 00:42:22 -0700 Subject: [PATCH 03/12] BlockDecoModel class, or more importantly, DECO COMPUTERS! remind me to figure out how smooth-shading works for ISBRHs tomorrow as it is half past midnight --- src/main/java/com/hbm/blocks/ModBlocks.java | 7 +- .../hbm/blocks/generic/BlockDecoModel.java | 102 ++ src/main/java/com/hbm/main/ClientProxy.java | 3 +- .../java/com/hbm/main/ResourceManager.java | 2 + .../render/block/RenderBlockDecoModel.java | 91 ++ .../assets/hbm/models/blocks/puter.obj | 966 ++++++++++++++++++ .../hbm/textures/blocks/deco_computer_0.png | Bin 0 -> 1832 bytes 7 files changed, 1169 insertions(+), 2 deletions(-) create mode 100644 src/main/java/com/hbm/blocks/generic/BlockDecoModel.java create mode 100644 src/main/java/com/hbm/render/block/RenderBlockDecoModel.java create mode 100644 src/main/resources/assets/hbm/models/blocks/puter.obj create mode 100644 src/main/resources/assets/hbm/textures/blocks/deco_computer_0.png diff --git a/src/main/java/com/hbm/blocks/ModBlocks.java b/src/main/java/com/hbm/blocks/ModBlocks.java index 449968504..0a02fa292 100644 --- a/src/main/java/com/hbm/blocks/ModBlocks.java +++ b/src/main/java/com/hbm/blocks/ModBlocks.java @@ -387,6 +387,8 @@ public class ModBlocks { public static Block brick_dungeon_circle; public static Block brick_forgotten; + + public static Block deco_computer; public static Block tape_recorder; public static Block steel_poles; @@ -1640,7 +1642,9 @@ public class ModBlocks { brick_dungeon_circle = new BlockGeneric(Material.rock).setBlockName("brick_dungeon_circle").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(900.0F).setBlockTextureName(RefStrings.MODID + ":brick_dungeon_circle"); brick_forgotten = new BlockGeneric(Material.rock).setBlockName("brick_forgotten").setCreativeTab(MainRegistry.blockTab).setBlockUnbreakable().setResistance(1000000).setBlockTextureName(RefStrings.MODID + ":brick_forgotten"); - + + deco_computer = new BlockDecoModel(Material.iron, 1).setBlockName("deco_computer").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":deco_computer"); + tape_recorder = new DecoTapeRecorder(Material.iron).setBlockName("tape_recorder").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(15.0F).setBlockTextureName(RefStrings.MODID + ":deco_tape_recorder"); steel_poles = new DecoSteelPoles(Material.iron).setBlockName("steel_poles").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(15.0F).setBlockTextureName(RefStrings.MODID + ":steel_beam"); pole_top = new DecoPoleTop(Material.iron).setBlockName("pole_top").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(15.0F).setBlockTextureName(RefStrings.MODID + ":deco_pole_top"); @@ -2741,6 +2745,7 @@ public class ModBlocks { GameRegistry.registerBlock(brick_dungeon_tile, brick_dungeon_tile.getUnlocalizedName()); GameRegistry.registerBlock(brick_dungeon_circle, brick_dungeon_circle.getUnlocalizedName()); GameRegistry.registerBlock(brick_forgotten, brick_forgotten.getUnlocalizedName()); + GameRegistry.registerBlock(deco_computer, ItemBlockMeta.class, deco_computer.getUnlocalizedName()); GameRegistry.registerBlock(tape_recorder, tape_recorder.getUnlocalizedName()); GameRegistry.registerBlock(steel_poles, steel_poles.getUnlocalizedName()); GameRegistry.registerBlock(pole_top, pole_top.getUnlocalizedName()); diff --git a/src/main/java/com/hbm/blocks/generic/BlockDecoModel.java b/src/main/java/com/hbm/blocks/generic/BlockDecoModel.java new file mode 100644 index 000000000..d62ae2d39 --- /dev/null +++ b/src/main/java/com/hbm/blocks/generic/BlockDecoModel.java @@ -0,0 +1,102 @@ +package com.hbm.blocks.generic; + +import java.util.List; + +import com.hbm.lib.RefStrings; + +import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class BlockDecoModel extends Block { + + //Allows between 1-4 differently colored/textured sub-blocks altogether. + int subTypes; + + public BlockDecoModel(Material mat, int types) { + super(mat); + subTypes = types; + } + + @SideOnly(Side.CLIENT) + protected IIcon[] icons; + + @Override + public int damageDropped(int meta) { + return meta & 12; + } + + @Override + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item item, CreativeTabs tabs, List list) { + for(byte i = 0; i < subTypes; i++) { + list.add(new ItemStack(item, 1, i)); + } + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) { + super.registerBlockIcons(iconRegister); + icons = new IIcon[subTypes]; + + for(byte i = 0; i < subTypes; i++) + icons[i] = iconRegister.registerIcon(this.textureName + "_" + i); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) { + return this.icons[(meta >> 2) % this.icons.length]; + } + + public static int renderID = RenderingRegistry.getNextAvailableRenderId(); + + @Override + public int getRenderType() { + return renderID; + } + + @Override + public boolean isOpaqueCube() { + return false; + } + + @Override + public boolean renderAsNormalBlock() { + return false; + } + + //Did somebody say - pain? + //Alright fuckers, looks like 2/b010 = North, 3/b011 = South, 4/b100 = West, 5/b101 = East for sides. + //I'll just opt for something similar (0/b00 North, 1/b01 South, 2/b10 West, 3/b11 East) + + //Assumes meta is using the third and fourth bits. + @Override + public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) { + int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; + + int meta; + + if((i & 1) != 1) + meta = i >> 1; //For North(b00>b00) and South(b10>b01), shift bits right by one + else { + if(i == 3) + meta = 2; //For West(b11>b10), just set to 2 + else + meta = 3; //For East(b01>b11), just set to 3 + } + + world.setBlockMetadataWithNotify(x, y, z, meta, 2); + } +} diff --git a/src/main/java/com/hbm/main/ClientProxy.java b/src/main/java/com/hbm/main/ClientProxy.java index c10328f0c..62d6468a3 100644 --- a/src/main/java/com/hbm/main/ClientProxy.java +++ b/src/main/java/com/hbm/main/ClientProxy.java @@ -739,7 +739,8 @@ public class ClientProxy extends ServerProxy { RenderingRegistry.registerBlockHandler(new RenderBlockSideRotation()); RenderingRegistry.registerBlockHandler(new RenderDiode()); RenderingRegistry.registerBlockHandler(new RenderBoxDuct()); - + RenderingRegistry.registerBlockHandler(new RenderBlockDecoModel(ModBlocks.deco_computer.getRenderType(), ResourceManager.deco_computer)); + RenderingRegistry.registerBlockHandler(new RenderBlockRotated(ModBlocks.charge_dynamite.getRenderType(), ResourceManager.charge_dynamite)); RenderingRegistry.registerBlockHandler(new RenderBlockRotated(ModBlocks.charge_c4.getRenderType(), ResourceManager.charge_c4)); diff --git a/src/main/java/com/hbm/main/ResourceManager.java b/src/main/java/com/hbm/main/ResourceManager.java index 42722b66b..38eb82021 100644 --- a/src/main/java/com/hbm/main/ResourceManager.java +++ b/src/main/java/com/hbm/main/ResourceManager.java @@ -1249,6 +1249,8 @@ public class ResourceManager { public static final IModelCustom pipe_quad = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/blocks/pipe_quad.obj")); public static final IModelCustom pipe_frame = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/blocks/pipe_frame.obj")); + public static final IModelCustom deco_computer = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/blocks/puter.obj")); + public static final IModelCustom rbmk_element = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/rbmk/rbmk_element.obj")); public static final IModelCustom rbmk_reflector = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/rbmk/rbmk_reflector.obj")); public static final IModelCustom rbmk_rods = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/rbmk/rbmk_rods.obj")); diff --git a/src/main/java/com/hbm/render/block/RenderBlockDecoModel.java b/src/main/java/com/hbm/render/block/RenderBlockDecoModel.java new file mode 100644 index 000000000..4f0b97a2f --- /dev/null +++ b/src/main/java/com/hbm/render/block/RenderBlockDecoModel.java @@ -0,0 +1,91 @@ +package com.hbm.render.block; + +import org.lwjgl.opengl.GL11; + +import com.hbm.render.util.ObjUtil; + +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraftforge.client.model.IModelCustom; +import net.minecraftforge.client.model.obj.WavefrontObject; + +public class RenderBlockDecoModel implements ISimpleBlockRenderingHandler { + + private int renderID; + private IModelCustom model; + + public RenderBlockDecoModel(int renderType, IModelCustom IModelCustom) { + renderID = renderType; + model = IModelCustom; + } + + @Override + public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { + + GL11.glPushMatrix(); + Tessellator tessellator = Tessellator.instance; + IIcon iicon = block.getIcon(0, metadata); + tessellator.setColorOpaque_F(1, 1, 1); + + if(renderer.hasOverrideBlockTexture()) { + iicon = renderer.overrideBlockTexture; + } + + tessellator.startDrawingQuads(); + ObjUtil.renderWithIcon((WavefrontObject) model, iicon, tessellator, modelId, false); + + tessellator.draw(); + + GL11.glPopMatrix(); + } + + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { + + Tessellator tessellator = Tessellator.instance; + int meta = world.getBlockMetadata(x, y, z); + IIcon iicon = block.getIcon(0, meta & 12); + tessellator.setColorOpaque_F(1, 1, 1); + + if(renderer.hasOverrideBlockTexture()) { + iicon = renderer.overrideBlockTexture; + } + + tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z)); + tessellator.setColorOpaque_F(1, 1, 1); + + float rotation = 0; + + switch(meta & 3) { + default: //North + rotation = (float) Math.PI; break; + case 1: //South + break; + case 2: //West + rotation = 1.5F * (float) Math.PI;break; + case 3: //East + rotation = 0.5F * (float) Math.PI; break; + } + + tessellator.addTranslation(x + 0.5F, y + 0.5F, z + 0.5F); + ObjUtil.renderWithIcon((WavefrontObject) model, iicon, tessellator, rotation, true); + tessellator.addTranslation(-x - 0.5F, -y - 0.5F, -z - 0.5F); + + return false; + } + + @Override + public boolean shouldRender3DInInventory(int modelId) { + return true; + } + + @Override + public int getRenderId() { + return this.renderID; + } + +} diff --git a/src/main/resources/assets/hbm/models/blocks/puter.obj b/src/main/resources/assets/hbm/models/blocks/puter.obj new file mode 100644 index 000000000..9445788f7 --- /dev/null +++ b/src/main/resources/assets/hbm/models/blocks/puter.obj @@ -0,0 +1,966 @@ +# Blender v3.2.0 OBJ File: 'puter.blend' +# www.blender.org +o Cube.001_Cube.005 +v -0.369039 -0.501855 0.479973 +v -0.369039 -0.459563 0.479973 +v -0.369039 -0.501855 0.209191 +v -0.369039 -0.433180 0.209191 +v 0.369039 -0.501855 0.479973 +v 0.369039 -0.459563 0.479973 +v 0.369039 -0.501855 0.209191 +v 0.369039 -0.433180 0.209191 +vt 0.175000 0.175000 +vt -0.000000 0.150000 +vt 0.175000 0.150000 +vt 0.350000 0.225000 +vt 0.175000 0.200000 +vt 0.350000 0.200000 +vt 0.175000 0.225000 +vt -0.000000 0.200000 +vt -0.000000 0.225000 +vt 0.175000 0.225000 +vt 0.350000 0.250000 +vt 0.175000 0.250000 +vt 0.350000 0.150000 +vt 0.175000 0.200000 +vt 0.175000 0.150000 +vt -0.000000 0.150000 +vt 0.350000 0.000000 +vt 0.350000 0.150000 +vt -0.000000 0.200000 +vt 0.175000 0.225000 +vt 0.175000 0.175000 +vt 0.350000 0.225000 +vt 0.350000 0.200000 +vt -0.000000 0.000000 +vn -1.0000 0.0000 0.0000 +vn 0.0000 0.0000 -1.0000 +vn 1.0000 0.0000 0.0000 +vn 0.0000 0.0000 1.0000 +vn 0.0000 -1.0000 0.0000 +vn 0.0000 0.9953 0.0970 +s off +f 2/1/1 3/2/1 1/3/1 +f 4/4/2 7/5/2 3/6/2 +f 7/7/3 6/8/3 5/9/3 +f 6/10/4 1/11/4 5/12/4 +f 7/13/5 1/14/5 3/15/5 +f 4/16/6 6/17/6 8/18/6 +f 2/1/1 4/19/1 3/2/1 +f 4/4/2 8/20/2 7/5/2 +f 7/7/3 8/21/3 6/8/3 +f 6/10/4 2/22/4 1/11/4 +f 7/13/5 5/23/5 1/14/5 +f 4/16/6 2/24/6 6/17/6 +o Cube +v 0.262500 0.290571 0.025979 +v -0.061658 -0.358688 -0.212822 +v -0.077958 -0.358688 -0.229123 +v 0.262500 -0.234429 0.025979 +v -0.262500 0.290571 0.025979 +v -0.262500 -0.234429 0.025979 +v -0.077958 -0.358688 -0.352438 +v 0.131250 0.290571 0.034371 +v 0.000000 0.290571 0.035881 +v -0.061658 -0.358688 -0.368738 +v -0.131250 0.290571 0.034371 +v -0.131250 -0.234429 0.034371 +v 0.077958 -0.358688 -0.229123 +v 0.000000 -0.234429 0.035881 +v 0.061658 -0.358688 -0.212822 +v 0.131250 -0.234429 0.034371 +v -0.262500 -0.103179 0.034371 +v -0.262500 0.028071 0.035881 +v -0.262500 0.159321 0.034371 +v 0.061658 -0.358688 -0.368738 +v 0.262500 0.159321 0.034371 +v 0.077958 -0.358688 -0.352438 +v 0.262500 0.028071 0.035881 +v 0.262500 -0.103179 0.034371 +v 0.131250 0.159321 0.040787 +v -0.065019 -0.247914 -0.242045 +v -0.048736 -0.247914 -0.225761 +v 0.131250 0.028071 0.044501 +v 0.131250 -0.103179 0.040787 +v -0.048736 -0.247914 -0.355799 +v -0.065019 -0.247914 -0.339516 +v 0.000000 0.159321 0.044501 +v 0.000000 0.028071 0.049025 +v 0.065019 -0.247914 -0.339516 +v 0.000000 -0.103179 0.044501 +v 0.048736 -0.247914 -0.355799 +v -0.131250 0.159321 0.040787 +v 0.048736 -0.247914 -0.225761 +v -0.131250 0.028071 0.044501 +v 0.065019 -0.247914 -0.242045 +v -0.131250 -0.103179 0.040787 +v -0.065019 -0.337090 -0.339524 +v -0.048744 -0.337090 -0.355799 +v 0.262500 0.290571 0.092896 +v 0.048744 -0.337090 -0.355799 +v -0.262500 0.290571 0.092896 +v 0.262500 -0.234429 0.092896 +v 0.065019 -0.337090 -0.339524 +v 0.065019 -0.337090 -0.242037 +v -0.262500 -0.234429 0.092896 +v -0.262500 0.256505 -0.133796 +v 0.048744 -0.337090 -0.225761 +v -0.228434 0.290571 -0.133796 +v -0.065019 -0.337090 -0.242037 +v 0.228434 0.290571 -0.133796 +v -0.048744 -0.337090 -0.225761 +v 0.262500 0.256505 -0.133796 +v 0.262500 -0.200363 -0.133796 +v 0.228434 -0.234429 -0.133796 +v -0.228434 -0.234429 -0.133796 +v -0.262500 -0.200363 -0.133796 +v -0.305185 -0.311180 -0.084290 +v -0.339251 -0.277114 -0.084290 +v 0.339251 0.333256 -0.084290 +v 0.305185 0.367322 -0.084290 +v -0.305185 0.367322 -0.084290 +v -0.339251 0.333256 -0.084290 +v 0.339251 -0.277114 -0.084290 +v 0.305185 -0.311180 -0.084290 +v 0.339251 0.333342 0.092896 +v 0.305271 0.367322 0.092896 +v 0.316748 0.344819 0.092896 +v -0.305271 0.367322 0.092896 +v -0.339251 0.333342 0.092896 +v -0.316748 0.344819 0.092896 +v 0.305271 -0.311180 0.092896 +v 0.339251 -0.277200 0.092896 +v 0.316748 -0.288677 0.092896 +v -0.339251 -0.277200 0.092896 +v -0.305271 -0.311180 0.092896 +v -0.316748 -0.288677 0.092896 +v 0.219945 0.269868 -0.499021 +v 0.228515 0.290571 -0.478319 +v 0.241798 0.248016 -0.499021 +v 0.262500 0.256586 -0.478319 +v 0.241798 -0.150854 -0.499021 +v 0.262500 -0.159424 -0.478319 +v 0.219945 -0.172706 -0.499021 +v 0.228515 -0.193409 -0.478319 +v -0.241798 0.248016 -0.499021 +v -0.262500 0.256586 -0.478319 +v -0.219945 0.269868 -0.499021 +v -0.228515 0.290571 -0.478319 +v -0.219945 -0.172706 -0.499021 +v -0.228515 -0.193409 -0.478319 +v -0.241798 -0.150854 -0.499021 +v -0.262500 -0.159424 -0.478319 +v -0.131250 -0.234429 0.101749 +v 0.000000 -0.233661 0.104777 +v 0.131250 -0.234429 0.101749 +v 0.131250 0.290571 0.101749 +v 0.000000 0.291339 0.105210 +v -0.131250 0.290571 0.101749 +v -0.057767 -0.234429 -0.364857 +v 0.074076 -0.234429 -0.348548 +v 0.057767 -0.234429 -0.364857 +v -0.074076 -0.234429 -0.348548 +v -0.074076 -0.234429 -0.233013 +v 0.074076 -0.234429 -0.233013 +v 0.057767 -0.234429 -0.216704 +v -0.057767 -0.234429 -0.216704 +vt 0.325000 0.725000 +vt 0.375000 0.737500 +vt 0.325000 0.737500 +vt 0.450000 0.675000 +vt 0.500000 0.725000 +vt 0.450000 0.725000 +vt 0.500000 0.675000 +vt 0.450000 0.662500 +vt 0.500000 0.662500 +vt 0.387500 0.725000 +vt 0.437500 0.737500 +vt 0.387500 0.737500 +vt 0.512500 0.725000 +vt 0.562500 0.737500 +vt 0.512500 0.737500 +vt 0.512500 0.675000 +vt 0.562500 0.725000 +vt 0.325000 0.675000 +vt 0.375000 0.725000 +vt 0.387500 0.675000 +vt 0.437500 0.725000 +vt 0.325000 0.787500 +vt 0.375000 0.800000 +vt 0.387500 0.750000 +vt 0.562500 0.662500 +vt 0.562500 0.675000 +vt 0.375000 0.675000 +vt 0.325000 0.662500 +vt 0.375000 0.662500 +vt 0.437500 0.662500 +vt 0.437500 0.675000 +vt 0.512500 0.737500 +vt 0.575000 0.737500 +vt 0.575000 0.725000 +vt 0.512500 0.662500 +vt 0.575000 0.675000 +vt 0.575000 0.662500 +vt 0.387500 0.662500 +vt 0.450000 0.737500 +vt 0.375000 0.737500 +vt 0.337500 0.737500 +vt 0.325000 0.750000 +vt 0.337500 0.800000 +vt 0.387500 0.787500 +vt 0.112500 0.737500 +vt 0.062500 0.687500 +vt 0.112500 0.687500 +vt 0.387500 0.262500 +vt 0.375000 0.375000 +vt 0.375000 0.262500 +vt 0.262500 0.687500 +vt 0.212500 0.737500 +vt 0.212500 0.687500 +vt 0.162500 0.737500 +vt 0.162500 0.687500 +vt 0.187500 0.262500 +vt 0.200000 0.375000 +vt 0.187500 0.375000 +vt 0.162500 0.537500 +vt 0.112500 0.587500 +vt 0.112500 0.537500 +vt 0.162500 0.587500 +vt 0.112500 0.637500 +vt 0.162500 0.637500 +vt 0.212500 0.587500 +vt 0.212500 0.537500 +vt 0.212500 0.637500 +vt 0.262500 0.587500 +vt 0.262500 0.537500 +vt 0.262500 0.637500 +vt 0.562500 0.262500 +vt 0.575000 0.375000 +vt 0.562500 0.375000 +vt 0.600000 0.262500 +vt 0.750000 0.375000 +vt 0.062500 0.587500 +vt 0.062500 0.537500 +vt 0.062500 0.637500 +vt 0.387500 0.412500 +vt 0.387500 0.375000 +vt 0.012500 0.412500 +vt 0.012500 0.375000 +vt -0.000000 0.787500 +vt 0.037500 0.762500 +vt 0.012500 0.787500 +vt 0.562500 0.475000 +vt 0.562500 0.412500 +vt 0.575000 0.412500 +vt 0.187500 0.475000 +vt 0.187500 0.412500 +vt 0.200000 0.412500 +vt 0.212500 0.512500 +vt 0.262500 0.512500 +vt 0.287500 0.737500 +vt 0.012500 0.475000 +vt 0.312500 0.475000 +vt 0.287500 0.512500 +vt 0.325000 0.787500 +vt 0.287500 0.762500 +vt 0.287500 0.687500 +vt 0.312500 0.800000 +vt 0.012500 0.800000 +vt 0.037500 0.537500 +vt 0.750000 0.475000 +vt 0.575000 0.475000 +vt 0.112500 0.762500 +vt 0.200000 0.475000 +vt 0.375000 0.412500 +vt 0.375000 0.475000 +vt -0.000000 0.487500 +vt 0.012500 0.487500 +vt 0.312500 0.787500 +vt 0.325000 0.487500 +vt 0.312500 0.487500 +vt 0.012500 0.475000 +vt -0.000000 0.412500 +vt 0.350000 0.262500 +vt 0.450000 0.312500 +vt 0.450000 0.337500 +vt 0.500000 0.337500 +vt 0.487500 0.350000 +vt 0.012500 0.262500 +vt -0.000000 0.375000 +vt 0.387500 0.475000 +vt -0.000000 0.262500 +vt 0.200000 0.250000 +vt 0.187500 0.250000 +vt 0.575000 0.250000 +vt 0.562500 0.250000 +vt -0.000000 0.250000 +vt 0.375000 0.250000 +vt 0.200000 0.262500 +vt 0.350000 0.250000 +vt 0.750000 0.250000 +vt 0.750000 0.262500 +vt 0.337500 0.475000 +vt 0.325000 0.487500 +vt 0.325000 0.650000 +vt 0.112500 0.512500 +vt 0.062500 0.512500 +vt 0.162500 0.512500 +vt 0.062500 0.737500 +vt 0.062500 0.762500 +vt 0.212500 0.762500 +vt 0.262500 0.737500 +vt 0.262500 0.762500 +vt 0.162500 0.762500 +vt 0.500000 0.312500 +vt 0.487500 0.300000 +vt 0.462500 0.300000 +vt 0.462500 0.350000 +vt 0.575000 0.262500 +vt 0.037500 0.637500 +vt 0.037500 0.512500 +vt 0.037500 0.575000 +vt 0.037500 0.687500 +vt 0.750000 0.412500 +vt 0.287500 0.537500 +vt 0.287500 0.575000 +vt 0.287500 0.637500 +vt 0.037500 0.737500 +vt -0.000000 0.475000 +vt 0.012500 0.250000 +vt 0.387500 0.250000 +vt 0.600000 0.250000 +vt 0.337500 0.662500 +vt 0.525000 0.662500 +vt 0.537500 0.650000 +vt 0.537500 0.487500 +vt 0.525000 0.475000 +vn 0.8578 0.5139 0.0000 +vn -1.0000 0.0000 0.0000 +vn -0.8301 -0.5576 0.0000 +vn 0.0000 0.5139 0.8578 +vn 0.0000 0.5139 -0.8578 +vn 0.0000 0.0000 -1.0000 +vn 1.0000 0.0000 0.0000 +vn 0.0000 0.0000 1.0000 +vn 0.0000 -1.0000 -0.0000 +vn 0.0000 -0.5576 -0.8301 +vn 0.8301 -0.5576 0.0000 +vn 0.0000 -0.5576 0.8301 +vn -0.5130 -0.6882 0.5130 +vn -0.5397 0.6460 -0.5397 +vn 0.5397 0.6460 -0.5397 +vn 0.5397 0.6460 0.5397 +vn -0.7071 0.0001 0.7071 +vn -0.5130 -0.6882 -0.5130 +vn 0.5130 -0.6882 -0.5130 +vn 0.5130 -0.6882 0.5130 +vn -0.7071 0.0001 -0.7071 +vn 0.7071 0.0001 -0.7071 +vn 0.7071 0.0001 0.7071 +vn -0.5397 0.6460 0.5397 +vn -0.8578 0.5139 0.0000 +vn -0.0339 0.0525 0.9980 +vn -0.0525 0.0339 0.9980 +vn -0.0385 0.0385 0.9985 +vn -0.7046 -0.7046 -0.0837 +vn 0.0525 0.0339 0.9980 +vn 0.0339 0.0525 0.9980 +vn 0.0385 0.0385 0.9985 +vn 0.0000 0.0572 0.9984 +vn 0.0000 0.0484 0.9988 +vn -0.7071 0.7071 0.0002 +vn -0.0000 -0.0572 0.9984 +vn -0.0385 -0.0385 0.9985 +vn -0.0339 -0.0525 0.9980 +vn -0.0000 -0.0484 0.9988 +vn -0.0484 0.0000 0.9988 +vn 0.0385 -0.0385 0.9985 +vn 0.0339 -0.0525 0.9980 +vn 0.0484 -0.0000 0.9988 +vn 0.0525 -0.0339 0.9980 +vn 0.0637 -0.0637 0.9959 +vn 0.0572 -0.0000 0.9984 +vn 0.7046 -0.7046 -0.0837 +vn -0.0525 -0.0339 0.9980 +vn -0.0637 -0.0637 0.9959 +vn -0.0572 0.0000 0.9984 +vn -0.0000 -0.5420 -0.8403 +vn 0.0000 0.5420 -0.8403 +vn 0.0204 0.0104 0.9997 +vn 0.0297 -0.0165 0.9994 +vn 0.5420 0.0000 -0.8403 +vn 0.0000 1.0000 0.0000 +vn -0.5420 0.0000 -0.8403 +vn 0.0008 1.0000 -0.0002 +vn 0.0052 0.9999 0.0090 +vn -0.0297 0.0165 0.9994 +vn 0.0201 -0.0104 0.9997 +vn 0.0297 0.0165 0.9994 +vn 0.0286 -0.0504 0.9983 +vn 0.0009 -1.0000 0.0018 +vn 0.0020 -1.0000 0.0094 +vn -0.0204 0.0104 0.9997 +vn -0.0201 -0.0104 0.9997 +vn 0.7071 0.7071 -0.0003 +vn -0.7071 0.7071 -0.0003 +vn -0.0653 -0.9968 -0.0469 +vn -0.1280 -0.9858 -0.1089 +vn 0.0653 -0.9968 -0.0469 +vn 0.2934 -0.2934 -0.9098 +vn 0.2934 0.2934 -0.9098 +vn -0.2934 -0.2934 -0.9098 +vn -0.2934 0.2934 -0.9098 +vn -0.7071 -0.7071 -0.0003 +vn 0.7071 -0.7071 -0.0003 +vn 0.7071 0.7071 0.0002 +vn -0.5000 0.5000 -0.7070 +vn 0.5000 -0.5000 -0.7070 +vn 0.5000 0.5000 -0.7070 +vn -0.5000 -0.5000 -0.7070 +vn 0.0000 -0.7071 -0.7071 +vn -0.7071 0.0000 -0.7071 +vn 0.0000 0.7071 -0.7071 +vn 0.7071 0.0000 -0.7071 +vn -0.0009 1.0000 -0.0018 +vn -0.0024 1.0000 -0.0093 +vn -0.0007 0.9999 -0.0122 +vn -0.0020 1.0000 -0.0095 +vn -0.0052 -0.9999 -0.0091 +vn -0.0008 -1.0000 0.0002 +vn 0.0023 -1.0000 0.0093 +vn 0.1280 -0.9858 -0.1089 +vn 0.0502 -0.9610 -0.2719 +vn 0.0989 -0.9734 -0.2067 +vn -0.0989 -0.9734 -0.2067 +vn -0.0502 -0.9610 -0.2719 +vn -0.0637 0.0637 0.9959 +vn 0.0637 0.0637 0.9959 +vn 0.0000 0.1434 0.9897 +vn -0.0297 -0.0165 0.9994 +vn -0.0320 0.0425 0.9986 +vn 0.0320 0.0425 0.9986 +vn -0.0286 -0.0504 0.9983 +vn 0.0000 -0.1379 0.9904 +vn 0.0007 -0.9999 0.0121 +usemtl Material +s off +f 56/25/7 21/26/7 30/27/7 +f 34/28/8 50/29/8 62/30/8 +f 39/31/9 116/32/9 115/33/9 +f 60/34/10 10/35/10 23/36/10 +f 51/37/11 28/38/11 18/39/11 +f 38/40/12 53/41/12 51/37/12 +f 42/42/13 57/43/13 56/25/13 +f 46/44/14 64/45/14 60/34/14 +f 15/46/15 28/47/15 21/48/15 +f 38/40/16 114/49/16 44/50/16 +f 48/51/17 113/52/17 117/53/17 +f 46/44/18 119/54/18 35/55/18 +f 116/32/19 35/55/19 119/54/19 +f 51/37/20 15/56/20 50/29/20 +f 30/57/21 53/41/21 56/58/21 +f 23/36/22 57/43/22 60/34/22 +f 35/55/23 62/30/23 64/45/23 +f 39/31/24 112/59/24 38/40/24 +f 42/60/25 114/49/25 113/61/25 +f 48/51/26 118/62/26 46/44/26 +f 51/37/27 39/31/27 38/40/27 +f 56/58/28 44/50/28 42/60/28 +f 60/34/29 48/51/29 46/44/29 +f 10/35/30 62/30/30 11/63/30 +f 62/30/31 15/56/31 11/63/31 +f 56/25/7 57/43/7 21/26/7 +f 34/28/8 39/31/8 50/29/8 +f 39/31/9 34/28/9 116/32/9 +f 60/34/10 64/45/10 10/35/10 +f 51/37/11 53/41/11 28/38/11 +f 38/40/12 44/50/12 53/41/12 +f 42/42/13 48/51/13 57/43/13 +f 46/44/14 35/55/14 64/45/14 +f 21/48/15 23/64/15 10/65/15 +f 10/65/15 11/66/15 15/46/15 +f 15/46/15 18/67/15 28/47/15 +f 28/47/15 30/68/15 21/48/15 +f 21/48/15 10/65/15 15/46/15 +f 38/40/16 112/59/16 114/49/16 +f 48/51/17 42/42/17 113/52/17 +f 46/44/18 118/62/18 119/54/18 +f 116/32/19 34/28/19 35/55/19 +f 51/37/20 18/39/20 15/56/20 +f 30/57/21 28/38/21 53/41/21 +f 23/36/22 21/26/22 57/43/22 +f 35/55/23 34/28/23 62/30/23 +f 39/31/24 115/33/24 112/59/24 +f 42/60/25 44/50/25 114/49/25 +f 48/51/26 117/53/26 118/62/26 +f 51/37/27 50/29/27 39/31/27 +f 56/58/28 53/41/28 44/50/28 +f 60/34/29 57/43/29 48/51/29 +f 10/35/30 64/45/30 62/30/30 +f 62/30/31 50/29/31 15/56/31 +s 1 +f 19/69/32 27/70/33 45/71/34 +f 103/72/35 69/73/35 105/74/35 +f 29/75/36 16/76/37 33/77/38 +f 33/77/38 17/78/39 40/79/40 +f 17/78/39 45/71/34 40/79/40 +f 101/80/41 59/81/41 61/82/41 +f 22/83/42 49/84/43 20/85/44 +f 43/86/45 47/87/46 49/84/43 +f 40/79/40 47/87/46 41/88/14 +f 37/89/47 22/83/42 24/90/48 +f 36/91/49 43/86/45 37/89/47 +f 36/91/49 40/79/40 41/88/14 +f 32/92/50 24/90/48 12/93/51 +f 31/94/52 37/89/47 32/92/50 +f 31/94/52 33/77/38 36/91/49 +f 97/95/53 66/96/53 67/97/53 +f 95/98/13 65/99/13 66/96/13 +f 20/85/44 25/100/54 14/101/55 +f 49/84/43 26/102/56 25/100/54 +f 45/71/34 26/102/56 47/87/46 +f 67/97/57 70/103/57 68/104/57 +f 61/82/58 73/105/58 63/106/58 +f 79/107/59 52/108/60 80/109/14 +f 84/110/15 70/103/15 77/111/15 +f 65/99/61 76/112/61 66/96/61 +f 81/113/62 73/105/62 74/114/62 +f 69/73/63 75/115/63 59/81/63 +f 12/93/64 108/116/65 55/117/62 +f 52/118/8 29/75/8 31/94/8 +f 82/119/14 87/120/14 58/121/66 +f 84/122/67 55/123/68 108/124/69 +f 85/125/14 78/126/14 52/108/60 +f 58/127/13 25/100/13 26/102/13 +f 76/112/13 78/128/13 85/129/13 +f 111/130/70 19/69/15 17/78/71 +f 82/131/8 71/132/8 87/133/8 +f 78/126/14 79/107/59 80/109/14 +f 81/134/72 82/119/14 83/135/14 +f 84/122/67 85/125/14 86/136/14 +f 87/120/14 88/137/73 89/138/14 +f 79/139/74 72/140/74 73/105/74 +f 74/114/75 82/131/75 81/113/75 +f 59/81/8 105/141/8 69/73/8 +f 68/104/76 115/142/77 116/143/15 +f 117/144/15 67/97/78 118/145/15 +f 77/111/79 66/96/79 76/112/79 +f 101/80/62 63/106/62 91/146/62 +f 63/106/80 72/140/80 65/147/80 +f 71/132/81 68/104/81 70/103/81 +f 61/82/82 75/115/82 74/114/82 +f 88/148/83 71/132/83 70/103/83 +f 77/111/84 85/129/84 84/110/84 +f 63/106/85 93/149/85 91/146/85 +f 98/150/86 101/80/86 100/151/86 +f 94/152/87 97/95/87 96/153/87 +f 92/154/88 91/146/88 93/149/88 +f 104/155/89 103/72/89 105/74/89 +f 103/72/90 96/153/90 97/95/90 +f 99/156/91 104/157/91 105/141/91 +f 91/146/92 100/151/92 101/80/92 +f 95/98/93 92/158/93 93/159/93 +f 102/160/12 104/161/12 98/162/12 +f 106/163/94 14/101/62 58/164/62 +f 108/116/65 12/93/64 107/165/95 +f 107/165/95 24/90/96 22/83/97 +f 13/166/15 111/130/70 54/167/15 +f 109/168/98 9/169/99 52/170/15 +f 110/171/100 9/169/99 109/168/98 +f 113/172/101 67/97/78 117/144/15 +f 114/173/102 97/95/103 113/172/101 +f 103/72/104 114/173/102 112/174/105 +f 115/142/77 103/72/104 112/174/105 +f 119/175/15 68/104/76 116/143/15 +f 118/145/15 68/104/76 119/175/15 +f 19/69/32 13/166/106 27/70/33 +f 103/72/35 68/104/35 69/73/35 +f 29/75/36 9/169/107 16/76/37 +f 33/77/38 16/76/37 17/78/39 +f 17/78/39 19/69/32 45/71/34 +f 101/80/41 99/156/41 59/81/41 +f 22/83/42 43/86/45 49/84/43 +f 43/86/45 41/88/14 47/87/46 +f 40/79/40 45/71/34 47/87/46 +f 37/89/47 43/86/45 22/83/42 +f 36/91/49 41/88/14 43/86/45 +f 36/91/49 33/77/38 40/79/40 +f 32/92/50 37/89/47 24/90/48 +f 31/94/52 36/91/49 37/89/47 +f 31/94/52 29/75/36 33/77/38 +f 97/95/53 95/176/53 66/96/53 +f 95/98/13 93/159/13 65/99/13 +f 20/85/44 49/84/43 25/100/54 +f 49/84/43 47/87/46 26/102/56 +f 45/71/34 27/70/33 26/102/56 +f 67/97/57 77/111/57 70/103/57 +f 61/82/58 74/114/58 73/105/58 +f 79/107/59 81/134/72 110/177/108 +f 81/134/72 83/135/14 54/178/109 +f 110/177/108 81/134/72 111/179/110 +f 54/178/109 111/179/110 81/134/72 +f 110/177/108 109/180/111 79/107/59 +f 109/180/111 52/108/60 79/107/59 +f 84/110/15 88/148/15 70/103/15 +f 65/99/61 72/181/61 76/112/61 +f 81/113/62 79/139/62 73/105/62 +f 69/73/63 71/132/63 75/115/63 +f 12/93/8 55/182/8 32/92/8 +f 55/182/8 52/118/8 31/94/8 +f 32/92/8 55/182/8 31/94/8 +f 52/118/8 9/169/8 29/75/8 +f 87/120/14 89/138/14 58/121/66 +f 58/121/66 54/178/109 82/119/14 +f 54/178/109 83/135/14 82/119/14 +f 106/183/112 58/121/66 88/137/73 +f 58/121/66 89/138/14 88/137/73 +f 88/137/73 84/122/67 107/184/113 +f 106/183/112 88/137/73 107/184/113 +f 84/122/67 86/136/14 55/123/68 +f 108/124/69 107/184/113 84/122/67 +f 78/126/14 80/109/14 52/108/60 +f 52/108/60 55/123/68 85/125/14 +f 55/123/68 86/136/14 85/125/14 +f 13/166/13 54/185/13 27/70/13 +f 54/185/13 58/127/13 26/102/13 +f 27/70/13 54/185/13 26/102/13 +f 58/127/13 14/101/13 25/100/13 +f 76/112/13 72/181/13 78/128/13 +f 9/169/99 110/171/100 16/76/114 +f 110/171/100 111/130/70 17/78/71 +f 16/76/114 110/171/100 17/78/71 +f 111/130/70 13/166/15 19/69/15 +f 82/131/8 75/115/8 71/132/8 +f 79/139/74 78/186/74 72/140/74 +f 74/114/75 75/115/75 82/131/75 +f 59/81/8 99/156/8 105/141/8 +f 68/104/76 103/72/104 115/142/77 +f 77/111/79 67/97/79 66/96/79 +f 101/80/62 61/82/62 63/106/62 +f 63/106/80 73/105/80 72/140/80 +f 71/132/81 69/73/81 68/104/81 +f 61/82/82 59/81/82 75/115/82 +f 88/148/83 87/133/83 71/132/83 +f 77/111/84 76/112/84 85/129/84 +f 63/106/85 65/147/85 93/149/85 +f 98/150/86 99/156/86 101/80/86 +f 94/152/87 95/176/87 97/95/87 +f 92/154/88 90/187/88 91/146/88 +f 104/155/89 102/188/89 103/72/89 +f 103/72/90 102/188/90 96/153/90 +f 99/156/91 98/150/91 104/157/91 +f 91/146/92 90/187/92 100/151/92 +f 95/98/93 94/189/93 92/158/93 +f 98/162/12 100/190/12 102/160/12 +f 100/190/12 90/191/12 102/160/12 +f 90/191/12 92/192/12 94/193/12 +f 94/193/12 96/194/12 90/191/12 +f 96/194/12 102/160/12 90/191/12 +f 14/101/62 106/163/94 20/85/62 +f 106/163/94 107/165/95 22/83/97 +f 20/85/62 106/163/94 22/83/97 +f 107/165/95 12/93/64 24/90/96 +f 113/172/101 97/95/103 67/97/78 +f 103/72/104 97/95/103 114/173/102 +f 118/145/15 67/97/78 68/104/76 +o Cube.002 +v -0.182506 -0.376577 0.025979 +v -0.202175 -0.376577 0.006310 +v -0.202175 -0.376577 -0.479353 +v -0.182475 -0.376637 -0.499021 +v 0.202175 -0.376577 0.006310 +v -0.236819 -0.500000 0.112318 +v 0.182506 -0.376577 0.025979 +v -0.262500 -0.500000 0.000000 +v 0.182509 -0.376637 -0.499021 +v -0.262500 -0.376637 0.000000 +v -0.236819 -0.376637 0.112318 +v 0.202175 -0.376577 -0.479353 +v 0.262500 -0.500000 0.000000 +v -0.168634 -0.353125 -0.007583 +v -0.202175 -0.356313 0.006310 +v 0.236819 -0.500000 0.112318 +v 0.236819 -0.376637 0.112318 +v -0.182506 -0.356313 0.025979 +v 0.262500 -0.376637 0.000000 +v -0.168634 -0.353125 -0.465459 +v -0.262500 -0.500000 -0.434422 +v -0.182506 -0.356313 -0.499021 +v -0.242168 -0.500000 -0.499021 +v -0.242168 -0.376637 -0.499021 +v -0.202175 -0.356313 -0.479353 +v -0.262500 -0.376637 -0.434422 +v 0.168634 -0.353125 -0.007583 +v 0.242168 -0.500000 -0.499021 +v 0.262500 -0.500000 -0.434422 +v 0.182506 -0.356313 0.025979 +v 0.262500 -0.376637 -0.434422 +v 0.202175 -0.356313 0.006310 +v 0.242168 -0.376637 -0.499021 +v -0.236819 -0.391892 0.112318 +v 0.168634 -0.353125 -0.465459 +v 0.202175 -0.356313 -0.479353 +v -0.262500 -0.391892 0.000000 +v 0.236819 -0.391892 0.112318 +v 0.182506 -0.356313 -0.499021 +v 0.262500 -0.391892 0.000000 +v 0.243379 -0.391892 0.123162 +v -0.269772 -0.391892 0.010843 +v -0.243379 -0.500000 0.123162 +v -0.269772 -0.500000 0.010843 +v 0.243379 -0.500000 0.123162 +v 0.269772 -0.500000 0.010843 +v -0.243379 -0.391892 0.123162 +v 0.269772 -0.391892 0.010843 +vt 0.737500 0.775000 +vt 0.750000 0.787500 +vt 0.737500 0.787500 +vt 0.975000 0.787500 +vt 0.962500 0.775000 +vt 0.975000 0.775000 +vt 0.962500 0.725000 +vt 0.750000 0.712500 +vt 0.962500 0.712500 +vt 0.962500 0.062500 +vt 0.962500 0.350000 +vt 0.750000 0.062500 +vt 0.975000 0.725000 +vt 0.937500 0.400000 +vt 0.925000 0.712500 +vt 0.925000 0.400000 +vt 0.737500 0.787500 +vt 0.962500 0.787500 +vt 0.962500 0.712500 +vt 0.975000 0.400000 +vt 0.975000 0.712500 +vt 0.950000 0.700000 +vt 0.950000 0.412500 +vt 0.750000 0.750000 +vt 0.962500 0.750000 +vt 0.950000 0.412500 +vt 0.962500 0.400000 +vt 0.750000 0.775000 +vt 0.962500 0.750000 +vt 0.750000 0.725000 +vt 0.737500 0.712500 +vt 0.650000 0.075000 +vt 0.362500 0.062500 +vt 0.650000 0.062500 +vt 0.575000 0.475000 +vt 0.700000 0.475000 +vt 0.575000 0.662500 +vt 0.350000 0.162500 +vt 0.412500 0.225000 +vt 0.350000 0.225000 +vt 0.425000 0.225000 +vt 0.425000 0.162500 +vt 0.687500 0.162500 +vt 0.350000 0.150000 +vt 0.425000 0.137500 +vt 0.350000 0.137500 +vt 0.425000 0.075000 +vt 0.412500 0.137500 +vt 0.725000 0.000000 +vt 0.937500 0.000000 +vt 0.975000 0.062500 +vt 0.725000 0.075000 +vt 0.687500 0.150000 +vt 0.725000 0.150000 +vt 0.725000 0.237500 +vt 0.687500 0.237500 +vt 0.750000 0.487500 +vt 0.712500 0.475000 +vt 0.762500 0.487500 +vt 0.537500 0.150000 +vt 0.350000 0.162500 +vt 0.350000 0.150000 +vt 0.762500 0.650000 +vt 0.750000 0.650000 +vt 0.350000 0.225000 +vt 0.425000 0.237500 +vt 0.350000 0.237500 +vt 0.587500 0.162500 +vt 0.537500 0.162500 +vt 0.350000 0.137500 +vt 0.412500 0.075000 +vt 0.350000 0.075000 +vt 0.412500 0.162500 +vt 0.687500 0.075000 +vt 0.587500 0.162500 +vt 0.637500 0.150000 +vt 0.637500 0.162500 +vt 0.712500 0.662500 +vt 0.700000 0.662500 +vt 0.350000 0.062500 +vt 0.662500 0.000000 +vt 0.662500 0.062500 +vt 0.912500 0.412500 +vt 0.862500 0.687500 +vt 0.862500 0.375000 +vt 0.750000 0.775000 +vt 0.750000 0.350000 +vt 0.975000 0.712500 +vt 0.937500 0.712500 +vt 0.737500 0.725000 +vt 0.750000 0.750000 +vt 0.737500 0.775000 +vt 0.950000 0.700000 +vt 0.362500 0.075000 +vt 0.537500 0.650000 +vt 0.537500 0.487500 +vt 0.425000 0.150000 +vt 0.975000 0.000000 +vt 0.662500 0.062500 +vt 0.662500 0.000000 +vt 0.725000 0.162500 +vt 0.587500 0.150000 +vt 0.587500 0.150000 +vt 0.350000 0.000000 +vt 0.862500 0.687500 +vt 0.875000 0.700000 +vt 0.825000 0.700000 +vt 0.812500 0.650000 +vt 0.812500 0.350000 +vt 0.862500 0.375000 +vt 0.925000 0.350000 +vt 0.925000 0.400000 +vt 0.812500 0.350000 +vt 0.812500 0.650000 +vt 0.762500 0.375000 +vt 0.800000 0.700000 +vt 0.762500 0.687500 +vt 0.750000 0.700000 +vt 0.925000 0.712500 +vt 0.925000 0.662500 +vt 0.912500 0.650000 +vn -0.7071 0.0000 -0.7071 +vn 0.7071 0.0000 -0.7071 +vn 0.0000 0.0000 1.0000 +vn 0.0000 1.0000 0.0000 +vn 0.7071 0.0000 0.7071 +vn -1.0000 0.0000 0.0000 +vn 0.0000 0.0000 -1.0000 +vn 1.0000 0.0000 0.0000 +vn -0.0946 0.9955 0.0000 +vn 0.0000 0.9955 0.0946 +vn 0.0946 0.9955 0.0000 +vn 0.0000 0.9955 -0.0946 +vn -0.7071 0.0000 0.7071 +vn 0.0000 -1.0000 0.0000 +vn 0.9735 0.0000 0.2288 +vn -0.9748 0.0000 0.2229 +vn -0.8305 0.0000 -0.5570 +vn -0.9539 0.0000 -0.3002 +vn 0.9539 0.0000 -0.3002 +vn 0.9748 0.0000 0.2229 +vn -0.9735 0.0000 0.2288 +vn 0.8305 0.0000 -0.5570 +vn 0.0000 1.0000 0.0007 +vn -0.7066 -0.0011 -0.7077 +vn 0.7072 0.0001 -0.7071 +vn -0.0669 0.9955 0.0669 +vn -0.0669 0.9955 -0.0669 +vn 0.0669 0.9955 -0.0669 +vn 0.0669 0.9955 0.0669 +vn 0.0000 1.0000 -0.0031 +vn -0.0013 1.0000 -0.0004 +vn -0.0010 1.0000 0.0000 +vn 0.0010 1.0000 0.0002 +vn 0.0010 1.0000 0.0000 +vn 0.0013 1.0000 -0.0004 +vn -0.0010 1.0000 0.0002 +vn -0.0004 1.0000 0.0004 +vn 0.0004 1.0000 0.0004 +s off +f 141/195/115 122/196/115 144/197/115 +f 131/198/116 158/199/116 155/200/116 +f 149/201/117 120/202/117 126/203/117 +f 146/204/118 154/205/118 133/206/118 +f 126/203/119 151/207/119 149/201/119 +f 134/208/120 122/209/120 121/210/120 +f 123/211/121 158/199/121 128/212/121 +f 155/213/122 124/214/122 131/215/122 +f 139/216/123 134/208/123 133/217/123 +f 133/218/124 149/201/124 146/219/124 +f 155/213/125 146/220/125 151/221/125 +f 141/222/126 154/223/126 158/199/126 +f 137/224/127 121/225/127 120/202/127 +f 136/226/117 153/227/117 157/228/117 +f 148/229/128 132/230/128 140/231/128 +f 164/232/129 167/233/129 160/234/129 +f 159/235/122 132/236/122 148/237/122 +f 130/238/130 156/239/130 153/240/130 +f 127/241/131 161/242/131 156/239/131 +f 123/243/121 128/244/121 147/245/121 +f 142/246/132 145/247/132 143/248/132 +f 148/237/133 152/249/133 150/250/133 +f 135/251/128 165/252/128 164/253/128 +f 153/254/118 160/255/118 157/256/118 +f 135/251/128 162/257/128 125/258/128 +f 157/259/134 138/260/134 136/261/134 +f 153/254/118 161/262/118 166/263/118 +f 166/264/135 163/265/135 162/266/135 +f 159/235/136 165/267/136 132/236/136 +f 140/268/120 156/239/120 145/247/120 +f 157/269/118 167/270/118 159/271/118 +f 125/258/128 163/272/128 127/273/128 +f 166/274/117 164/275/117 160/276/117 +f 126/277/137 130/278/137 136/279/137 +f 141/195/138 123/280/138 122/196/138 +f 131/198/139 128/212/139 158/199/139 +f 149/201/117 137/224/117 120/202/117 +f 139/281/118 133/206/118 154/205/118 +f 126/203/119 124/282/119 151/207/119 +f 134/208/120 144/283/120 122/209/120 +f 123/211/121 141/195/121 158/199/121 +f 155/213/122 151/221/122 124/214/122 +f 133/218/140 134/284/140 137/224/140 +f 139/285/141 141/222/141 144/286/141 +f 154/223/142 155/200/142 158/199/142 +f 146/219/143 149/201/143 151/207/143 +f 139/216/123 144/283/123 134/208/123 +f 133/218/124 137/224/124 149/201/124 +f 155/213/125 154/287/125 146/220/125 +f 141/222/126 139/285/126 154/223/126 +f 137/224/127 134/284/127 121/225/127 +f 136/226/117 130/288/117 153/227/117 +f 132/230/128 135/251/128 125/258/128 +f 125/258/128 127/273/128 132/230/128 +f 127/273/128 140/231/128 132/230/128 +f 140/231/128 142/289/128 147/290/128 +f 147/290/128 148/229/128 140/231/128 +f 164/232/129 165/267/129 167/233/129 +f 148/237/122 150/250/122 159/235/122 +f 150/250/122 138/260/122 159/235/122 +f 130/238/130 129/291/130 156/239/130 +f 127/241/131 163/265/131 161/242/131 +f 128/244/121 152/292/121 147/245/121 +f 147/245/121 142/293/121 123/243/121 +f 142/293/121 143/294/121 123/243/121 +f 142/246/132 140/268/132 145/247/132 +f 148/237/133 147/295/133 152/249/133 +f 135/251/128 132/230/128 165/252/128 +f 153/254/118 166/263/118 160/255/118 +f 135/251/128 164/253/128 162/257/128 +f 157/259/134 159/235/134 138/260/134 +f 153/254/118 156/296/118 161/262/118 +f 166/264/135 161/242/135 163/265/135 +f 159/235/136 167/233/136 165/267/136 +f 127/241/120 156/239/120 140/268/120 +f 156/239/120 129/291/120 145/247/120 +f 157/269/118 160/297/118 167/270/118 +f 125/258/128 162/257/128 163/272/128 +f 166/274/117 162/298/117 164/275/117 +f 122/299/144 123/300/144 143/301/144 +f 143/301/145 145/302/145 122/299/145 +f 145/302/146 129/303/146 121/304/146 +f 136/279/147 138/305/147 124/306/147 +f 138/307/148 150/308/148 124/309/148 +f 150/308/149 152/310/149 131/311/149 +f 152/310/144 128/312/144 131/311/144 +f 145/302/146 121/304/146 122/299/146 +f 129/313/150 130/278/150 121/314/150 +f 150/308/148 131/311/148 124/309/148 +f 120/315/151 121/314/151 130/278/151 +f 136/279/152 124/306/152 126/277/152 +f 126/277/137 120/315/137 130/278/137 diff --git a/src/main/resources/assets/hbm/textures/blocks/deco_computer_0.png b/src/main/resources/assets/hbm/textures/blocks/deco_computer_0.png new file mode 100644 index 0000000000000000000000000000000000000000..fab8d3cd29d30ca65fe69a95c6644973ad8c4c65 GIT binary patch literal 1832 zcmV+@2iN$CP)Px#1ZP1_K>z@;j|==^1poj5U{Fj{MZC18g@1LrvZTGWr@pqRxv`_Wv!%DMp})7O zz__ZxxvRFWpa1{>|NsBEu%d>5cDS&kwXUGTx~#*yt+lP6I5sjjH8D9iGpnSR92*%U zBqK62F|DSVsidAaI5q$P0B8w(F8}}lAaqhrQ~&?}|NsC0|NsC0|NsC0|NsC0|NsC0 z|NsC0|NsC009;%f?EnA(32;bRa{vGi!vFvd!vV){sAK>D1|>;EK~z{r?U(Cz+cpq{ zSpbA7yJ6d;P7~Ly-v2H0&Fm5pb+K|z`mY|v5(xscvllFp>G&Vxo$%-JPWbb9C;WN* z9|>>c7a^zpICAkd+$Ee!&a7>kX8s!f=8({*npc7Qgac-NU_FBkW-z!K59^|0Lt0kdh}nhNt)8@~>yWi53dakW_)GLSxPhrU|95 zCr{wR2M9rO?2uFeMXRGtyg)w?&K)sHm4L9;wI;_7Np%TyA+y|cnddz@cF5%kd8(u= zx+v>B%_8J(NuGhFlCtF3A(=Kzz48gxG9AKYsY#vzo=?+nNpgxL+Mt9GIrtu@rAJbH zn>+)NwOUp^4fFaoD2|x|q|g{*BKNq-pYBaq$~A>$uGD@2^Hhi8&Ke5#iF#g&e3e1S zcxnyZgosU^f!Su6{kWOWW%kFqbS<6az~j|hTZC9TB+tNFld+SWFyFk)qa=bGZC&k< z+S|cgB)5jb`NCz^seAApyey5@k#>wePX~*ihz^8PIauK%!jorUiA`XPjRllQBU{Qy z4uQ3{P-MYn0mGq9*0$e)z}ZcQ+ihgK^6mx{Lm zKUAitcI<85n!_@l_P($+qOt^Q+mP>w7-%7d34m>Ps!%Z^LP4{}6nhp+WuAx~{Gha` zoR9pqksM~1jS#G`nzK@}gfPnv^%!M(0Fw3C-C7x=yEE%!Y+2fYNtWd@nV z9quXeQpw++%ctq1O|ZaEOD(+Fw465N?#E>$hnP`^A2WtPUSVb1nwrDAv6DVWfr!lq zRKct4S+GQH$!W{dxmlVB^$0M1^v!6(VC@IEL?nB9|JPAc_=A^Qauh?HPle}wQyx~OBF|QI)!>{(#(*O zc_$U`79txA#W zzEOrvh`}p;Qw)@zYu@H#gyPl+CGZH3C@50`XHWIxi!c&1SrS4rs%f3#YznCZpx1v~ z>1WsYMCdoxMc;&ec<45h_bz>J6XU$`iBJjgeHilAq#C<0Y2jWu}14~DI#iIHe(!DV z8tu+q;}fASWzDsiTT_`~yigZZ3{7ig-)Pd41u#)FdbRq~#wWr|7r;VpO%8o_5{1my zQa`22k4RN!MJf_mQM|M9Z7#FKlKdwq2OI$Wm@^QBbcLm^?swH&(IyPmZjDcb{GH%= zha9{KtYP`2@o6j`Z3v>z@$+oQ6xNkWDr zWr~LpjqjXri`@qN&<^t4T7pcUSuqgddE>jPF#Pv7nRC$f|4bE}vf6}?e5{OlW_3BNw`@A~In*<3WfdkPgkroL4+`^J|F zZ+yP~K-owgv$n=}PoZYNSvFwT`0gsaS2hU@GlRx=PvP;#DTH-~OW?HeY3x+f{`2*D zX)k{>Eux;%8n3L^o5zzo3a9Dig=zmJIw!AxL4RfN`tigHPeh%57+2=3%cm{tWNE9f z)&}9l@#Ky|YY0z;cvWKM6+f>ZPeS34WQ>i&PAT1oSG_R`4OBXHmXgboeR(`N9=`$1 WAUb+)kQ2xN0000 Date: Sun, 4 Sep 2022 22:55:50 -0700 Subject: [PATCH 04/12] meh --- src/main/java/com/hbm/render/block/RenderBlockDecoModel.java | 1 + src/main/resources/assets/hbm/lang/en_US.lang | 1 + 2 files changed, 2 insertions(+) diff --git a/src/main/java/com/hbm/render/block/RenderBlockDecoModel.java b/src/main/java/com/hbm/render/block/RenderBlockDecoModel.java index 4f0b97a2f..769c53838 100644 --- a/src/main/java/com/hbm/render/block/RenderBlockDecoModel.java +++ b/src/main/java/com/hbm/render/block/RenderBlockDecoModel.java @@ -35,6 +35,7 @@ public class RenderBlockDecoModel implements ISimpleBlockRenderingHandler { iicon = renderer.overrideBlockTexture; } + GL11.glRotated(-15, 0, 1, 0); tessellator.startDrawingQuads(); ObjUtil.renderWithIcon((WavefrontObject) model, iicon, tessellator, modelId, false); diff --git a/src/main/resources/assets/hbm/lang/en_US.lang b/src/main/resources/assets/hbm/lang/en_US.lang index c215287bd..cb6f6b8b1 100644 --- a/src/main/resources/assets/hbm/lang/en_US.lang +++ b/src/main/resources/assets/hbm/lang/en_US.lang @@ -3681,6 +3681,7 @@ tile.crystal_virus.name=Dark Crystal tile.deco_aluminium.name=Aluminium Deco Block tile.deco_asbestos.name=Asbestos Roof tile.deco_beryllium.name=Beryllium Deco Block +tile.deco_computer.name=IBM Personal Computer 300PL tile.deco_emitter.name=Deco Light Emitter tile.deco_lead.name=Lead Deco Block tile.deco_rbmk.name=RBMK Deco Block From bf385c831da34b465a27407e51ba92d972dbaa4b Mon Sep 17 00:00:00 2001 From: Vaern Date: Mon, 5 Sep 2022 20:52:23 -0700 Subject: [PATCH 05/12] big office building --- .../java/com/hbm/lib/HbmChestContents.java | 15 ++ .../world/worldgen/components/Feature.java | 64 +++++- .../worldgen/components/OfficeFeatures.java | 197 ++++++++++++++++++ 3 files changed, 275 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/hbm/world/worldgen/components/OfficeFeatures.java diff --git a/src/main/java/com/hbm/lib/HbmChestContents.java b/src/main/java/com/hbm/lib/HbmChestContents.java index 242f67ceb..56cb0a257 100644 --- a/src/main/java/com/hbm/lib/HbmChestContents.java +++ b/src/main/java/com/hbm/lib/HbmChestContents.java @@ -335,4 +335,19 @@ public class HbmChestContents { new WeightedRandomChestContent(ModItems.warhead_mirv, 0, 1, 1, 1), new WeightedRandomChestContent(ModItems.battery_schrabidium_cell, 0, 1, 1, 1), new WeightedRandomChestContent(ModItems.powder_nitan_mix, 0, 16, 32, 1) }; + + public static WeightedRandomChestContent[] officeTrash = new WeightedRandomChestContent[] { + //Meta, Min amount, Max amount, Weight + new WeightedRandomChestContent(Items.paper, 0, 1, 12, 10), + new WeightedRandomChestContent(Items.book, 0, 1, 3, 4), + new WeightedRandomChestContent(ModItems.twinkie, 0, 1, 2, 6), + new WeightedRandomChestContent(ModItems.coffee, 0, 1, 1, 4), + new WeightedRandomChestContent(ModItems.flame_politics, 0, 1, 1, 2), + new WeightedRandomChestContent(ModItems.ring_pull, 0, 1, 1, 4), + new WeightedRandomChestContent(ModItems.can_empty, 0, 1, 1, 2), + new WeightedRandomChestContent(ModItems.can_creature, 0, 1, 2, 2), + new WeightedRandomChestContent(ModItems.can_smart, 0, 1, 3, 2), + new WeightedRandomChestContent(ModItems.can_mrsugar, 0, 1, 2, 2), + new WeightedRandomChestContent(ModItems.book_guide, 3, 1, 1, 1), + new WeightedRandomChestContent(Item.getItemFromBlock(ModBlocks.deco_computer), 0, 1, 1, 1)}; } diff --git a/src/main/java/com/hbm/world/worldgen/components/Feature.java b/src/main/java/com/hbm/world/worldgen/components/Feature.java index 8eb36dc6a..54333f173 100644 --- a/src/main/java/com/hbm/world/worldgen/components/Feature.java +++ b/src/main/java/com/hbm/world/worldgen/components/Feature.java @@ -6,6 +6,7 @@ import com.hbm.blocks.ModBlocks; import com.hbm.blocks.generic.BlockBobble.BobbleType; import com.hbm.blocks.generic.BlockBobble.TileEntityBobble; import com.hbm.config.StructureConfig; +import com.hbm.tileentity.machine.TileEntityLockableBase; import com.hbm.tileentity.machine.storage.TileEntityCrateIron; import net.minecraft.block.Block; @@ -14,6 +15,7 @@ import net.minecraft.init.Blocks; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemDoor; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; import net.minecraft.util.WeightedRandomChestContent; import net.minecraft.world.World; import net.minecraft.world.gen.structure.StructureBoundingBox; @@ -152,6 +154,19 @@ abstract public class Feature extends StructureComponent { return 0; } + /** + * + * @param metadata (0 for facing North, 1 for facing South, 2 for facing West, 3 for facing East) + */ + protected int getDecoModelMeta(int metadata) { + //N: 0b00, S: 0b01, W: 0b10, E: 0b11 + int rot = metadata & 3; + + + + return 0; + } + /** * Places door at specified location with orientation-adjusted meta * don't ask me which directions are what (take direction such as South/0 and add 1) @@ -182,7 +197,36 @@ abstract public class Feature extends StructureComponent { if(inventory != null) { amount = (int)Math.floor(amount * StructureConfig.lootAmountFactor); - WeightedRandomChestContent.generateChestContents(rand, content, inventory, amount); + WeightedRandomChestContent.generateChestContents(rand, content, inventory, amount < 1 ? 1 : amount); + return true; + } + + return false; + } + + + /** + * Block TE MUST extend TileEntityLockableBase, otherwise this will not work and crash! + * @return TE implementing IInventory and extending TileEntityLockableBase with randomized contents + lock + */ + protected boolean generateLockableContents(World world, StructureBoundingBox box, Random rand, Block block, int featureX, int featureY, int featureZ, + WeightedRandomChestContent[] content, int amount, double mod) { + int posX = this.getXWithOffset(featureX, featureZ); + int posY = this.getYWithOffset(featureY); + int posZ = this.getZWithOffset(featureX, featureZ); + + this.placeBlockAtCurrentPosition(world, block, 0, featureX, featureY, featureZ, box); + TileEntity tile = world.getTileEntity(posX, posY, posZ); + TileEntityLockableBase lock = (TileEntityLockableBase) tile; + IInventory inventory = (IInventory) tile; + + if(inventory != null && lock != null) { + lock.setPins(rand.nextInt(999) + 1); + lock.setMod(mod); + lock.lock(); + + amount = (int)Math.floor(amount * StructureConfig.lootAmountFactor); + WeightedRandomChestContent.generateChestContents(rand, content, inventory, amount < 1 ? 1 : amount); return true; } @@ -250,6 +294,24 @@ abstract public class Feature extends StructureComponent { } } + /** Methods that remove the replaceBlock and alwaysReplace, and other parameters: as they are useless and only serve as a time sink normally. */ + + protected void fillWithBlocks(World world, StructureBoundingBox box, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, Block block) { + this.fillWithBlocks(world, box, minX, minY, minZ, maxX, maxY, maxZ, block, block, false); + } + + protected void fillWithMetadataBlocks(World world, StructureBoundingBox box, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, Block block, int meta) { + this.fillWithMetadataBlocks(world, box, minX, minY, minZ, maxX, maxY, maxZ, block, meta, block, meta, false); + } + + protected void randomlyFillWithBlocks(World world, StructureBoundingBox box, Random rand, float randLimit, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, Block block) { + this.randomlyFillWithBlocks(world, box, rand, randLimit, minX, minY, minZ, maxX, maxY, maxZ, block); + } + + protected void fillWithRandomizedBlocks(World world, StructureBoundingBox box, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, Random rand, BlockSelector selector) { + this.fillWithRandomizedBlocks(world, box, minX, minY, minZ, maxX, maxY, maxZ, false, rand, selector); + } + /** Block Selectors **/ static class Sandstone extends StructureComponent.BlockSelector { diff --git a/src/main/java/com/hbm/world/worldgen/components/OfficeFeatures.java b/src/main/java/com/hbm/world/worldgen/components/OfficeFeatures.java new file mode 100644 index 000000000..46169e4d9 --- /dev/null +++ b/src/main/java/com/hbm/world/worldgen/components/OfficeFeatures.java @@ -0,0 +1,197 @@ +package com.hbm.world.worldgen.components; + +import java.util.Random; + +import com.hbm.blocks.ModBlocks; +import com.hbm.lib.HbmChestContents; +import com.hbm.world.worldgen.components.Feature.ConcreteBricks; + +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraft.world.gen.structure.StructureBoundingBox; + +//Oh my fucking god TM +public class OfficeFeatures { + + public static class LargeOffice extends Feature { + + private static ConcreteBricks ConcreteBricks = new ConcreteBricks(); + + private boolean[] hasPlacedLoot = new boolean[2]; + + public LargeOffice() { + super(); + } + + public LargeOffice(Random rand, int minX, int minY, int minZ) { + super(rand, minX, minY, minZ, 14, 5, 12); + this.hasPlacedLoot[0] = false; + this.hasPlacedLoot[1] = false; + } + + @Override + protected void func_143012_a(NBTTagCompound nbt) { + super.func_143012_a(nbt); + nbt.setBoolean("hasLoot1", this.hasPlacedLoot[0]); + nbt.setBoolean("hasLoot2", this.hasPlacedLoot[1]); + } + + @Override + protected void func_143011_b(NBTTagCompound nbt) { + super.func_143011_b(nbt); + this.hasPlacedLoot[0] = nbt.getBoolean("hasLoot1"); + this.hasPlacedLoot[1] = nbt.getBoolean("hasLoot2"); + } + + //Holy shit I despise this method so goddamn much + //TODO BOB: please i beg you make some sort of utility tool to simplify this + //ideally we'd invent something like the structure blocks or even a more advanced + //schematic to java tool + @Override + public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { + + if(!this.setAverageHeight(world, box, this.boundingBox.minY)) { + return true; + } + + this.boundingBox.offset(0, -1, 0); + + //Pillars + fillWithBlocks(world, box, 0, 0, 2, 0, 4, 2, ModBlocks.concrete_pillar); + fillWithBlocks(world, box, 5, 0, 0, 5, 4, 0, ModBlocks.concrete_pillar); + fillWithBlocks(world, box, sizeX, 0, 0, sizeX, 4, 0, ModBlocks.concrete_pillar); + + fillWithBlocks(world, box, 0, 0, 5, 0, 3, 5, ModBlocks.concrete_pillar); + fillWithBlocks(world, box, 0, 0, sizeZ, 0, 3, sizeZ, ModBlocks.concrete_pillar); + fillWithBlocks(world, box, 3, 0, sizeZ, 3, 3, sizeZ, ModBlocks.concrete_pillar); + fillWithBlocks(world, box, 6, 0, sizeZ, 6, 3, sizeZ, ModBlocks.concrete_pillar); + fillWithBlocks(world, box, 9, 0, sizeZ, 9, 3, sizeZ, ModBlocks.concrete_pillar); + fillWithBlocks(world, box, 9, 0, 7, 9, 3, 7, ModBlocks.concrete_pillar); + fillWithBlocks(world, box, sizeX, 0, sizeZ, sizeX, 4, sizeZ, ModBlocks.concrete_pillar); + + //Walls + //Back + fillWithRandomizedBlocks(world, box, 1, 0, 2, 5, 4, 2, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 5, 0, 1, 5, 4, 1, rand, ConcreteBricks); + + fillWithRandomizedBlocks(world, box, 6, 0, 0, sizeX - 1, 1, 0, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 6, 2, 0, 6, 2, 0, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 9, 2, 0, 10, 2, 0, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, sizeX - 2, 2, 0, sizeX - 1, 2, 0, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 6, 3, 0, sizeX - 1, 4, 0, rand, ConcreteBricks); + //Right + fillWithRandomizedBlocks(world, box, sizeX, 0, 1, sizeX, 1, sizeZ - 1, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, sizeX, 2, 1, sizeX, 2, 2, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, sizeX, 2, 5, sizeX, 2, 7, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, sizeX, 2, sizeZ - 2, sizeX, 2, sizeZ - 1, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, sizeX, 3, 1, sizeX, 4, sizeZ - 1, rand, ConcreteBricks); + //Front + fillWithRandomizedBlocks(world, box, 0, 4, sizeZ, sizeX - 1, 4, sizeZ, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 10, 0, sizeZ, sizeX - 1, 1, sizeZ, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 10, 2, sizeZ, 10, 2, sizeZ, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, sizeX - 1, 2, sizeZ, sizeX - 1, 2, sizeZ, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 10, 3, sizeZ, sizeX - 1, 3, sizeZ, rand, ConcreteBricks); + + fillWithRandomizedBlocks(world, box, 9, 0, 8, 9, 3, sizeZ - 1, rand, ConcreteBricks); + + fillWithRandomizedBlocks(world, box, 1, 0, 7, 8, 0, 7, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 1, 1, 7, 1, 2, 7, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 4, 1, 7, 8, 4, 7, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 1, 4, 7, 3, 4, 7, rand, ConcreteBricks); + //Left + fillWithRandomizedBlocks(world, box, 0, 4, 3, 0, 4, sizeZ - 1, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 0, 0, 3, 0, 1, 6, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 0, 2, 3, 0, 3, 3, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 0, 2, 6, 0, 3, 6, rand, ConcreteBricks); + //Interior + fillWithRandomizedBlocks(world, box, 5, 1, 3, 5, 3, 5, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 5, 3, 6, 5, 3, 6, rand, ConcreteBricks); + + //Trim + randomlyFillWithBlocks(world, box, rand, 0.75F, 0, sizeY, 2, 5, sizeY, 2, Blocks.stone_slab); + randomlyFillWithBlocks(world, box, rand, 0.75F, 5, sizeY, 1, 5, sizeY, 1, Blocks.stone_slab); + randomlyFillWithBlocks(world, box, rand, 0.75F, 5, sizeY, 0, sizeX, sizeY, 0, Blocks.stone_slab); + randomlyFillWithBlocks(world, box, rand, 0.75F, sizeX, sizeY, 1, sizeX, sizeY, sizeZ, Blocks.stone_slab); + randomlyFillWithBlocks(world, box, rand, 0.75F, 0, sizeY, sizeZ, sizeX - 1, sizeY, sizeZ, Blocks.stone_slab); + randomlyFillWithBlocks(world, box, rand, 0.75F, 0, sizeY, 3, 0, sizeY, sizeZ - 1, Blocks.stone_slab); + + //Floor + fillWithMetadataBlocks(world, box, 1, 0, 3, 4, 6, hpos, Blocks.wool, 13); //Green Wool + fillWithBlocks(world, box, 5, 0, 3, 5, 0, 6, ModBlocks.brick_light); + fillWithBlocks(world, box, 1, 0, 1, sizeX - 1, 0, 6, ModBlocks.brick_light); + fillWithBlocks(world, box, 10, 0, 7, sizeX - 1, 0, sizeZ - 1, ModBlocks.brick_light); + //Ceiling + fillWithBlocks(world, box, 6, 4, 1, sizeX - 1, 4, 2, ModBlocks.brick_light); + fillWithBlocks(world, box, 1, 4, 3, sizeX - 1, 4, sizeZ - 1, ModBlocks.brick_light); + + //Decorations + //Carpet + fillWithMetadataBlocks(world, box, 9, 1, 3, 11, 1, 6, Blocks.carpet, 8); //Light gray + //Windows + randomlyFillWithBlocks(world, box, rand, 0.75F, 0, 2, 4, 0, 3, 5, Blocks.glass_pane); + randomlyFillWithBlocks(world, box, rand, 0.75F, 7, 2, 0, 8, 2, 0, Blocks.glass_pane); + randomlyFillWithBlocks(world, box, rand, 0.75F, sizeX - 3, 2, 0, sizeX - 2, 2, 0, Blocks.glass_pane); + randomlyFillWithBlocks(world, box, rand, 0.75F, sizeX, 2, 3, sizeX, 2, 4, Blocks.glass_pane); + randomlyFillWithBlocks(world, box, rand, 0.75F, sizeX, 2, 8, sizeX, 2, 9, Blocks.glass_pane); + randomlyFillWithBlocks(world, box, rand, 0.75F, sizeX - 3, 2, sizeZ, sizeX - 2, 2, sizeZ, Blocks.glass_pane); + //Fuwnituwe >w< + int stairMetaE = this.getMetadataWithOffset(Blocks.oak_stairs, 1); //East + int stairMetaN = this.getMetadataWithOffset(Blocks.oak_stairs, 2); //Nowth :3 + int stairMetaS = this.getMetadataWithOffset(Blocks.oak_stairs, 3); //South + int stairMetaWU = this.getMetadataWithOffset(Blocks.oak_stairs, 5); //West, Upside-down + int stairMetaEU = this.getMetadataWithOffset(Blocks.oak_stairs, 5); //East, Upside-down + int stairMetaNU = this.getMetadataWithOffset(Blocks.oak_stairs, 6); //Nowth, Upside-down uwu + int stairMetaSU = this.getMetadataWithOffset(Blocks.oak_stairs, 7); //South, Upside-down + //Desk 1 :3 + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaEU, 1, 1, 4, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaEU, 2, 1, 4, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaNU, 3, 1, 4, box); + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaS, 3, 1, 2, box); //Chaiw :3 + placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, getDecoModelMeta(0), 1, 2, 4, box); //Nowth-facing Computer :33 + //Desk 2 :3 + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaS, 7, 1, 3, box); //Chaiw :3 + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaEU, 6, 1, 4, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaWU, 7, 1, 4, box); + placeBlockAtCurrentPosition(world, Blocks.planks, 1, 8, 1, 4, box); //Spwuce Pwanks :3 + placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, getDecoModelMeta(0), 7, 2, 4, box); //Nowth-facing Computer X3 + placeBlockAtCurrentPosition(world, Blocks.flower_pot, 0, 8, 2, 4, box); + //Desk 3 :3 + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaEU, 10, 1, 1, box); + fillWithMetadataBlocks(world, box, 11, 1, 1, sizeX - 1, 1, 1, Blocks.spruce_stairs, stairMetaSU); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaNU, sizeX - 1, 1, 2, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaSU, sizeX - 1, 1, 3, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaWU, sizeX - 1, 1, 4, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaNU, sizeX - 1, 1, 5, box); + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaN, 11, 1, 2, box); //Chaiw ;3 + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaE, sizeX - 2, 1, 4, box); //Chaiw :333 + placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, getDecoModelMeta(1), sizeX - 3, 2, 1, box); //South-facing Computer :3 + placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, getDecoModelMeta(2), sizeX - 1, 2, 5, box); //West-facing Computer ^w^ + placeBlockAtCurrentPosition(world, Blocks.flower_pot, 0, sizeX - 1, 2, 3, box); + placeBlockAtCurrentPosition(world, ModBlocks.radiorec, getDecoMeta(3), sizeX - 1, 2, 2, box); //Wadio + //Desk 4 DX + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaEU, 10, 1, 8, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaWU, 11, 1, 8, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaN, 10, 1, 9, box); //Chaiw ;3 + placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, getDecoModelMeta(1), 10, 2, 8, box); //South-facing Computer :33 + //Desk 5 :333 + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaSU, sizeX - 1, 1, sizeZ - 3, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaWU, sizeX - 1, 1, sizeZ - 2, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaNU, sizeX - 1, 1, sizeZ - 1, box); + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaE, sizeX - 3, 1, sizeZ - 1, box); //UwU... Chaiw!!!! :333 I wove chaiws XD :333 OwO what's this?? chaiw???? :333333333333333333 + placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, getDecoModelMeta(2), sizeX - 1, 2, sizeZ - 1, box); //West-facing Computer >w< + //Cobwebs pwobabwy + + //Woot + if(!this.hasPlacedLoot[0]) + this.hasPlacedLoot[0] = generateInvContents(world, box, rand, Blocks.chest, sizeX - 4, 1, sizeZ - 1, HbmChestContents.officeTrash, 10); + if(!this.hasPlacedLoot[1]) + this.hasPlacedLoot[1] = generateLockableContents(world, box, rand, ModBlocks.safe, 6, 1, 1, null, 10, 0.2D); + + //TODO: add book with funny lore to safe, add cobwebs too + return false; + } + + } + +} From a5a3a96bdcc2ed345b89b5d35dc81125c4af7e20 Mon Sep 17 00:00:00 2001 From: Vaern Date: Tue, 6 Sep 2022 20:56:58 -0700 Subject: [PATCH 06/12] hm --- src/main/java/com/hbm/lib/HbmWorld.java | 2 + .../hbm/world/worldgen/MapGenNTMFeatures.java | 16 ++++-- .../world/worldgen/components/Feature.java | 2 +- .../worldgen/components/OfficeFeatures.java | 50 +++++++++++-------- 4 files changed, 45 insertions(+), 25 deletions(-) diff --git a/src/main/java/com/hbm/lib/HbmWorld.java b/src/main/java/com/hbm/lib/HbmWorld.java index 69294f45c..4f2c9444f 100644 --- a/src/main/java/com/hbm/lib/HbmWorld.java +++ b/src/main/java/com/hbm/lib/HbmWorld.java @@ -4,6 +4,7 @@ import com.hbm.world.worldgen.MapGenNTMFeatures; import com.hbm.world.worldgen.NTMWorldGenerator; import com.hbm.world.worldgen.components.CivilianFeatures.*; import com.hbm.world.worldgen.components.MilitaryBaseFeatures.*; +import com.hbm.world.worldgen.components.OfficeFeatures.*; import com.hbm.world.worldgen.components.RuinFeatures.*; import cpw.mods.fml.common.IWorldGenerator; @@ -46,5 +47,6 @@ public class HbmWorld { //aggggggggggg MapGenStructureIO.func_143031_a(BasicHelipad.class, "NTMBasicHelipad"); MapGenStructureIO.func_143031_a(RadioShack.class, "NTMRadioShack"); + MapGenStructureIO.func_143031_a(LargeOffice.class, "NTMLargeOffice"); } } diff --git a/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java b/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java index 59fe2c35c..02665da95 100644 --- a/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java +++ b/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java @@ -11,6 +11,7 @@ import com.hbm.config.StructureConfig; import com.hbm.world.worldgen.components.CivilianFeatures.*; import com.hbm.world.worldgen.components.MilitaryBaseFeatures; import com.hbm.world.worldgen.components.MilitaryBaseFeatures.*; +import com.hbm.world.worldgen.components.OfficeFeatures.*; import com.hbm.world.worldgen.components.RuinFeatures.*; import net.minecraft.world.World; @@ -107,7 +108,7 @@ public class MapGenNTMFeatures extends MapGenStructure { * chance/location fails for all other structures. Might not even be necessary, but whatever. * Rainfall & Temperature Check */ - + //TODO: Do something about this so it's nice-looking and easily readable. Plus, test compatibility against mods like BoP if(rand.nextBoolean()) { //Empty Ruin Structures switch(rand.nextInt(4)) { case 0: @@ -135,13 +136,21 @@ public class MapGenNTMFeatures extends MapGenStructure { NTMHouse2 house2 = new NTMHouse2(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); this.components.add(house2); } + } else if(biome.temperature >= 0.25 && biome.temperature <= 0.3 && biome.rainfall >= 0.6 && biome.rainfall <= 0.9) { //Taiga & Mega Taiga if(rand.nextBoolean()) { NTMWorkshop1 workshop1 = new NTMWorkshop1(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); this.components.add(workshop1); } - } else if(biome.heightVariation <= 0.2 && biome.rainfall <= 0.5 && !(biome instanceof BiomeGenBeach) && rand.nextBoolean()) { - MilitaryBaseFeatures.smallHelipad(components, chunkX, posY, chunkZ, rand); //agggggggg + + } else if(biome.heightVariation <= 0.2 && biome.rainfall <= 0.5 && !(biome instanceof BiomeGenBeach) && rand.nextBoolean()) { //Everything except jungles, extra-hilly areas, and beaches + //if(rand.nextBoolean()) + // MilitaryBaseFeatures.smallHelipad(components, chunkX, posY, chunkZ, rand); //agggggggg + //else { + LargeOffice office = new LargeOffice(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); + this.components.add(office); + //} + } else { //Everything else if(rand.nextBoolean()) { NTMLab2 lab2 = new NTMLab2(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); @@ -150,6 +159,7 @@ public class MapGenNTMFeatures extends MapGenStructure { NTMLab1 lab1 = new NTMLab1(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); this.components.add(lab1); } + } if(GeneralConfig.enableDebugMode) { diff --git a/src/main/java/com/hbm/world/worldgen/components/Feature.java b/src/main/java/com/hbm/world/worldgen/components/Feature.java index 54333f173..164526226 100644 --- a/src/main/java/com/hbm/world/worldgen/components/Feature.java +++ b/src/main/java/com/hbm/world/worldgen/components/Feature.java @@ -305,7 +305,7 @@ abstract public class Feature extends StructureComponent { } protected void randomlyFillWithBlocks(World world, StructureBoundingBox box, Random rand, float randLimit, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, Block block) { - this.randomlyFillWithBlocks(world, box, rand, randLimit, minX, minY, minZ, maxX, maxY, maxZ, block); + this.randomlyFillWithBlocks(world, box, rand, randLimit, minX, minY, minZ, maxX, maxY, maxZ, block, block, false); } protected void fillWithRandomizedBlocks(World world, StructureBoundingBox box, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, Random rand, BlockSelector selector) { diff --git a/src/main/java/com/hbm/world/worldgen/components/OfficeFeatures.java b/src/main/java/com/hbm/world/worldgen/components/OfficeFeatures.java index 46169e4d9..4faa80eae 100644 --- a/src/main/java/com/hbm/world/worldgen/components/OfficeFeatures.java +++ b/src/main/java/com/hbm/world/worldgen/components/OfficeFeatures.java @@ -58,11 +58,12 @@ public class OfficeFeatures { this.boundingBox.offset(0, -1, 0); //Pillars + //Back fillWithBlocks(world, box, 0, 0, 2, 0, 4, 2, ModBlocks.concrete_pillar); fillWithBlocks(world, box, 5, 0, 0, 5, 4, 0, ModBlocks.concrete_pillar); fillWithBlocks(world, box, sizeX, 0, 0, sizeX, 4, 0, ModBlocks.concrete_pillar); - - fillWithBlocks(world, box, 0, 0, 5, 0, 3, 5, ModBlocks.concrete_pillar); + //Front + fillWithBlocks(world, box, 0, 0, 7, 0, 3, 7, ModBlocks.concrete_pillar); fillWithBlocks(world, box, 0, 0, sizeZ, 0, 3, sizeZ, ModBlocks.concrete_pillar); fillWithBlocks(world, box, 3, 0, sizeZ, 3, 3, sizeZ, ModBlocks.concrete_pillar); fillWithBlocks(world, box, 6, 0, sizeZ, 6, 3, sizeZ, ModBlocks.concrete_pillar); @@ -97,8 +98,8 @@ public class OfficeFeatures { fillWithRandomizedBlocks(world, box, 1, 0, 7, 8, 0, 7, rand, ConcreteBricks); fillWithRandomizedBlocks(world, box, 1, 1, 7, 1, 2, 7, rand, ConcreteBricks); - fillWithRandomizedBlocks(world, box, 4, 1, 7, 8, 4, 7, rand, ConcreteBricks); - fillWithRandomizedBlocks(world, box, 1, 4, 7, 3, 4, 7, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 4, 1, 7, 8, 3, 7, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 1, 3, 7, 3, 3, 7, rand, ConcreteBricks); //Left fillWithRandomizedBlocks(world, box, 0, 4, 3, 0, 4, sizeZ - 1, rand, ConcreteBricks); fillWithRandomizedBlocks(world, box, 0, 0, 3, 0, 1, 6, rand, ConcreteBricks); @@ -109,17 +110,17 @@ public class OfficeFeatures { fillWithRandomizedBlocks(world, box, 5, 3, 6, 5, 3, 6, rand, ConcreteBricks); //Trim - randomlyFillWithBlocks(world, box, rand, 0.75F, 0, sizeY, 2, 5, sizeY, 2, Blocks.stone_slab); - randomlyFillWithBlocks(world, box, rand, 0.75F, 5, sizeY, 1, 5, sizeY, 1, Blocks.stone_slab); - randomlyFillWithBlocks(world, box, rand, 0.75F, 5, sizeY, 0, sizeX, sizeY, 0, Blocks.stone_slab); - randomlyFillWithBlocks(world, box, rand, 0.75F, sizeX, sizeY, 1, sizeX, sizeY, sizeZ, Blocks.stone_slab); - randomlyFillWithBlocks(world, box, rand, 0.75F, 0, sizeY, sizeZ, sizeX - 1, sizeY, sizeZ, Blocks.stone_slab); - randomlyFillWithBlocks(world, box, rand, 0.75F, 0, sizeY, 3, 0, sizeY, sizeZ - 1, Blocks.stone_slab); + randomlyFillWithBlocks(world, box, rand, 0.85F, 0, sizeY, 2, 5, sizeY, 2, Blocks.stone_slab); + randomlyFillWithBlocks(world, box, rand, 0.85F, 5, sizeY, 1, 5, sizeY, 1, Blocks.stone_slab); + randomlyFillWithBlocks(world, box, rand, 0.85F, 5, sizeY, 0, sizeX, sizeY, 0, Blocks.stone_slab); + randomlyFillWithBlocks(world, box, rand, 0.85F, sizeX, sizeY, 1, sizeX, sizeY, sizeZ, Blocks.stone_slab); + randomlyFillWithBlocks(world, box, rand, 0.85F, 0, sizeY, sizeZ, sizeX - 1, sizeY, sizeZ, Blocks.stone_slab); + randomlyFillWithBlocks(world, box, rand, 0.85F, 0, sizeY, 3, 0, sizeY, sizeZ - 1, Blocks.stone_slab); //Floor - fillWithMetadataBlocks(world, box, 1, 0, 3, 4, 6, hpos, Blocks.wool, 13); //Green Wool + fillWithMetadataBlocks(world, box, 1, 0, 3, 4, 0, 6, Blocks.wool, 13); //Green Wool fillWithBlocks(world, box, 5, 0, 3, 5, 0, 6, ModBlocks.brick_light); - fillWithBlocks(world, box, 1, 0, 1, sizeX - 1, 0, 6, ModBlocks.brick_light); + fillWithBlocks(world, box, 6, 0, 1, sizeX - 1, 0, 6, ModBlocks.brick_light); fillWithBlocks(world, box, 10, 0, 7, sizeX - 1, 0, sizeZ - 1, ModBlocks.brick_light); //Ceiling fillWithBlocks(world, box, 6, 4, 1, sizeX - 1, 4, 2, ModBlocks.brick_light); @@ -137,17 +138,17 @@ public class OfficeFeatures { randomlyFillWithBlocks(world, box, rand, 0.75F, sizeX - 3, 2, sizeZ, sizeX - 2, 2, sizeZ, Blocks.glass_pane); //Fuwnituwe >w< int stairMetaE = this.getMetadataWithOffset(Blocks.oak_stairs, 1); //East - int stairMetaN = this.getMetadataWithOffset(Blocks.oak_stairs, 2); //Nowth :3 - int stairMetaS = this.getMetadataWithOffset(Blocks.oak_stairs, 3); //South - int stairMetaWU = this.getMetadataWithOffset(Blocks.oak_stairs, 5); //West, Upside-down + int stairMetaS = this.getMetadataWithOffset(Blocks.oak_stairs, 2); //South + int stairMetaN = this.getMetadataWithOffset(Blocks.oak_stairs, 3); //Nowth :3 + int stairMetaWU = this.getMetadataWithOffset(Blocks.oak_stairs, 4); //West, Upside-down int stairMetaEU = this.getMetadataWithOffset(Blocks.oak_stairs, 5); //East, Upside-down int stairMetaNU = this.getMetadataWithOffset(Blocks.oak_stairs, 6); //Nowth, Upside-down uwu - int stairMetaSU = this.getMetadataWithOffset(Blocks.oak_stairs, 7); //South, Upside-down + int stairMetaSU = this.getMetadataWithOffset(Blocks.oak_stairs, 7); //South, Upside-down //Desk 1 :3 placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaEU, 1, 1, 4, box); - placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaEU, 2, 1, 4, box); - placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaNU, 3, 1, 4, box); - placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaS, 3, 1, 2, box); //Chaiw :3 + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaNU, 2, 1, 4, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaWU, 3, 1, 4, box); + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaS, 2, 1, 3, box); //Chaiw :3 placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, getDecoModelMeta(0), 1, 2, 4, box); //Nowth-facing Computer :33 //Desk 2 :3 placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaS, 7, 1, 3, box); //Chaiw :3 @@ -172,7 +173,7 @@ public class OfficeFeatures { //Desk 4 DX placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaEU, 10, 1, 8, box); placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaWU, 11, 1, 8, box); - placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaN, 10, 1, 9, box); //Chaiw ;3 + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaN, 10, 1, 9, box); //Chaiw ;3 placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, getDecoModelMeta(1), 10, 2, 8, box); //South-facing Computer :33 //Desk 5 :333 placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaSU, sizeX - 1, 1, sizeZ - 3, box); @@ -181,14 +182,21 @@ public class OfficeFeatures { placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaE, sizeX - 3, 1, sizeZ - 1, box); //UwU... Chaiw!!!! :333 I wove chaiws XD :333 OwO what's this?? chaiw???? :333333333333333333 placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, getDecoModelMeta(2), sizeX - 1, 2, sizeZ - 1, box); //West-facing Computer >w< //Cobwebs pwobabwy + //Maybe make a method for this eventually? + //Something where the tops of ceilings + empty corners along walls get most cobwebs, + //with no cobwebs hanging midair + it not being performance intensive + randomlyFillWithBlocks(world, box, rand, 0.25F, 1, 3, 3, 4, 3, 6, Blocks.web); + randomlyFillWithBlocks(world, box, rand, 0.25F, 6, 3, 1, sizeX - 1, 3, 6, Blocks.web); + randomlyFillWithBlocks(world, box, rand, 0.25F, 10, 3, 7, sizeX - 1, 3, sizeZ - 1, Blocks.web); //Woot if(!this.hasPlacedLoot[0]) this.hasPlacedLoot[0] = generateInvContents(world, box, rand, Blocks.chest, sizeX - 4, 1, sizeZ - 1, HbmChestContents.officeTrash, 10); if(!this.hasPlacedLoot[1]) - this.hasPlacedLoot[1] = generateLockableContents(world, box, rand, ModBlocks.safe, 6, 1, 1, null, 10, 0.2D); + this.hasPlacedLoot[1] = generateLockableContents(world, box, rand, ModBlocks.safe, 6, 1, 1, HbmChestContents.machineParts, 10, 0.5D); //TODO: add book with funny lore to safe, add cobwebs too + //0b00/0 West, 0b01/1 East, 0b10/2 North, 0b11/3 South, 0b100/4 West UD, 0b101 East UD, 0b110 North UD, 0b111 South UD return false; } From ea1a79f55947676da8c641dd11a6cbba03d474f0 Mon Sep 17 00:00:00 2001 From: Vaern Date: Wed, 7 Sep 2022 20:57:30 -0700 Subject: [PATCH 07/12] h --- .../com/hbm/world/worldgen/MapGenNTMFeatures.java | 12 ++++++------ .../hbm/world/worldgen/components/Feature.java | 13 +++++++++++-- .../world/worldgen/components/OfficeFeatures.java | 15 ++++++++------- 3 files changed, 25 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java b/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java index 02665da95..3308d46f3 100644 --- a/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java +++ b/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java @@ -109,7 +109,7 @@ public class MapGenNTMFeatures extends MapGenStructure { * Rainfall & Temperature Check */ //TODO: Do something about this so it's nice-looking and easily readable. Plus, test compatibility against mods like BoP - if(rand.nextBoolean()) { //Empty Ruin Structures + /*if(rand.nextBoolean()) { //Empty Ruin Structures switch(rand.nextInt(4)) { case 0: NTMRuin1 ruin1 = new NTMRuin1(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); @@ -144,12 +144,12 @@ public class MapGenNTMFeatures extends MapGenStructure { } } else if(biome.heightVariation <= 0.2 && biome.rainfall <= 0.5 && !(biome instanceof BiomeGenBeach) && rand.nextBoolean()) { //Everything except jungles, extra-hilly areas, and beaches - //if(rand.nextBoolean()) - // MilitaryBaseFeatures.smallHelipad(components, chunkX, posY, chunkZ, rand); //agggggggg - //else { + if(rand.nextBoolean()) + MilitaryBaseFeatures.smallHelipad(components, chunkX, posY, chunkZ, rand); //agggggggg + else {*/ LargeOffice office = new LargeOffice(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); this.components.add(office); - //} + /*} } else { //Everything else if(rand.nextBoolean()) { @@ -160,7 +160,7 @@ public class MapGenNTMFeatures extends MapGenStructure { this.components.add(lab1); } - } + }*/ if(GeneralConfig.enableDebugMode) { System.out.print("[Debug] StructureStart at " + (chunkX * 16 + 8) + ", " + posY + ", " + (chunkZ * 16 + 8) + "\n[Debug] Components: "); diff --git a/src/main/java/com/hbm/world/worldgen/components/Feature.java b/src/main/java/com/hbm/world/worldgen/components/Feature.java index 164526226..0d4b568a3 100644 --- a/src/main/java/com/hbm/world/worldgen/components/Feature.java +++ b/src/main/java/com/hbm/world/worldgen/components/Feature.java @@ -162,9 +162,18 @@ abstract public class Feature extends StructureComponent { //N: 0b00, S: 0b01, W: 0b10, E: 0b11 int rot = metadata & 3; + switch(this.coordBaseMode) { + default: //South + break; + case 1: //West + break; //N & S can just have NOT used + case 2: //North + break; + case 3: //East + break; + } - - return 0; + return metadata | rot; } /** diff --git a/src/main/java/com/hbm/world/worldgen/components/OfficeFeatures.java b/src/main/java/com/hbm/world/worldgen/components/OfficeFeatures.java index 4faa80eae..c27c30b56 100644 --- a/src/main/java/com/hbm/world/worldgen/components/OfficeFeatures.java +++ b/src/main/java/com/hbm/world/worldgen/components/OfficeFeatures.java @@ -137,13 +137,14 @@ public class OfficeFeatures { randomlyFillWithBlocks(world, box, rand, 0.75F, sizeX, 2, 8, sizeX, 2, 9, Blocks.glass_pane); randomlyFillWithBlocks(world, box, rand, 0.75F, sizeX - 3, 2, sizeZ, sizeX - 2, 2, sizeZ, Blocks.glass_pane); //Fuwnituwe >w< + //North and south are reversed?????? But east and west aren't???? int stairMetaE = this.getMetadataWithOffset(Blocks.oak_stairs, 1); //East - int stairMetaS = this.getMetadataWithOffset(Blocks.oak_stairs, 2); //South - int stairMetaN = this.getMetadataWithOffset(Blocks.oak_stairs, 3); //Nowth :3 - int stairMetaWU = this.getMetadataWithOffset(Blocks.oak_stairs, 4); //West, Upside-down - int stairMetaEU = this.getMetadataWithOffset(Blocks.oak_stairs, 5); //East, Upside-down - int stairMetaNU = this.getMetadataWithOffset(Blocks.oak_stairs, 6); //Nowth, Upside-down uwu - int stairMetaSU = this.getMetadataWithOffset(Blocks.oak_stairs, 7); //South, Upside-down + int stairMetaS = this.getMetadataWithOffset(Blocks.oak_stairs, 2); //*SHOULD* be north, but south + int stairMetaN = this.getMetadataWithOffset(Blocks.oak_stairs, 3); //Ditto, but north :3 + int stairMetaWU = this.getMetadataWithOffset(Blocks.oak_stairs, 0) | 4; //West, Upside-down + int stairMetaEU = this.getMetadataWithOffset(Blocks.oak_stairs, 1) | 4; //East, Upside-down + int stairMetaSU = this.getMetadataWithOffset(Blocks.oak_stairs, 2) | 4; //Ditto, but south, Upside-down uwu + int stairMetaNU = this.getMetadataWithOffset(Blocks.oak_stairs, 3) | 4; //Ditto, but north, Upside-down //Desk 1 :3 placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaEU, 1, 1, 4, box); placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaNU, 2, 1, 4, box); @@ -169,7 +170,7 @@ public class OfficeFeatures { placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, getDecoModelMeta(1), sizeX - 3, 2, 1, box); //South-facing Computer :3 placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, getDecoModelMeta(2), sizeX - 1, 2, 5, box); //West-facing Computer ^w^ placeBlockAtCurrentPosition(world, Blocks.flower_pot, 0, sizeX - 1, 2, 3, box); - placeBlockAtCurrentPosition(world, ModBlocks.radiorec, getDecoMeta(3), sizeX - 1, 2, 2, box); //Wadio + placeBlockAtCurrentPosition(world, ModBlocks.radiorec, getDecoMeta(5), sizeX - 1, 2, 2, box); //Wadio //Desk 4 DX placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaEU, 10, 1, 8, box); placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaWU, 11, 1, 8, box); From c0e116f56a3836f975a45bb2c787e133b5071ce8 Mon Sep 17 00:00:00 2001 From: Vaern Date: Thu, 8 Sep 2022 20:55:28 -0700 Subject: [PATCH 08/12] how do you fuck this up that badly thanks mojang --- .../world/worldgen/components/Feature.java | 71 ++++++++++++++++--- 1 file changed, 61 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/hbm/world/worldgen/components/Feature.java b/src/main/java/com/hbm/world/worldgen/components/Feature.java index 0d4b568a3..73aaf49bc 100644 --- a/src/main/java/com/hbm/world/worldgen/components/Feature.java +++ b/src/main/java/com/hbm/world/worldgen/components/Feature.java @@ -50,11 +50,10 @@ abstract public class Feature extends StructureComponent { this.boundingBox = new StructureBoundingBox(minX, minY, minZ, minX + maxZ, minY + maxY, minZ + maxX); break; case 2: - //North (2) and East (3) will result in mirrored structures. Not an issue, but keep in mind. this.boundingBox = new StructureBoundingBox(minX, minY, minZ, minX + maxX, minY + maxY, minZ + maxZ); break; case 3: - this.boundingBox = new StructureBoundingBox(minX, minY, minZ, minX + maxX, minY + maxY, minZ + maxZ); + this.boundingBox = new StructureBoundingBox(minX, minY, minZ, minX + maxZ, minY + maxY, minZ + maxX); break; default: this.boundingBox = new StructureBoundingBox(minX, minY, minZ, minX + maxX, minY + maxY, minZ + maxZ); @@ -140,15 +139,15 @@ abstract public class Feature extends StructureComponent { switch(metadata) { case 2: return 3; case 3: return 2; - case 4: return 4; - case 5: return 5; + case 4: return 5; + case 5: return 4; } case 3: //East switch(metadata) { case 2: return 4; case 3: return 5; - case 4: return 2; - case 5: return 3; + case 4: return 3; + case 5: return 2; } } return 0; @@ -160,25 +159,42 @@ abstract public class Feature extends StructureComponent { */ protected int getDecoModelMeta(int metadata) { //N: 0b00, S: 0b01, W: 0b10, E: 0b11 - int rot = metadata & 3; switch(this.coordBaseMode) { default: //South break; case 1: //West - break; //N & S can just have NOT used + if((metadata & 3) < 2) //N & S can just have bits toggled + metadata = metadata ^ 3; + else //W & E can just have first bit set to 0 + metadata = metadata ^ 2; + break; case 2: //North + metadata = metadata ^ 1; //N, W, E & S can just have first bit toggled break; case 3: //East + if((metadata & 3) < 2)//N & S can just have second bit set to 1 + metadata = metadata ^ 2; + else //W & E can just have bits toggled + metadata = metadata ^ 3; break; } - return metadata | rot; + return metadata; } + //TODO: fix metadata finder for doors + //TODO: add method for stairs + /* For Later: + * 0/S: S->S; W->W; N->N; E->E + * 1/W: S->W; W->N; N->E; E->S + * 2/N: S->N; W->E; N->S; E->W + * 3/E: S->E; W->S; N->W; E->N + */ + /** * Places door at specified location with orientation-adjusted meta - * don't ask me which directions are what (take direction such as South/0 and add 1) + * 0 = West, 1 = North, 2 = East, 3 = South */ protected void placeDoor(World world, StructureBoundingBox box, Block door, int direction, int featureX, int featureY, int featureZ) { int meta = getMetadataWithOffset(Blocks.wooden_door, direction); @@ -303,6 +319,41 @@ abstract public class Feature extends StructureComponent { } } + /** getXWithOffset & getZWithOffset Methods that are actually fixed **/ + //Turns out, this entire time every single minecraft structure is mirrored instead of rotated when facing East and North + //Also turns out, it's a scarily easy fix that they somehow didn't see *entirely* + @Override + protected int getXWithOffset(int x, int z) { + switch(this.coordBaseMode) { + case 0: + return this.boundingBox.minX + x; + case 1: + return this.boundingBox.maxX - z; + case 2: + return this.boundingBox.maxX - x; + case 3: + return this.boundingBox.minX + z; + default: + return x; + } + } + + @Override + protected int getZWithOffset(int x, int z) { + switch(this.coordBaseMode) { + case 0: + return this.boundingBox.minZ + z; + case 1: + return this.boundingBox.minZ + x; + case 2: + return this.boundingBox.maxZ - z; + case 3: + return this.boundingBox.maxZ - x; + default: + return x; + } + } + /** Methods that remove the replaceBlock and alwaysReplace, and other parameters: as they are useless and only serve as a time sink normally. */ protected void fillWithBlocks(World world, StructureBoundingBox box, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, Block block) { From f37ac604232a3ec8c3a2b28d267c767637409a9a Mon Sep 17 00:00:00 2001 From: "Dr. Maniac, PHD" Date: Fri, 9 Sep 2022 15:43:31 -0700 Subject: [PATCH 09/12] stair meta working --- .../world/worldgen/components/Feature.java | 26 ++++++++++++++++++- .../worldgen/components/OfficeFeatures.java | 15 +++++------ 2 files changed, 32 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/hbm/world/worldgen/components/Feature.java b/src/main/java/com/hbm/world/worldgen/components/Feature.java index 73aaf49bc..f25d3a03e 100644 --- a/src/main/java/com/hbm/world/worldgen/components/Feature.java +++ b/src/main/java/com/hbm/world/worldgen/components/Feature.java @@ -154,7 +154,7 @@ abstract public class Feature extends StructureComponent { } /** - * + * Get orientation-offset metadata for BlockDecoModel * @param metadata (0 for facing North, 1 for facing South, 2 for facing West, 3 for facing East) */ protected int getDecoModelMeta(int metadata) { @@ -190,7 +190,31 @@ abstract public class Feature extends StructureComponent { * 1/W: S->W; W->N; N->E; E->S * 2/N: S->N; W->E; N->S; E->W * 3/E: S->E; W->S; N->W; E->N + * 0/b00/W, 1/b01/E, 2/b10/N, 3/b11/S */ + protected int getStairMeta(int metadata) { + switch(this.coordBaseMode) { + default: //South + break; + case 1: //West + if((metadata & 3) < 2) //Flip second bit for E/W + metadata = metadata ^ 2; + else + metadata = metadata ^ 3; //Flip both bits for N/S + break; + case 2: //North + metadata = metadata ^ 1; //Flip first bit + break; + case 3: //East + if((metadata & 3) < 2) //Flip both bits for E/W + metadata = metadata ^ 3; + else //Flip second bit for N/S + metadata = metadata ^ 2; + break; + } + + return metadata; + } /** * Places door at specified location with orientation-adjusted meta diff --git a/src/main/java/com/hbm/world/worldgen/components/OfficeFeatures.java b/src/main/java/com/hbm/world/worldgen/components/OfficeFeatures.java index c27c30b56..e4ce0f193 100644 --- a/src/main/java/com/hbm/world/worldgen/components/OfficeFeatures.java +++ b/src/main/java/com/hbm/world/worldgen/components/OfficeFeatures.java @@ -137,14 +137,13 @@ public class OfficeFeatures { randomlyFillWithBlocks(world, box, rand, 0.75F, sizeX, 2, 8, sizeX, 2, 9, Blocks.glass_pane); randomlyFillWithBlocks(world, box, rand, 0.75F, sizeX - 3, 2, sizeZ, sizeX - 2, 2, sizeZ, Blocks.glass_pane); //Fuwnituwe >w< - //North and south are reversed?????? But east and west aren't???? - int stairMetaE = this.getMetadataWithOffset(Blocks.oak_stairs, 1); //East - int stairMetaS = this.getMetadataWithOffset(Blocks.oak_stairs, 2); //*SHOULD* be north, but south - int stairMetaN = this.getMetadataWithOffset(Blocks.oak_stairs, 3); //Ditto, but north :3 - int stairMetaWU = this.getMetadataWithOffset(Blocks.oak_stairs, 0) | 4; //West, Upside-down - int stairMetaEU = this.getMetadataWithOffset(Blocks.oak_stairs, 1) | 4; //East, Upside-down - int stairMetaSU = this.getMetadataWithOffset(Blocks.oak_stairs, 2) | 4; //Ditto, but south, Upside-down uwu - int stairMetaNU = this.getMetadataWithOffset(Blocks.oak_stairs, 3) | 4; //Ditto, but north, Upside-down + int stairMetaE = getStairMeta(1); //East + int stairMetaN = getStairMeta(2); //*SHOULD* be north + int stairMetaS = getStairMeta(3); //South :3 + int stairMetaWU = getStairMeta(0) | 4; //West, Upside-down + int stairMetaEU = stairMetaE | 4; //East, Upside-down + int stairMetaNU = stairMetaN | 4; //North, Upside-down uwu + int stairMetaSU = stairMetaS | 4; //South, Upside-down //Desk 1 :3 placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaEU, 1, 1, 4, box); placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaNU, 2, 1, 4, box); From 0826e7ca50785bf23419cad2de2d30b2d8bb1e26 Mon Sep 17 00:00:00 2001 From: Vaern Date: Fri, 9 Sep 2022 22:39:32 -0700 Subject: [PATCH 10/12] fixed placedoor, shifted structure spawns and stuff --- .../hbm/world/worldgen/MapGenNTMFeatures.java | 28 ++++----- .../worldgen/components/CivilianFeatures.java | 3 +- .../world/worldgen/components/Feature.java | 57 ++++++++++++------- .../worldgen/components/OfficeFeatures.java | 11 +++- 4 files changed, 60 insertions(+), 39 deletions(-) diff --git a/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java b/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java index 3308d46f3..7045891e0 100644 --- a/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java +++ b/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java @@ -109,7 +109,7 @@ public class MapGenNTMFeatures extends MapGenStructure { * Rainfall & Temperature Check */ //TODO: Do something about this so it's nice-looking and easily readable. Plus, test compatibility against mods like BoP - /*if(rand.nextBoolean()) { //Empty Ruin Structures + if(rand.nextBoolean()) { //Empty Ruin Structures switch(rand.nextInt(4)) { case 0: NTMRuin1 ruin1 = new NTMRuin1(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); @@ -137,30 +137,26 @@ public class MapGenNTMFeatures extends MapGenStructure { this.components.add(house2); } - } else if(biome.temperature >= 0.25 && biome.temperature <= 0.3 && biome.rainfall >= 0.6 && biome.rainfall <= 0.9) { //Taiga & Mega Taiga - if(rand.nextBoolean()) { + } else if(biome.temperature >= 0.25 && biome.temperature <= 0.3 && biome.rainfall >= 0.6 && biome.rainfall <= 0.9 && rand.nextBoolean()) { //Taiga & Mega Taiga NTMWorkshop1 workshop1 = new NTMWorkshop1(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); this.components.add(workshop1); - } - } else if(biome.heightVariation <= 0.2 && biome.rainfall <= 0.5 && !(biome instanceof BiomeGenBeach) && rand.nextBoolean()) { //Everything except jungles, extra-hilly areas, and beaches - if(rand.nextBoolean()) + } else if(biome.heightVariation <= 0.2 && biome.rainfall <= 0.5 && !(biome instanceof BiomeGenBeach) && rand.nextInt(3) == 0) { //Everything except jungles, extra-hilly areas, and beaches MilitaryBaseFeatures.smallHelipad(components, chunkX, posY, chunkZ, rand); //agggggggg - else {*/ - LargeOffice office = new LargeOffice(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); - this.components.add(office); - /*} } else { //Everything else - if(rand.nextBoolean()) { + switch(rand.nextInt(3)) { + case 0: NTMLab2 lab2 = new NTMLab2(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); - this.components.add(lab2); - } else { + this.components.add(lab2); break; + case 1: NTMLab1 lab1 = new NTMLab1(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); - this.components.add(lab1); + this.components.add(lab1); break; + case 2: + LargeOffice office = new LargeOffice(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); + this.components.add(office); break; } - - }*/ + } if(GeneralConfig.enableDebugMode) { System.out.print("[Debug] StructureStart at " + (chunkX * 16 + 8) + ", " + posY + ", " + (chunkZ * 16 + 8) + "\n[Debug] Components: "); diff --git a/src/main/java/com/hbm/world/worldgen/components/CivilianFeatures.java b/src/main/java/com/hbm/world/worldgen/components/CivilianFeatures.java index 88b2e9d9c..afcf72df3 100644 --- a/src/main/java/com/hbm/world/worldgen/components/CivilianFeatures.java +++ b/src/main/java/com/hbm/world/worldgen/components/CivilianFeatures.java @@ -330,11 +330,10 @@ public class CivilianFeatures { } } - int stairsMeta = this.getMetadataWithOffset(Blocks.stone_brick_stairs, 0); if(this.getBlockAtCurrentPosition(world, 2, 0, sizeZ - 1, box).getMaterial().isReplaceable() || this.getBlockAtCurrentPosition(world, 2, 0, sizeZ - 1, box) == Blocks.air) { this.func_151554_b(world, Blocks.stonebrick, 0, 2, -1, sizeZ - 1, box); - this.placeBlockAtCurrentPosition(world, Blocks.stone_brick_stairs, stairsMeta, 2, 0, sizeZ - 1, box); + this.placeBlockAtCurrentPosition(world, Blocks.stone_brick_stairs, getStairMeta(0), 2, 0, sizeZ - 1, box); } this.fillWithAir(world, box, 1, 0, 1, sizeX - 1, sizeY, 4); diff --git a/src/main/java/com/hbm/world/worldgen/components/Feature.java b/src/main/java/com/hbm/world/worldgen/components/Feature.java index f25d3a03e..d185fb4c3 100644 --- a/src/main/java/com/hbm/world/worldgen/components/Feature.java +++ b/src/main/java/com/hbm/world/worldgen/components/Feature.java @@ -183,14 +183,9 @@ abstract public class Feature extends StructureComponent { return metadata; } - //TODO: fix metadata finder for doors - //TODO: add method for stairs - /* For Later: - * 0/S: S->S; W->W; N->N; E->E - * 1/W: S->W; W->N; N->E; E->S - * 2/N: S->N; W->E; N->S; E->W - * 3/E: S->E; W->S; N->W; E->N - * 0/b00/W, 1/b01/E, 2/b10/N, 3/b11/S + /** + * Gets orientation-adjusted meta for stairs. + * 0 = West, 1 = East, 2 = North, 3 = South */ protected int getStairMeta(int metadata) { switch(this.coordBaseMode) { @@ -216,12 +211,29 @@ abstract public class Feature extends StructureComponent { return metadata; } + /* For Later: + * 0/S: S->S; W->W; N->N; E->E + * 1/W: S->W; W->N; N->E; E->S + * 2/N: S->N; W->E; N->S; E->W + * 3/E: S->E; W->S; N->W; E->N + * 0/b00/W, 1/b01/N, 2/b10/E, 3/b11/S + */ /** * Places door at specified location with orientation-adjusted meta * 0 = West, 1 = North, 2 = East, 3 = South */ - protected void placeDoor(World world, StructureBoundingBox box, Block door, int direction, int featureX, int featureY, int featureZ) { - int meta = getMetadataWithOffset(Blocks.wooden_door, direction); + protected void placeDoor(World world, StructureBoundingBox box, Block door, int meta, int featureX, int featureY, int featureZ) { + switch(this.coordBaseMode) { + default: + break; + case 1: + meta = (meta + 1) % 4; break; + case 2: + meta = meta ^ 2; break; //Flip second bit + case 3: + meta = (meta - 1) % 4; break; + } + int posX = this.getXWithOffset(featureX, featureZ); int posY = this.getYWithOffset(featureY); int posZ = this.getZWithOffset(featureX, featureZ); @@ -304,17 +316,22 @@ abstract public class Feature extends StructureComponent { /** * Places blocks underneath location until reaching a solid block; good for foundations */ - protected void placeFoundationUnderneath(World world, Block placeBlock, int meta, int featureX, int featureY, int featureZ, StructureBoundingBox box) { - int posX = this.getXWithOffset(featureX, featureZ); - int posY = this.getYWithOffset(featureY); - int posZ = this.getZWithOffset(featureX, featureZ); + protected void placeFoundationUnderneath(World world, Block placeBlock, int meta, int minX, int minZ, int maxX, int maxZ, int featureY, StructureBoundingBox box) { - if(box.isVecInside(posX, posY, posZ)) { - Block block = world.getBlock(posX, posY, posZ); - - while ((world.isAirBlock(posX, posY, posZ) || !block.getMaterial().isSolid() || (block.isFoliage(world, posX, posY, posZ) || block.getMaterial() == Material.leaves)) && posY > 1) { - world.setBlock(posX, posY, posZ, placeBlock, meta, 2); - block = world.getBlock(posX, --posY, posZ); + for(int featureX = minX; featureX <= maxX; featureX++) { + for(int featureZ = minZ; featureZ <= maxZ; featureZ++) { + int posX = this.getXWithOffset(featureX, featureZ); + int posY = this.getYWithOffset(featureY); + int posZ = this.getZWithOffset(featureX, featureZ); + + if(box.isVecInside(posX, posY, posZ)) { + Block block = world.getBlock(posX, posY, posZ); + + while ((world.isAirBlock(posX, posY, posZ) || !block.getMaterial().isSolid() || (block.isFoliage(world, posX, posY, posZ) || block.getMaterial() == Material.leaves)) && posY > 1) { + world.setBlock(posX, posY, posZ, placeBlock, meta, 2); + block = world.getBlock(posX, --posY, posZ); + } + } } } } diff --git a/src/main/java/com/hbm/world/worldgen/components/OfficeFeatures.java b/src/main/java/com/hbm/world/worldgen/components/OfficeFeatures.java index e4ce0f193..870f515a7 100644 --- a/src/main/java/com/hbm/world/worldgen/components/OfficeFeatures.java +++ b/src/main/java/com/hbm/world/worldgen/components/OfficeFeatures.java @@ -57,6 +57,11 @@ public class OfficeFeatures { this.boundingBox.offset(0, -1, 0); + placeFoundationUnderneath(world, Blocks.stonebrick, 0, 5, 0, sizeX, 1, -1, box); + placeFoundationUnderneath(world, Blocks.stonebrick, 0, 0, 2, sizeX, 7, -1, box); + placeFoundationUnderneath(world, Blocks.stonebrick, 0, 0, 8, 8, sizeZ, 0, box); + placeFoundationUnderneath(world, Blocks.stonebrick, 0, 9, 8, sizeX, sizeZ, -1, box); + //Pillars //Back fillWithBlocks(world, box, 0, 0, 2, 0, 4, 2, ModBlocks.concrete_pillar); @@ -79,7 +84,7 @@ public class OfficeFeatures { fillWithRandomizedBlocks(world, box, 6, 0, 0, sizeX - 1, 1, 0, rand, ConcreteBricks); fillWithRandomizedBlocks(world, box, 6, 2, 0, 6, 2, 0, rand, ConcreteBricks); fillWithRandomizedBlocks(world, box, 9, 2, 0, 10, 2, 0, rand, ConcreteBricks); - fillWithRandomizedBlocks(world, box, sizeX - 2, 2, 0, sizeX - 1, 2, 0, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, sizeX - 1, 2, 0, sizeX - 1, 2, 0, rand, ConcreteBricks); fillWithRandomizedBlocks(world, box, 6, 3, 0, sizeX - 1, 4, 0, rand, ConcreteBricks); //Right fillWithRandomizedBlocks(world, box, sizeX, 0, 1, sizeX, 1, sizeZ - 1, rand, ConcreteBricks); @@ -188,6 +193,10 @@ public class OfficeFeatures { randomlyFillWithBlocks(world, box, rand, 0.25F, 1, 3, 3, 4, 3, 6, Blocks.web); randomlyFillWithBlocks(world, box, rand, 0.25F, 6, 3, 1, sizeX - 1, 3, 6, Blocks.web); randomlyFillWithBlocks(world, box, rand, 0.25F, 10, 3, 7, sizeX - 1, 3, sizeZ - 1, Blocks.web); + //Doors + placeDoor(world, box, ModBlocks.door_office, 3, 2, 1, 7); + placeDoor(world, box, ModBlocks.door_office, 3, 3, 1, 7); + placeDoor(world, box, ModBlocks.door_office, 0, 5, 1, 6); //Woot if(!this.hasPlacedLoot[0]) From 34d3b117139c8d07069184cf734b82744a7c6792 Mon Sep 17 00:00:00 2001 From: Vaern Date: Sat, 10 Sep 2022 20:07:57 -0700 Subject: [PATCH 11/12] bozo get btfo'd kekW --- .../java/com/hbm/lib/HbmChestContents.java | 33 +++++++++++++++++++ .../world/worldgen/components/Feature.java | 16 +++++++++ .../worldgen/components/OfficeFeatures.java | 8 ++++- src/main/resources/assets/hbm/lang/en_US.lang | 6 ++++ 4 files changed, 62 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/hbm/lib/HbmChestContents.java b/src/main/java/com/hbm/lib/HbmChestContents.java index 56cb0a257..e8b53cd74 100644 --- a/src/main/java/com/hbm/lib/HbmChestContents.java +++ b/src/main/java/com/hbm/lib/HbmChestContents.java @@ -6,10 +6,16 @@ import com.hbm.blocks.ModBlocks; import com.hbm.inventory.fluid.Fluids; import com.hbm.items.ModItems; import com.hbm.items.machine.ItemBreedingRod.*; +import com.hbm.util.I18nUtil; import net.minecraft.init.Items; import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.nbt.NBTTagString; import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.World; public class HbmChestContents { @@ -350,4 +356,31 @@ public class HbmChestContents { new WeightedRandomChestContent(ModItems.can_mrsugar, 0, 1, 2, 2), new WeightedRandomChestContent(ModItems.book_guide, 3, 1, 1, 1), new WeightedRandomChestContent(Item.getItemFromBlock(ModBlocks.deco_computer), 0, 1, 1, 1)}; + + /** Nowhere else to put this and this seems like the most fitting place **/ + public static ItemStack genetateBook(String key) { + + String author = I18nUtil.resolveKey("book.lore." + key + ".author"); + String title = I18nUtil.resolveKey("book.lore." + key + ".title"); + + ItemStack book = new ItemStack(Items.written_book); + book.stackTagCompound = new NBTTagCompound(); + book.stackTagCompound.setString("author", author); + book.stackTagCompound.setString("title", title); + NBTTagList nbt = new NBTTagList(); + + for(byte i = 1; i <= 50; i++) { + String unloc = "book.lore." + key + ".page" + i; + String page = I18nUtil.resolveKey(unloc); + + if(page.equals(unloc)) + break; + else + nbt.appendTag(new NBTTagString(page)); + } + + book.stackTagCompound.setTag("pages", nbt); + + return book; + } } diff --git a/src/main/java/com/hbm/world/worldgen/components/Feature.java b/src/main/java/com/hbm/world/worldgen/components/Feature.java index d185fb4c3..4a7a82703 100644 --- a/src/main/java/com/hbm/world/worldgen/components/Feature.java +++ b/src/main/java/com/hbm/world/worldgen/components/Feature.java @@ -6,6 +6,7 @@ import com.hbm.blocks.ModBlocks; import com.hbm.blocks.generic.BlockBobble.BobbleType; import com.hbm.blocks.generic.BlockBobble.TileEntityBobble; import com.hbm.config.StructureConfig; +import com.hbm.lib.HbmChestContents; import com.hbm.tileentity.machine.TileEntityLockableBase; import com.hbm.tileentity.machine.storage.TileEntityCrateIron; @@ -14,6 +15,7 @@ import net.minecraft.block.material.Material; import net.minecraft.init.Blocks; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemDoor; +import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.WeightedRandomChestContent; @@ -294,6 +296,20 @@ abstract public class Feature extends StructureComponent { return false; } + protected void generateLoreBook(World world, StructureBoundingBox box, int featureX, int featureY, int featureZ, int slot, String key) { + int posX = this.getXWithOffset(featureX, featureZ); + int posY = this.getYWithOffset(featureY); + int posZ = this.getZWithOffset(featureX, featureZ); + + IInventory inventory = (IInventory) world.getTileEntity(posX, posY, posZ); + + if(inventory != null) { + ItemStack book = HbmChestContents.genetateBook(key); + + inventory.setInventorySlotContents(slot, book); + } + } + /** * Places random bobblehead with a randomized orientation at specified location */ diff --git a/src/main/java/com/hbm/world/worldgen/components/OfficeFeatures.java b/src/main/java/com/hbm/world/worldgen/components/OfficeFeatures.java index 870f515a7..ebcdeb079 100644 --- a/src/main/java/com/hbm/world/worldgen/components/OfficeFeatures.java +++ b/src/main/java/com/hbm/world/worldgen/components/OfficeFeatures.java @@ -62,6 +62,10 @@ public class OfficeFeatures { placeFoundationUnderneath(world, Blocks.stonebrick, 0, 0, 8, 8, sizeZ, 0, box); placeFoundationUnderneath(world, Blocks.stonebrick, 0, 9, 8, sizeX, sizeZ, -1, box); + fillWithAir(world, box, 1, 1, 3, 4, 3, 6); + fillWithAir(world, box, 6, 1, 1, sizeX - 1, 3, 6); + fillWithAir(world, box, 10, 1, 7, sizeX - 1, 3, sizeZ - 1); + //Pillars //Back fillWithBlocks(world, box, 0, 0, 2, 0, 4, 2, ModBlocks.concrete_pillar); @@ -201,8 +205,10 @@ public class OfficeFeatures { //Woot if(!this.hasPlacedLoot[0]) this.hasPlacedLoot[0] = generateInvContents(world, box, rand, Blocks.chest, sizeX - 4, 1, sizeZ - 1, HbmChestContents.officeTrash, 10); - if(!this.hasPlacedLoot[1]) + if(!this.hasPlacedLoot[1]) { this.hasPlacedLoot[1] = generateLockableContents(world, box, rand, ModBlocks.safe, 6, 1, 1, HbmChestContents.machineParts, 10, 0.5D); + generateLoreBook(world, box, 6, 1, 1, 7, "office" + rand.nextInt(1)); + } //TODO: add book with funny lore to safe, add cobwebs too //0b00/0 West, 0b01/1 East, 0b10/2 North, 0b11/3 South, 0b100/4 West UD, 0b101 East UD, 0b110 North UD, 0b111 South UD diff --git a/src/main/resources/assets/hbm/lang/en_US.lang b/src/main/resources/assets/hbm/lang/en_US.lang index cb6f6b8b1..0cd04cc47 100644 --- a/src/main/resources/assets/hbm/lang/en_US.lang +++ b/src/main/resources/assets/hbm/lang/en_US.lang @@ -314,6 +314,12 @@ book.starter.page18=vær is just a guy who has been trapped in the grey void fea #book.rbmk.title16=Meltdown #book.rbmk.page16=§4§lAvoid. +book.lore.office0.title=Letter of Resignation +book.lore.office0.author=Kosma +book.lore.office0.page1=Management downsized our department again yesterday. Those idiots only have themselves to blame, I don't know what they were expecting after the Panay fiasco. Who the hell leaks that sort of information? We're losing millions and +book.lore.office0.page2=it's ME who's the one out of a job now. I'M the one being asked to resign. I hope you asshats finally learn from your overabundance of mistakes and take that stick out of your ass. +book.lore.office0.page3=I'm not coming back tomorrow. Just send the paycheck. + cannery.f1=[ Press F1 for help ] cannery.centrifuge=Gas Centrifuge From df7277cf8321b6d5ffea08eb2f25f544e4666f73 Mon Sep 17 00:00:00 2001 From: Vaern Date: Sun, 11 Sep 2022 13:23:45 -0700 Subject: [PATCH 12/12] screw it --- .../hbm/inventory/recipes/anvil/AnvilRecipes.java | 12 ++++++++++++ src/main/resources/assets/hbm/lang/en_US.lang | 7 ++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/hbm/inventory/recipes/anvil/AnvilRecipes.java b/src/main/java/com/hbm/inventory/recipes/anvil/AnvilRecipes.java index 8780d34ae..233771927 100644 --- a/src/main/java/com/hbm/inventory/recipes/anvil/AnvilRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/anvil/AnvilRecipes.java @@ -493,6 +493,18 @@ public class AnvilRecipes { new AnvilOutput(new ItemStack(ModItems.ingot_tcalloy, 1), 0.25F) } ).setTier(3)); + + constructionRecipes.add(new AnvilConstructionRecipe( + new ComparableStack(ModBlocks.deco_computer), + new AnvilOutput[] { + new AnvilOutput(new ItemStack(ModItems.crt_display, 1)), + new AnvilOutput(new ItemStack(ModItems.scrap, 3)), + new AnvilOutput(new ItemStack(ModItems.wire_copper, 4)), + new AnvilOutput(new ItemStack(ModItems.circuit_red_copper, 1), 0.25F), + new AnvilOutput(new ItemStack(ModItems.circuit_copper, 2)) + + } + ).setTier(2)); constructionRecipes.add(new AnvilConstructionRecipe( new ComparableStack(ModItems.circuit_raw), diff --git a/src/main/resources/assets/hbm/lang/en_US.lang b/src/main/resources/assets/hbm/lang/en_US.lang index 0cd04cc47..987258ebc 100644 --- a/src/main/resources/assets/hbm/lang/en_US.lang +++ b/src/main/resources/assets/hbm/lang/en_US.lang @@ -318,7 +318,12 @@ book.lore.office0.title=Letter of Resignation book.lore.office0.author=Kosma book.lore.office0.page1=Management downsized our department again yesterday. Those idiots only have themselves to blame, I don't know what they were expecting after the Panay fiasco. Who the hell leaks that sort of information? We're losing millions and book.lore.office0.page2=it's ME who's the one out of a job now. I'M the one being asked to resign. I hope you asshats finally learn from your overabundance of mistakes and take that stick out of your ass. -book.lore.office0.page3=I'm not coming back tomorrow. Just send the paycheck. +book.lore.office0.page3=I'm not coming back on Friday. Just send the paycheck. + +book.lore.office1.title=Note +book.lore.office1.author=Jonas +book.lore.office1.page1= +book.lore.office2.page2= cannery.f1=[ Press F1 for help ]