From cd4c976dd7f017a7ac6d265f2840f1aaae723b06 Mon Sep 17 00:00:00 2001 From: Vaern Date: Mon, 29 May 2023 20:37:34 -0700 Subject: [PATCH 1/8] Preliminary BunkerComponents --- .../java/com/hbm/items/tool/ItemWandD.java | 41 +- src/main/java/com/hbm/lib/HbmWorld.java | 18 +- .../{worldgen => gen}/MapGenNTMFeatures.java | 14 +- .../com/hbm/world/gen/NTMWorldGenerator.java | 126 ++++ .../world/gen/ProceduralStructureStart.java | 247 ++++++++ .../world/gen/component/BunkerComponents.java | 547 ++++++++++++++++++ .../component}/CivilianFeatures.java | 2 +- .../component}/Component.java | 76 ++- .../component}/OfficeFeatures.java | 28 +- .../component}/RuinFeatures.java | 2 +- .../hbm/world/worldgen/NTMWorldGenerator.java | 53 -- .../components/ProceduralComponents.java | 240 -------- 12 files changed, 1012 insertions(+), 382 deletions(-) rename src/main/java/com/hbm/world/{worldgen => gen}/MapGenNTMFeatures.java (93%) create mode 100644 src/main/java/com/hbm/world/gen/NTMWorldGenerator.java create mode 100644 src/main/java/com/hbm/world/gen/ProceduralStructureStart.java create mode 100644 src/main/java/com/hbm/world/gen/component/BunkerComponents.java rename src/main/java/com/hbm/world/{worldgen/components => gen/component}/CivilianFeatures.java (99%) rename src/main/java/com/hbm/world/{worldgen/components => gen/component}/Component.java (94%) rename src/main/java/com/hbm/world/{worldgen/components => gen/component}/OfficeFeatures.java (96%) rename src/main/java/com/hbm/world/{worldgen/components => gen/component}/RuinFeatures.java (99%) delete mode 100644 src/main/java/com/hbm/world/worldgen/NTMWorldGenerator.java delete mode 100644 src/main/java/com/hbm/world/worldgen/components/ProceduralComponents.java diff --git a/src/main/java/com/hbm/items/tool/ItemWandD.java b/src/main/java/com/hbm/items/tool/ItemWandD.java index 7ea8ad8b7..a9c9a49ae 100644 --- a/src/main/java/com/hbm/items/tool/ItemWandD.java +++ b/src/main/java/com/hbm/items/tool/ItemWandD.java @@ -2,34 +2,15 @@ package com.hbm.items.tool; import java.util.List; -import com.hbm.blocks.ModBlocks; -import com.hbm.blocks.rail.IRailNTM; -import com.hbm.blocks.rail.IRailNTM.RailContext; -import com.hbm.explosion.vanillant.ExplosionVNT; -import com.hbm.explosion.vanillant.standard.BlockAllocatorBulkie; -import com.hbm.explosion.vanillant.standard.BlockMutatorBulkie; -import com.hbm.explosion.vanillant.standard.BlockProcessorStandard; -import com.hbm.explosion.vanillant.standard.EntityProcessorStandard; -import com.hbm.explosion.vanillant.standard.ExplosionEffectStandard; -import com.hbm.explosion.vanillant.standard.PlayerProcessorStandard; import com.hbm.lib.Library; -import com.hbm.packet.PacketDispatcher; -import com.hbm.packet.PlayerInformPacket; -import com.hbm.util.ParticleUtil; -import com.hbm.util.fauxpointtwelve.BlockPos; -import com.hbm.world.feature.OilSpot; +import com.hbm.world.gen.component.BunkerComponents; -import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.MathHelper; import net.minecraft.util.MovingObjectPosition; -import net.minecraft.util.Vec3; import net.minecraft.world.World; +import net.minecraft.world.gen.structure.StructureBoundingBox; public class ItemWandD extends Item { @@ -43,13 +24,13 @@ public class ItemWandD extends Item { if(pos != null) { - ExplosionVNT vnt = new ExplosionVNT(world, pos.hitVec.xCoord, pos.hitVec.yCoord, pos.hitVec.zCoord, 7); + /*ExplosionVNT vnt = new ExplosionVNT(world, pos.hitVec.xCoord, pos.hitVec.yCoord, pos.hitVec.zCoord, 7); vnt.setBlockAllocator(new BlockAllocatorBulkie(60)); vnt.setBlockProcessor(new BlockProcessorStandard().withBlockEffect(new BlockMutatorBulkie(ModBlocks.block_slag)).setNoDrop()); vnt.setEntityProcessor(new EntityProcessorStandard()); vnt.setPlayerProcessor(new PlayerProcessorStandard()); vnt.setSFX(new ExplosionEffectStandard()); - vnt.explode(); + vnt.explode();*/ /*TimeAnalyzer.startCount("setBlock"); world.setBlock(pos.blockX, pos.blockY, pos.blockZ, Blocks.dirt); @@ -71,20 +52,12 @@ public class ItemWandD extends Item { tom.destructionRange = 600; world.spawnEntityInWorld(tom);*/ - /*ItemStack itemStack = new ItemStack(ModItems.book_lore); - BookLoreType.setTypeForStack(itemStack, BookLoreType.BOOK_IODINE); - - player.inventory.addItemStackToInventory(itemStack); - player.inventoryContainer.detectAndSendChanges();*/ - //use sparingly - /*int k = ((pos.blockX >> 4) << 4) + 8; + int k = ((pos.blockX >> 4) << 4) + 8; int l = ((pos.blockZ >> 4) << 4) + 8; - MapGenBunker.Start start = new MapGenBunker.Start(world, world.rand, pos.blockX >> 4, pos.blockZ >> 4); - start.generateStructure(world, world.rand, new StructureBoundingBox(k - 124, l - 124, k + 15 + 124, l + 15 + 124));*/ - //MapGenStronghold.Start startS = new MapGenStronghold.Start(world, world.rand, pos.blockX >> 4, pos.blockZ >> 4); - //startS.generateStructure(world, world.rand, new StructureBoundingBox(k - 124, l - 124, k + 15 + 124, l + 15 + 124)); + BunkerComponents.BunkerStart start = new BunkerComponents.BunkerStart(world, world.rand, pos.blockX >> 4, pos.blockZ >> 4); + start.generateStructure(world, world.rand, new StructureBoundingBox(k - 124, l - 124, k + 15 + 124, l + 15 + 124)); /*EntityNukeTorex torex = new EntityNukeTorex(world); torex.setPositionAndRotation(pos.blockX, pos.blockY + 1, pos.blockZ, 0, 0); diff --git a/src/main/java/com/hbm/lib/HbmWorld.java b/src/main/java/com/hbm/lib/HbmWorld.java index 44bea3667..c12dd3f6c 100644 --- a/src/main/java/com/hbm/lib/HbmWorld.java +++ b/src/main/java/com/hbm/lib/HbmWorld.java @@ -1,14 +1,16 @@ package com.hbm.lib; -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.OfficeFeatures; -import com.hbm.world.worldgen.components.RuinFeatures; +import com.hbm.world.gen.MapGenNTMFeatures; +import com.hbm.world.gen.NTMWorldGenerator; +import com.hbm.world.gen.component.BunkerComponents; +import com.hbm.world.gen.component.CivilianFeatures; +import com.hbm.world.gen.component.OfficeFeatures; +import com.hbm.world.gen.component.RuinFeatures; import cpw.mods.fml.common.IWorldGenerator; import cpw.mods.fml.common.registry.GameRegistry; import net.minecraft.world.gen.structure.MapGenStructureIO; +import net.minecraftforge.common.MinecraftForge; public class HbmWorld { @@ -24,7 +26,10 @@ public class HbmWorld { registerNTMFeatures(); registerWorldGen(new HbmWorldGen(), 1); - registerWorldGen(new NTMWorldGenerator(), 1); //Ideally, move everything over from HbmWorldGen to NTMWorldGenerator + + NTMWorldGenerator worldGenerator = new NTMWorldGenerator(); + registerWorldGen(worldGenerator, 1); //Ideally, move everything over from HbmWorldGen to NTMWorldGenerator + MinecraftForge.EVENT_BUS.register(worldGenerator); //registerWorldGen(new WorldGenTest(), 1); } @@ -37,5 +42,6 @@ public class HbmWorld { CivilianFeatures.registerComponents(); OfficeFeatures.registerComponents(); RuinFeatures.registerComponents(); + BunkerComponents.registerComponents(); } } diff --git a/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java b/src/main/java/com/hbm/world/gen/MapGenNTMFeatures.java similarity index 93% rename from src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java rename to src/main/java/com/hbm/world/gen/MapGenNTMFeatures.java index 4bb3ea17b..9c1a55339 100644 --- a/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java +++ b/src/main/java/com/hbm/world/gen/MapGenNTMFeatures.java @@ -1,4 +1,4 @@ -package com.hbm.world.worldgen; +package com.hbm.world.gen; import java.util.Arrays; import java.util.Iterator; @@ -7,9 +7,9 @@ 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.OfficeFeatures.*; -import com.hbm.world.worldgen.components.RuinFeatures.*; +import com.hbm.world.gen.component.CivilianFeatures.*; +import com.hbm.world.gen.component.OfficeFeatures.*; +import com.hbm.world.gen.component.RuinFeatures.*; import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase; @@ -99,10 +99,8 @@ public class MapGenNTMFeatures extends MapGenStructure { public Start(World world, Random rand, int chunkX, int chunkZ) { super(chunkX, chunkZ); - BiomeGenBase biome = world.getBiomeGenForCoords(chunkX * 16 + 8, chunkZ * 16 + 8); - int posY = world.getHeightValue(chunkX * 16 + 8, chunkZ * 16 + 8); - if(posY == 0) - posY = world.getTopSolidOrLiquidBlock(chunkX * 16 + 8, chunkZ * 16 + 8); + BiomeGenBase biome = world.getBiomeGenForCoords(chunkX * 16 + 8, chunkZ * 16 + 8); //Only gets the biome in the corner of the chunk. + final int posY = 64; // Terrain *does not exist* at this stage - at least, for vanilla. Here it has to be called after, but better safe than sorry. /* * Probably want to use nextInt() to increase the structures of rarity here. As a fallback, you could have generic stone brick/useless block ruins that will always be chosen if the diff --git a/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java b/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java new file mode 100644 index 000000000..0337af69a --- /dev/null +++ b/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java @@ -0,0 +1,126 @@ +package com.hbm.world.gen; + +import java.util.Random; + +import com.hbm.blocks.ModBlocks; +import com.hbm.blocks.generic.BlockNTMFlower.EnumFlowerType; +import com.hbm.config.StructureConfig; + +import cpw.mods.fml.common.IWorldGenerator; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import net.minecraft.block.Block; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.chunk.IChunkProvider; +import static net.minecraftforge.common.BiomeDictionary.*; +import net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate; +import net.minecraftforge.event.terraingen.InitMapGenEvent.EventType; +import net.minecraftforge.event.terraingen.PopulateChunkEvent; +import static net.minecraftforge.event.terraingen.TerrainGen.*; +import net.minecraftforge.event.world.WorldEvent; + +public class NTMWorldGenerator implements IWorldGenerator { + + private MapGenNTMFeatures scatteredFeatureGenerator = new MapGenNTMFeatures(); + + private final Random rand = new Random(); //A central random, used to cleanly generate our stuff without affecting vanilla or modded seeds. + + /** Inits all MapGen upon the loading of a new world. Hopefully clears out structureMaps and structureData when a different world is loaded. */ + @SubscribeEvent + public void onLoad(WorldEvent.Load event) { + scatteredFeatureGenerator = (MapGenNTMFeatures) getModdedMapGen(new MapGenNTMFeatures(), EventType.CUSTOM); + hasPopulationEvent = false; + } + + /** Called upon the initial population of a chunk. Called in the pre-population event first; called again if pre-population didn't occur (flatland) */ + private void setRandomSeed(World world, int chunkX, int chunkZ) { + rand.setSeed(world.getSeed()); + final long i = rand.nextLong() / 2L * 2L + 1L; + final long j = rand.nextLong() / 2L * 2L + 1L; + rand.setSeed((long)chunkX * i + (long)chunkZ * j ^ world.getSeed()); + } + + /* + * Pre-population Events / Structure Generation + * Used to generate structures without unnecessary intrusion by biome decoration, like trees. + */ + + private boolean hasPopulationEvent = false; // Does the given chunkGenerator have a population event? If not (flatlands), default to using generate. + + @SubscribeEvent + public void generateStructures(PopulateChunkEvent.Pre event) { + setRandomSeed(event.world, event.chunkX, event.chunkZ); //Set random for population down the line. + hasPopulationEvent = true; + + if(!StructureConfig.enableStructures) return; + + switch (event.world.provider.dimensionId) { + case -1: + break; + case 0: + generateOverworldStructures(event.world, event.chunkProvider, event.chunkX, event.chunkZ); + break; + case 1: + break; + } + } + + protected void generateOverworldStructures(World world, IChunkProvider chunkProvider, int chunkX, int chunkZ) { + Block[] ablock = new Block[65536]; //ablock isn't actually used for anything in MapGenStructure + + this.scatteredFeatureGenerator.func_151539_a(chunkProvider, world, chunkX, chunkZ, ablock); + this.scatteredFeatureGenerator.generateStructuresInChunk(world, rand, chunkX, chunkZ); + } + + /* + * Post-Vanilla / Modded Generation + * Used to generate features that don't care about intrusions (ores, craters, caves, etc.) + */ + + @Override + public void generate(Random rand, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { + + switch (world.provider.dimensionId) { + case -1: + generateNether(world, rand, chunkGenerator, chunkX, chunkZ); break; + case 0: + generateSurface(world, rand, chunkGenerator, chunkProvider, chunkX, chunkZ); break; + case 1: + generateEnd(world, rand, chunkGenerator, chunkX, chunkZ); break; + } + } + + private void generateNether(World world, Random rand, IChunkProvider chunkGenerator, int chunkX, int chunkZ) { } + + /* Overworld Generation */ + + private void generateSurface(World world, Random rand, IChunkProvider chunkGenerator, IChunkProvider chunkProvider, int chunkX, int chunkZ) { + if(!hasPopulationEvent) { //If we've failed to generate any structures (flatlands) + setRandomSeed(world, chunkX, chunkZ); //Reset the random seed to compensate + if(StructureConfig.enableStructures) generateOverworldStructures(world, chunkGenerator, chunkX, chunkZ); //Do it through the post-population generation directly + } + + final int posX = (chunkX << 4) + 8; + final int posZ = (chunkZ << 4) + 8; + BiomeGenBase biome = world.getBiomeGenForCoords(posX, posZ); + + /* biome dictionary my beloved <3 + * no check for tom here because the event handler already checks for decoration events, + this way they won't become permanently extinct. + */ + + /* Biome check, followed by chance, followed by event (for compat, both intra- and inter- (in the case of Tom). */ + + + } + + private void generateEnd(World world, Random rand, IChunkProvider chunkGenerator, int chunkX, int chunkZ) { } + + /** Utility method for biome checking multiple types exclusively. Not sure why it wasn't already present. */ + public static boolean isBiomeOfTypes(BiomeGenBase biome, Type... types) { //If new biomes are implemented, move this to any biome-related utility class. + for(Type type : types) { + if(!isBiomeOfType(biome, type)) return false; + } + + return true; + } +} \ No newline at end of file diff --git a/src/main/java/com/hbm/world/gen/ProceduralStructureStart.java b/src/main/java/com/hbm/world/gen/ProceduralStructureStart.java new file mode 100644 index 000000000..f5dcc1446 --- /dev/null +++ b/src/main/java/com/hbm/world/gen/ProceduralStructureStart.java @@ -0,0 +1,247 @@ +package com.hbm.world.gen; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Random; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraft.world.gen.structure.StructureBoundingBox; +import net.minecraft.world.gen.structure.StructureComponent; +import net.minecraft.world.gen.structure.StructureStart; + +/** This makes so much more sense! OOP wasn't confusing sometimes, you were just retarded! */ +public class ProceduralStructureStart extends StructureStart { + /** List of queued components to call buildComponent on randomly. Iterated over until hard limits reached. */ + public List queuedComponents = new ArrayList(); + /** List of the component weights for this particular structure -- weights removed as components are 'used up.' */ + protected List componentWeightList; //Make sure to initialize the array list to the weight array size, since might as well + + public ProceduralStructureStart() { } + + public ProceduralStructureStart(int chunkX, int chunkZ) { + super(chunkX, chunkZ); + } + + /** 'starter' is just the starting component, so like a village well. meant to be nice and convenient and not needing a super necessarily. */ + public ProceduralStructureStart buildStart(World world, Random rand, StructureComponent starter, Weight...weights) { + prepareWeights(weights); + + components.add(starter); + queuedComponents.add(starter); + while(!queuedComponents.isEmpty()) { + final int i = rand.nextInt(queuedComponents.size()); + StructureComponent component = queuedComponents.remove(i); + if(component instanceof ProceduralComponent) + ((ProceduralComponent) component).buildComponent(this, rand); //additional components are added to the list; the 'last component' is the caller already. + } + + this.updateBoundingBox(); + return this; + } + + public void prepareWeights(Weight...weights) { + componentWeightList = new ArrayList(weights.length); + + for(int i = 0; i < weights.length; i++) { + weights[i].instancesSpawned = 0; + componentWeightList.add(weights[i]); + } + } + + /** Reads from NBT. */ + @Override + public void func_143017_b(NBTTagCompound nbt) { + + } + + /** Writes to NBT. */ + @Override + public void func_143022_a(NBTTagCompound nbt) { + + } + + protected int getTotalWeight() { + boolean flag = false; + int totalWeight = 0; + Weight weight; + + for(Iterator iterator = componentWeightList.iterator(); iterator.hasNext(); totalWeight += weight.weight) { //Iterates over the entire list to find the total weight + weight = (Weight) iterator.next(); + + if(weight.instanceLimit >= 0 && weight.instancesSpawned < weight.instanceLimit) //can more structure pieces be added, in general? + flag = true; + } + + return flag ? totalWeight : -1; + } + + protected StructureComponent getWeightedComponent(StructureComponent last, Random rand, int minX, int minY, int minZ, int coordMode, int componentType) { + int totalWeight = getTotalWeight(); + + if(totalWeight < 0) + return null; + + for(int i = 0; i < 5; i++) { + int value = rand.nextInt(totalWeight); //Pick a random value, based on how many parts there are already + Iterator iterator = componentWeightList.iterator(); + + while(iterator.hasNext()) { + Weight weight = (Weight)iterator.next(); + value -= weight.weight; //Iterate over the list until the value is less than 0 + + if(value < 0) { + if(!weight.canSpawnStructure(componentType, coordMode, last)) //Additional checks based on game state info preventing spawn? start from beginning + break; + + StructureComponent component = weight.lambda.findValidPlacement(components, rand, minX, minY, minZ, coordMode, componentType); //Construct the chosen component + + if(component != null) { //If it has been constructed, add it + weight.instancesSpawned++; + + if(!weight.canSpawnMoreStructures()) //Structure can no longer be spawned regardless of game state? remove as an option + componentWeightList.remove(weight); + + return component; + } + + } + } + } + + return null; + } + + //might remove these, add hard limits so subclasses can create their own implementations + protected int sizeLimit = 50; + protected int distanceLimit = 64; + + /** Gets the next valid component based on the structure start's members */ + protected StructureComponent getNextValidComponent(StructureComponent last, Random rand, int minX, int minY, int minZ, int coordMode, int componentType) { + + if(components.size() > sizeLimit) //Hard limit on amount of components + return null; + + if(Math.abs(minX - (func_143019_e() * 16 + 8)) <= distanceLimit && Math.abs(minZ - (func_143018_f() * 16 + 8)) <= distanceLimit) { //Hard limit on spread of structure + + StructureComponent structure = getWeightedComponent(last, rand, minX, minY, minZ, coordMode, componentType + 1); //Returns null if all checks fail + + if(structure != null) { + this.components.add(structure); //Adds component to structure start list + this.queuedComponents.add(structure); //Add it to the list of queued components waiting to be built + } + + return structure; + } + + return null; + } + + /** Useful utility method to automatically construct the appropriate structure bounding box; based on the getNextComponents below!
+ * posX, posY, posZ represent the original anchor point of the structurecomponent (minX, minY, minZ).
+ * offsetX, offsetY, offsetZ all add onto that point, meaning that offsets will always move that anchor towards +x, +y, +z (in terms of south).
+ * maxX, maxY, maxZ additionally are added to get the maximum x, y, z (obviously) in terms of south. An offset of 1 is subtracted, so these do not start at 0, and + * refer to the ACTUAL dimensions of the component.
+ * The initial anchor point is kind of arbitrary based on where it is in the door, so what really matters is keeping it consistent. + */ + public static StructureBoundingBox getComponentToAddBoundingBox(int posX, int posY, int posZ, int offsetX, int offsetY, int offsetZ, int maxX, int maxY, int maxZ, int coordMode) { + switch(coordMode) { + default: + case 0: return new StructureBoundingBox(posX + offsetX, posY + offsetY, posZ + offsetZ, posX + maxX - 1 + offsetX, posY + maxY - 1 + offsetY, posZ + maxZ - 1 + offsetZ); //South + case 1: return new StructureBoundingBox(posX - maxZ + 1 - offsetZ, posY + offsetY, posZ + offsetX, posX - offsetZ, posY + maxY - 1 + offsetY, posZ + maxX - 1 + offsetX); //West + case 2: return new StructureBoundingBox(posX - maxX + 1 - offsetX, posY + offsetY, posZ - maxZ + 1 - offsetZ, posX - offsetX, posY + maxY - 1 + offsetY, posZ + offsetZ); //North + case 3: return new StructureBoundingBox(posX + offsetZ, posY + offsetY, posZ - maxX + 1 - offsetX, posX + maxZ - 1 + offsetZ, posY + maxY - 1 + offsetY, posZ - offsetX); //East + } + } + + /** no class-based multiple inheritance? */ + public static interface ProceduralComponent { + + public default void buildComponent(ProceduralStructureStart start, Random rand) { } //no class-based multiple inheritance? + + /** Gets next component in the direction this component is facing.
'original' refers to the initial starting component (hard distance limits), 'components' refers to the StructureStart list.
+ * offset and offsetY are added to the anchor point of the new component
, referring to the minX and minY respectively (in terms of south).
+ * An offset of 1 is added to the minZ anchor point, relative to south. + */ + public default StructureComponent getNextComponentNormal(ProceduralStructureStart start, StructureComponent caller, int coordMode, Random rand, int offset, int offsetY) { + StructureBoundingBox box = caller.getBoundingBox(); + switch(coordMode) { + case 0: return start.getNextValidComponent(caller, rand, box.minX + offset, box.minY + offsetY, box.maxZ + 1, coordMode, caller.getComponentType()); //South + case 1: return start.getNextValidComponent(caller, rand, box.minX - 1, box.minY + offsetY, box.minZ + offset, coordMode, caller.getComponentType()); //West + case 2: return start.getNextValidComponent(caller, rand, box.maxX - offset, box.minY + offsetY, box.minZ - 1, coordMode, caller.getComponentType()); //North + case 3: return start.getNextValidComponent(caller, rand, box.maxX + 1, box.minY + offsetY, box.maxZ - offset, coordMode, caller.getComponentType()); //East + default: return null; + } + } + + /** Gets next component in the opposite direction this component is facing. */ + public default StructureComponent getNextComponentAntiNormal(ProceduralStructureStart start, StructureComponent caller, int coordMode, Random rand, int offset, int offsetY) { + StructureBoundingBox box = caller.getBoundingBox(); + switch(coordMode) { + case 0: return start.getNextValidComponent(caller, rand, box.maxX - offset, box.minY + offsetY, box.minZ - 1, 2, caller.getComponentType()); //South + case 1: return start.getNextValidComponent(caller, rand, box.maxX + 1, box.minY + offsetY, box.maxZ - offset, 3, caller.getComponentType()); //West + case 2: return start.getNextValidComponent(caller, rand, box.minX + offset, box.minY + offsetY, box.maxZ + 1, 0, caller.getComponentType()); //North + case 3: return start.getNextValidComponent(caller, rand, box.minX - 1, box.minY + offsetY, box.minZ + offset, 1, caller.getComponentType()); //East + default: return null; + } + } + + //Keep in mind for these methods: a given room would have its *actual entrance* opposite the side it is facing. + /** Gets next component, to the West (-X) relative to this component. */ + public default StructureComponent getNextComponentWest(ProceduralStructureStart start, StructureComponent caller, int coordMode, Random rand, int offset, int offsetY) { + StructureBoundingBox box = caller.getBoundingBox(); + switch(coordMode) { + case 0: return start.getNextValidComponent(caller, rand, box.minX - 1, box.minY + offsetY, box.minZ + offset, 1, caller.getComponentType()); //South + case 1: return start.getNextValidComponent(caller, rand, box.maxX - offset, box.minY + offsetY, box.minZ - 1, 2, caller.getComponentType()); //West + case 2: return start.getNextValidComponent(caller, rand, box.maxX + 1, box.minY + offsetY, box.maxZ - offset, 3, caller.getComponentType()); //North + case 3: return start.getNextValidComponent(caller, rand, box.minX + offset, box.minY + offsetY, box.maxZ + 1, 0, caller.getComponentType()); //East + default: return null; + } + } + + /** Gets next component, to the East (+X) relative to this component. */ + public default StructureComponent getNextComponentEast(ProceduralStructureStart start, StructureComponent caller, int coordMode, Random rand, int offset, int offsetY) { + StructureBoundingBox box = caller.getBoundingBox(); + switch(coordMode) { + case 0: return start.getNextValidComponent(caller, rand, box.maxX + 1, box.minY + offsetY, box.maxZ - offset, 3, caller.getComponentType()); //South + case 1: return start.getNextValidComponent(caller, rand, box.minX + offset, box.minY + offsetY, box.maxZ + 1, 0, caller.getComponentType()); //West + case 2: return start.getNextValidComponent(caller, rand, box.minX - 1, box.minY + offsetY, box.minZ + offset, 1, caller.getComponentType()); //North + case 3: return start.getNextValidComponent(caller, rand, box.maxX - offset, box.minY + offsetY, box.minZ - 1, 2, caller.getComponentType()); //East + default: return null; + } + } + } + + /** Returns a new instance of this structureComponent, or null if not able to be placed.
Based on bounding box checks. Please use a method reference in the component. */ + @FunctionalInterface + protected static interface instantiateStructure { + StructureComponent findValidPlacement(List components, Random rand, int minX, int minY, int minZ, int coordMode, int componentType); + } + + protected static class Weight { + + public final instantiateStructure lambda; //Read above + + public final int weight; //Weight of this component + public int instancesSpawned; //How many components spawned? + public int instanceLimit; //Limit on amount of components: -1 for no limit + + public Weight(int weight, int limit, instantiateStructure lambda) { + this.weight = weight; + this.instanceLimit = limit; + this.lambda = lambda; + } + + //Checks if another structure can be spawned based on input data + public boolean canSpawnStructure(int componentAmount, int coordMode, StructureComponent component) { + return this.instanceLimit < 0 || this.instancesSpawned < this.instanceLimit; + } + + //Checks if another structure can be spawned at all (used to flag for removal from the list) + public boolean canSpawnMoreStructures() { + return this.instanceLimit < 0 || this.instancesSpawned < this.instanceLimit; + } + + } +} \ No newline at end of file diff --git a/src/main/java/com/hbm/world/gen/component/BunkerComponents.java b/src/main/java/com/hbm/world/gen/component/BunkerComponents.java new file mode 100644 index 000000000..b132b862d --- /dev/null +++ b/src/main/java/com/hbm/world/gen/component/BunkerComponents.java @@ -0,0 +1,547 @@ +package com.hbm.world.gen.component; + +import java.util.List; +import java.util.Random; + +import com.hbm.blocks.ModBlocks; +import com.hbm.lib.HbmChestContents; +import com.hbm.world.gen.ProceduralStructureStart; +import com.hbm.world.gen.ProceduralStructureStart.ProceduralComponent; +import com.hbm.world.gen.component.Component.ConcreteBricks; + +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +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; + +public class BunkerComponents { + + public static class BunkerStart extends ProceduralStructureStart { + + public BunkerStart(World world, Random rand, int chunkX, int chunkZ) { + super(chunkX, chunkZ); + + this.sizeLimit = 7 + rand.nextInt(6); + this.distanceLimit = 40; + + final int x = chunkX * 16 + 8; + final int z = chunkZ * 16 + 8; + + Weight[] weights = new Weight[] { + new Weight(6, 3, Corridor::findValidPlacement), + new Weight(7, 4, BedroomL::findValidPlacement), + new Weight(10, 3, FunJunction::findValidPlacement), + new Weight(5, 2, BathroomL::findValidPlacement), + }; + + StructureComponent starter = new StartingHub(rand, x, z); + + buildStart(world, rand, starter, weights); + + this.markAvailableHeight(world, rand, 20); + } + + } + + public static void registerComponents() { + MapGenStructureIO.func_143031_a(StartingHub.class, "NTMBStartingHub"); + MapGenStructureIO.func_143031_a(Corridor.class, "NTMBCorridor"); + MapGenStructureIO.func_143031_a(BedroomL.class, "NTMBBedroomL"); + MapGenStructureIO.func_143031_a(FunJunction.class, "NTMBFunJunction"); + MapGenStructureIO.func_143031_a(BathroomL.class, "NTMBBathroomL"); + //TODO more rooms for more variety + } + + //why are we still doing this? + private static ConcreteBricks ConcreteBricks = new ConcreteBricks(); + + public static class StartingHub extends Component implements ProceduralComponent { + + private boolean[] paths = new boolean[3]; + + public StartingHub() { } + + public StartingHub(Random rand, int x, int z) { + super(rand, x, 64, z, 7, 5, 7); + } + + public StartingHub(int componentType, StructureBoundingBox box, int coordMode) { + super(componentType); + this.boundingBox = box; + this.coordBaseMode = coordMode; + } + + /** write to nbt */ + @Override + protected void func_143012_a(NBTTagCompound nbt) { + super.func_143012_a(nbt); + for(int i = 0; i < paths.length; i++) + nbt.setBoolean("p" + i, paths[i]); + } + + /** read from nbt */ + @Override + protected void func_143011_b(NBTTagCompound nbt) { + super.func_143011_b(nbt); + for(int i = 0; i < paths.length; i++) + paths[i] = nbt.getBoolean("p" + i); + } + + @Override + public void buildComponent(ProceduralStructureStart start, Random rand) { + paths[0] = this.getNextComponentEast(start, this, coordBaseMode, rand, 5, 1) != null; + paths[1] = this.getNextComponentAntiNormal(start, this, coordBaseMode, rand, 4, 1) != null; + paths[2] = this.getNextComponentWest(start, this, coordBaseMode, rand, 3, 1) != null; + } + + @Override + public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { + + fillWithAir(world, box, 1, 1, 1, 6, 3, 6); + //floor + fillWithMetadataBlocks(world, box, 1, 0, 1, 6, 0, 6, ModBlocks.vinyl_tile, 1); + //ceiling + fillWithBlocks(world, box, 1, 4, 1, 6, 4, 6, ModBlocks.vinyl_tile); + //upper shield + fillWithBlocks(world, box, 1, 4, 4, 3, 4, 6, ModBlocks.reinforced_stone); + fillWithBlocks(world, box, 0, 5, 0, 7, 5, 7, ModBlocks.reinforced_stone); + //walls + fillWithRandomizedBlocks(world, box, 0, 0, 0, 0, 4, 7, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 1, 0, 7, 6, 4, 7, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 7, 0, 0, 7, 4, 7, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 1, 0, 0, 6, 4, 0, rand, ConcreteBricks); + //meh, fix the area later + final int hpos = Component.getAverageHeight(world, boundingBox, box, componentType - boundingBox.minY); + //top hatch + placeBlockAtCurrentPosition(world, ModBlocks.concrete_slab, 1, 0, hpos, 5, box); + fillWithMetadataBlocks(world, box, 1, hpos, 4, 1, hpos, 6, ModBlocks.concrete_smooth_stairs, getStairMeta(0)); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_slab, 1, 2, hpos, 3, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, getStairMeta(2), 2, hpos, 4, box); + placeBlockAtCurrentPosition(world, Blocks.trapdoor, getDecoModelMeta(8) >> 2, 2, hpos, 5, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, getStairMeta(3), 2, hpos, 6, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_slab, 1, 2, hpos, 7, box); + fillWithMetadataBlocks(world, box, 3, hpos, 4, 3, hpos, 6, ModBlocks.concrete_smooth_stairs, getStairMeta(1)); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_slab, 1, 4, hpos, 5, box); + //tunnel downwards + fillWithBlocks(world, box, 1, 6, 4, 1, hpos - 1, 6, ModBlocks.reinforced_stone); + fillWithBlocks(world, box, 2, 1, 6, 2, hpos - 1, 6, ModBlocks.reinforced_stone); + fillWithBlocks(world, box, 3, 6, 4, 3, hpos - 1, 6, ModBlocks.reinforced_stone); + fillWithBlocks(world, box, 2, 6, 4, 2, hpos - 1, 4, ModBlocks.reinforced_stone); + fillWithMetadataBlocks(world, box, 2, 1, 5, 2, hpos - 1, 5, ModBlocks.ladder_sturdy, getDecoMeta(2)); //double check meta + + /* DECO */ + //lamps + placeBlockAtCurrentPosition(world, ModBlocks.reinforced_lamp_off, 0, 2, 5, 2, box); + placeBlockAtCurrentPosition(world, ModBlocks.reinforced_lamp_off, 0, 5, 5, 2, box); + placeBlockAtCurrentPosition(world, ModBlocks.reinforced_lamp_off, 0, 5, 5, 5, box); + placeBlockAtCurrentPosition(world, ModBlocks.fan, 0, 2, 4, 2, box); + placeBlockAtCurrentPosition(world, ModBlocks.fan, 0, 5, 4, 2, box); + placeBlockAtCurrentPosition(world, ModBlocks.fan, 0, 5, 4, 5, box); + //machine + placeBlockAtCurrentPosition(world, ModBlocks.deco_tungsten, 0, 3, 1, 6, box); + generateInvContents(world, box, rand, Blocks.chest, getDecoMeta(2), 4, 1, 6, HbmChestContents.antenna/*TODO change */, 5); + placeBlockAtCurrentPosition(world, ModBlocks.deco_tungsten, 0, 5, 1, 6, box); + fillWithMetadataBlocks(world, box, 3, 2, 6, 5, 2, 6, ModBlocks.concrete_smooth_stairs, getStairMeta(2) | 4); + fillWithMetadataBlocks(world, box, 3, 3, 6, 5, 3, 6, ModBlocks.tape_recorder, getDecoMeta(2)); + //desk + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, getStairMeta(1) | 4, 3, 1, 4, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, getStairMeta(3) | 4, 4, 1, 4, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, getStairMeta(0) | 4, 5, 1, 4, box); + placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, getDecoModelMeta(0), 4, 2, 4, box); + //clear out entryways based on path + if(paths[0]) fillWithAir(world, box, 7, 1, 2, 7, 2, 3); + if(paths[1]) fillWithAir(world, box, 3, 1, 0, 4, 2, 0); + if(paths[2]) fillWithAir(world, box, 0, 1, 2, 0, 2, 3); + + return true; + } + } + + public static class Corridor extends Component implements ProceduralComponent { + + private boolean path; + + public Corridor() { } + + public Corridor(int componentType, StructureBoundingBox box, int coordMode) { + super(componentType); + this.boundingBox = box; + this.coordBaseMode = coordMode; + } + + /** write to nbt */ + @Override + protected void func_143012_a(NBTTagCompound nbt) { + super.func_143012_a(nbt); + nbt.setBoolean("p", path); + } + + /** read from nbt */ + @Override + protected void func_143011_b(NBTTagCompound nbt) { + super.func_143011_b(nbt); + path = nbt.getBoolean("p"); + } + + @Override + public void buildComponent(ProceduralStructureStart start, Random rand) { + path = this.getNextComponentNormal(start, this, coordBaseMode, rand, 3, 1) != null; + } + + @Override + public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { + + fillWithAir(world, box, 1, 1, 1, 4, 3, 5); + //floor + fillWithMetadataBlocks(world, box, 1, 0, 1, 4, 0, 5, ModBlocks.vinyl_tile, 1); + //ceiling + fillWithBlocks(world, box, 1, 4, 1, 4, 4, 5, ModBlocks.vinyl_tile); + //upper shield + fillWithBlocks(world, box, 0, 5, 0, 5, 5, 6, ModBlocks.reinforced_stone); + //walls + fillWithRandomizedBlocks(world, box, 0, 0, 0, 0, 4, 6, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 1, 0, 6, 4, 4, 6, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 5, 0, 0, 5, 4, 6, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 1, 0, 0, 4, 4, 0, rand, ConcreteBricks); + + //TODO different deco types? maybe plants or vending machines? + //save it to nbt either way + /* DECO */ + //lamps + fillWithBlocks(world, box, 2, 5, 3, 3, 5, 3, ModBlocks.reinforced_lamp_off); + fillWithBlocks(world, box, 2, 4, 3, 3, 4, 3, ModBlocks.fan); + //table w/ chairs + final int stairMetaS = getStairMeta(3); + final int stairMetaN = getStairMeta(2); + + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaS, 1, 1, 2, box); + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaN, 1, 1, 4, box); + placeBlockAtCurrentPosition(world, Blocks.fence, 0, 1, 1, 3, box); + placeBlockAtCurrentPosition(world, Blocks.wooden_pressure_plate, 1, 1, 2, 3, box); + //desk w/ computer + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaS | 4, 4, 1, 2, box); + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaN, 4, 1, 4, box); + placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, getDecoModelMeta(1), 4, 2, 2, box); + //doors + placeDoor(world, box, ModBlocks.door_bunker, 1, true, rand.nextBoolean(), 2, 1, 0); + placeDoor(world, box, ModBlocks.door_bunker, 1, false, rand.nextBoolean(), 3, 1, 0); + if(path) fillWithAir(world, box, 2, 1, 6, 3, 2, 6); + + return true; + } + + public static StructureComponent findValidPlacement(List components, Random rand, int x, int y, int z, int coordMode, int type) { + StructureBoundingBox box = ProceduralStructureStart.getComponentToAddBoundingBox(x, y, z, -3, -1, 0, 6, 6, 7, coordMode); + return box.minY > 10 && StructureComponent.findIntersecting(components, box) == null ? new Corridor(type, box, coordMode) : null; + } + } + + public static class BedroomL extends Component implements ProceduralComponent { + + private boolean path; + + public BedroomL() { } + + public BedroomL(int componentType, StructureBoundingBox box, int coordMode) { + super(componentType); + this.boundingBox = box; + this.coordBaseMode = coordMode; + } + + /** write to nbt */ + @Override + protected void func_143012_a(NBTTagCompound nbt) { + super.func_143012_a(nbt); + nbt.setBoolean("p", path); + } + + /** read from nbt */ + @Override + protected void func_143011_b(NBTTagCompound nbt) { + super.func_143011_b(nbt); + path = nbt.getBoolean("p"); + } + + @Override + public void buildComponent(ProceduralStructureStart start, Random rand) { + path = this.getNextComponentWest(start, this, coordBaseMode, rand, 9, 1) != null; + } + + @Override + public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { + + fillWithAir(world, box, 4, 1, 1, 8, 3, 4); + fillWithAir(world, box, 1, 1, 5, 8, 3, 9); + //floor + fillWithMetadataBlocks(world, box, 4, 0, 1, 8, 0, 4, ModBlocks.vinyl_tile, 1); + fillWithMetadataBlocks(world, box, 1, 0, 5, 8, 0, 9, ModBlocks.vinyl_tile, 1); + //ceiling + fillWithBlocks(world, box, 4, 4, 1, 8, 4, 4, ModBlocks.vinyl_tile); + fillWithBlocks(world, box, 1, 4, 5, 8, 4, 9, ModBlocks.vinyl_tile); + //upper shield + fillWithBlocks(world, box, 3, 5, 0, 9, 5, 3, ModBlocks.reinforced_stone); + fillWithBlocks(world, box, 0, 5, 4, 9, 5, 10, ModBlocks.reinforced_stone); + //walls + fillWithRandomizedBlocks(world, box, 0, 0, 4, 0, 4, 10, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 1, 0, 10, 8, 4, 10, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 9, 0, 0, 9, 4, 10, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 4, 0, 0, 8, 4, 0, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 3, 0, 0, 3, 4, 4, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 1, 0, 4, 2, 4, 4, rand, ConcreteBricks); + + /* DECO */ + //lamps + placeBlockAtCurrentPosition(world, ModBlocks.reinforced_lamp_off, 0, 3, 5, 7, box); + placeBlockAtCurrentPosition(world, ModBlocks.reinforced_lamp_off, 0, 6, 5, 7, box); + placeBlockAtCurrentPosition(world, ModBlocks.reinforced_lamp_off, 0, 6, 5, 3, box); + placeBlockAtCurrentPosition(world, ModBlocks.fan, 0, 3, 4, 7, box); + placeBlockAtCurrentPosition(world, ModBlocks.fan, 0, 6, 4, 7, box); + placeBlockAtCurrentPosition(world, ModBlocks.fan, 0, 6, 4, 3, box); + //Beds w/ table + final int stairMetaW = getStairMeta(0); + final int stairMetaE = getStairMeta(1); + final int stairMetaN = getStairMeta(2); + final int stairMetaS = getStairMeta(3); + placeBed(world, box, 1, 5, 1, 1); + placeBed(world, box, 1, 5, 1, 3); + placeBed(world, box, 2, 3, 1, 6); + placeBed(world, box, 2, 1, 1, 6); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaE | 4, 4, 1, 2, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaE | 4, 4, 1, 4, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaS | 4, 4, 1, 5, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaS | 4, 2, 1, 5, box); + placeBlockAtCurrentPosition(world, ModBlocks.radiorec, getDecoMeta(4), 4, 2, 4, box); + //table w/ microwave + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaS | 4, 8, 1, 3, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaN | 4, 8, 1, 4, box); + placeBlockAtCurrentPosition(world, Blocks.noteblock, 0, 8, 1, 5, box); + placeBlockAtCurrentPosition(world, ModBlocks.machine_microwave, getDecoMeta(4), 8, 2, 4, box); + //desk w/ computer + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaW | 4, 6, 1, 9, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaN | 4, 5, 1, 9, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaE | 4, 4, 1, 9, box); + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaS, 5, 1, 8, box); + placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, getDecoModelMeta(0), 5, 2, 9, box); + generateInvContents(world, box, rand, ModBlocks.filing_cabinet, getDecoModelMeta(0), 3, 1, 9, HbmChestContents.antenna/*TODO change */, 5); + //lockers + generateInvContents(world, box, rand, Blocks.chest, getDecoMeta(4), 8, 1, 7, HbmChestContents.antenna/*TODO change */, 3); + generateInvContents(world, box, rand, Blocks.chest, getDecoMeta(4), 8, 2, 7, HbmChestContents.antenna/*TODO change */, 3); + fillWithBlocks(world, box, 8, 1, 8, 8, 2, 8, ModBlocks.deco_tungsten); + generateInvContents(world, box, rand, Blocks.chest, getDecoMeta(4), 8, 1, 9, HbmChestContents.antenna/*TODO change */, 3); + generateInvContents(world, box, rand, Blocks.chest, getDecoMeta(4), 8, 2, 9, HbmChestContents.antenna/*TODO change */, 3); + fillWithMetadataBlocks(world, box, 8, 3, 7, 8, 3, 9, Blocks.trapdoor, getDecoModelMeta(2) >> 2); + //doors + placeDoor(world, box, ModBlocks.door_bunker, 1, true, rand.nextBoolean(), 7, 1, 0); + placeDoor(world, box, ModBlocks.door_bunker, 1, false, rand.nextBoolean(), 8, 1, 0); + if(path) fillWithAir(world, box, 0, 1, 8, 0, 2, 9); + + return true; + } + + public static StructureComponent findValidPlacement(List components, Random rand, int x, int y, int z, int coordMode, int type) { + StructureBoundingBox box = ProceduralStructureStart.getComponentToAddBoundingBox(x, y, z, -8, -1, 0, 10, 6, 11, coordMode); + return box.minY > 10 && StructureComponent.findIntersecting(components, box) == null ? new BedroomL(type, box, coordMode) : null; + } + } + + public static class FunJunction extends Component implements ProceduralComponent { + + private boolean[] paths = new boolean[2]; + + public FunJunction() { } + + public FunJunction(int componentType, StructureBoundingBox box, int coordMode) { + super(componentType); + this.boundingBox = box; + this.coordBaseMode = coordMode; + } + + /** write to nbt */ + @Override + protected void func_143012_a(NBTTagCompound nbt) { + super.func_143012_a(nbt); + for(int i = 0; i < paths.length; i++) + nbt.setBoolean("p" + i, paths[i]); + } + + /** read from nbt */ + @Override + protected void func_143011_b(NBTTagCompound nbt) { + super.func_143011_b(nbt); + for(int i = 0; i < paths.length; i++) + paths[i] = nbt.getBoolean("p" + i); + } + + @Override + public void buildComponent(ProceduralStructureStart start, Random rand) { + paths[0] = this.getNextComponentEast(start, this, coordBaseMode, rand, 6, 1) != null; + paths[1] = this.getNextComponentNormal(start, this, coordBaseMode, rand, 5, 1) != null; + } + + @Override + public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { + + fillWithAir(world, box, 1, 1, 1, 6, 3, 10); + //floor + fillWithMetadataBlocks(world, box, 1, 0, 1, 6, 0, 10, ModBlocks.vinyl_tile, 1); + //ceiling + fillWithBlocks(world, box, 1, 4, 1, 6, 4, 10, ModBlocks.vinyl_tile); + //upper shield + fillWithBlocks(world, box, 0, 5, 0, 7, 5, 11, ModBlocks.reinforced_stone); + //walls + fillWithRandomizedBlocks(world, box, 0, 0, 0, 0, 4, 11, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 1, 0, 11, 6, 4, 11, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 7, 0, 0, 7, 4, 11, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 1, 0, 0, 6, 4, 0, rand, ConcreteBricks); + + /* DECO */ + //lamps + placeBlockAtCurrentPosition(world, ModBlocks.reinforced_lamp_off, 0, 2, 5, 3, box); + fillWithBlocks(world, box, 5, 5, 5, 5, 5, 6, ModBlocks.reinforced_lamp_off); + placeBlockAtCurrentPosition(world, ModBlocks.reinforced_lamp_off, 0, 2, 5, 8, box); + placeBlockAtCurrentPosition(world, ModBlocks.fan, 0, 2, 4, 3, box); + fillWithBlocks(world, box, 5, 4, 5, 5, 4, 6, ModBlocks.fan); + placeBlockAtCurrentPosition(world, ModBlocks.fan, 0, 2, 4, 8, box); + //couches w/ tables + final int stairMetaW = getStairMeta(0); + final int stairMetaE = getStairMeta(1); + final int stairMetaN = getStairMeta(2); + final int stairMetaS = getStairMeta(3); + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaE, 1, 1, 1, box); + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaS, 2, 1, 1, box); + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaW, 3, 1, 1, box); + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaS, 1, 1, 4, box); + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaE, 1, 1, 5, box); + fillWithMetadataBlocks(world, box, 1, 1, 6, 2, 1, 6, Blocks.oak_stairs, stairMetaN); + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaW, 3, 1, 6, box); + placeBlockAtCurrentPosition(world, Blocks.fence, 0, 1, 1, 3, box); + placeBlockAtCurrentPosition(world, Blocks.wooden_pressure_plate, 0, 1, 2, 3, box); + placeBlockAtCurrentPosition(world, Blocks.fence, 0, 3, 1, 4, box); + placeBlockAtCurrentPosition(world, Blocks.wooden_pressure_plate, 0, 3, 2, 4, box); + //table & chest + placeBlockAtCurrentPosition(world, Blocks.fence, 0, 6, 1, 2, box); + placeBlockAtCurrentPosition(world, Blocks.wooden_pressure_plate, 0, 6, 2, 2, box); + generateInvContents(world, box, rand, Blocks.chest, getDecoMeta(4), 6, 1, 3, HbmChestContents.antenna/*TODO change */, 7); + //desk w/ computer + bobblehead + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaS | 4, 1, 1, 8, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaE | 4, 1, 1, 9, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaN | 4, 1, 1, 10, box); + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaS, 2, 1, 8, box); + placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, getDecoModelMeta(3), 1, 2, 9, box); + if(rand.nextBoolean()) placeRandomBobble(world, box, rand, 1, 2, 8); + //jukebox + fillWithBlocks(world, box, 6, 1, 8, 6, 2, 8, Blocks.noteblock); + placeBlockAtCurrentPosition(world, ModBlocks.deco_tungsten, 0, 6, 1, 9, box); + placeBlockAtCurrentPosition(world, ModBlocks.tape_recorder, getDecoMeta(4), 6, 2, 9, box); + fillWithBlocks(world, box, 6, 3, 8, 6, 3, 9, ModBlocks.concrete_slab); + placeBlockAtCurrentPosition(world, Blocks.lever, getDecoMeta(2), 5, 1, 9, box); //double-check meta + //doors + placeDoor(world, box, ModBlocks.door_bunker, 1, true, rand.nextBoolean(), 4, 1, 0); + placeDoor(world, box, ModBlocks.door_bunker, 1, false, rand.nextBoolean(), 5, 1, 0); + if(paths[0]) fillWithAir(world, box, 7, 1, 5, 7, 2, 6); + if(paths[1]) fillWithAir(world, box, 4, 1, 11, 5, 2, 11); + + return true; + } + + public static StructureComponent findValidPlacement(List components, Random rand, int x, int y, int z, int coordMode, int type) { + StructureBoundingBox box = ProceduralStructureStart.getComponentToAddBoundingBox(x, y, z, -5, -1, 0, 8, 6, 12, coordMode); + return box.minY > 10 && StructureComponent.findIntersecting(components, box) == null ? new FunJunction(type, box, coordMode) : null; + } + } + + public static class BathroomL extends Component implements ProceduralComponent { + + private boolean path; + + public BathroomL() { } + + public BathroomL(int componentType, StructureBoundingBox box, int coordMode) { + super(componentType); + this.boundingBox = box; + this.coordBaseMode = coordMode; + } + + /** write to nbt */ + @Override + protected void func_143012_a(NBTTagCompound nbt) { + super.func_143012_a(nbt); + nbt.setBoolean("p", path); + } + + /** read from nbt */ + @Override + protected void func_143011_b(NBTTagCompound nbt) { + super.func_143011_b(nbt); + path = nbt.getBoolean("p"); + } + + @Override + public void buildComponent(ProceduralStructureStart start, Random rand) { + path = this.getNextComponentEast(start, this, coordBaseMode, rand, 3, 1) != null; + } + + @Override + public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { + + fillWithAir(world, box, 1, 1, 1, 7, 3, 9); + //floor + fillWithMetadataBlocks(world, box, 1, 0, 1, 7, 0, 9, ModBlocks.vinyl_tile, 1); + //ceiling + fillWithBlocks(world, box, 1, 4, 1, 7, 4, 9, ModBlocks.vinyl_tile); + //upper shield + fillWithBlocks(world, box, 0, 5, 0, 8, 5, 10, ModBlocks.reinforced_stone); + //walls + fillWithRandomizedBlocks(world, box, 0, 0, 0, 0, 4, 10, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 1, 0, 10, 7, 4, 10, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 8, 0, 0, 8, 4, 10, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 1, 0, 0, 7, 4, 0, rand, ConcreteBricks); + + /* DECO */ + //lamps + placeBlockAtCurrentPosition(world, ModBlocks.reinforced_lamp_off, 0, 2, 5, 3, box); + placeBlockAtCurrentPosition(world, ModBlocks.reinforced_lamp_off, 0, 2, 5, 7, box); + placeBlockAtCurrentPosition(world, ModBlocks.reinforced_lamp_off, 0, 5, 5, 7, box); + placeBlockAtCurrentPosition(world, ModBlocks.reinforced_lamp_off, 0, 5, 5, 3, box); + placeBlockAtCurrentPosition(world, ModBlocks.fan, 0, 2, 4, 3, box); + placeBlockAtCurrentPosition(world, ModBlocks.fan, 0, 2, 4, 7, box); + placeBlockAtCurrentPosition(world, ModBlocks.fan, 0, 5, 4, 7, box); + placeBlockAtCurrentPosition(world, ModBlocks.fan, 0, 5, 4, 3, box); + //sinks + for(int i = 2; i <= 8; i += 2) { + placeBlockAtCurrentPosition(world, Blocks.cauldron, rand.nextInt(4), 1, 1, i, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_slab, 8, 1, 1, i + 1, box); + placeBlockAtCurrentPosition(world, Blocks.tripwire_hook, getTripwireMeta(3), 1, 2, i, box); + } + //hand-dryers (industrial-strength) + placeBlockAtCurrentPosition(world, ModBlocks.steel_beam, 3, 4, 1, 9, box); + placeBlockAtCurrentPosition(world, ModBlocks.fan, getDecoMeta(2), 4, 2, 9, box); + placeBlockAtCurrentPosition(world, Blocks.stone_button, 2, 3, 2, 9, box); //TODO button meta + placeBlockAtCurrentPosition(world, ModBlocks.steel_beam, 3, 6, 1, 9, box); + placeBlockAtCurrentPosition(world, ModBlocks.fan, getDecoMeta(2), 6, 2, 9, box); + placeBlockAtCurrentPosition(world, Blocks.stone_button, 1, 7, 2, 9, box); + //stalls w/ toilets + for(int i = 1; i <= 5; i += 2) { + placeBlockAtCurrentPosition(world, ModBlocks.door_metal, 0, 5, 1, i, box); + placeDoor(world, box, ModBlocks.door_metal, 0, false, rand.nextBoolean(), 5, 1, i); + fillWithMetadataBlocks(world, box, 5, 1, i + 1, 5, 2, i + 1, ModBlocks.steel_corner, getDecoMeta(2)); + fillWithMetadataBlocks(world, box, 6, 1, i + 1, 7, 2, i + 1, ModBlocks.steel_wall, getDecoMeta(2)); + placeBlockAtCurrentPosition(world, ModBlocks.deco_pipe_rim, 0, 7, 1, i, box); + placeBlockAtCurrentPosition(world, Blocks.trapdoor, getDecoModelMeta(2) >> 2, 7, 2, i, box); + } + //doors + placeDoor(world, box, ModBlocks.door_bunker, 1, true, rand.nextBoolean(), 2, 1, 0); + placeDoor(world, box, ModBlocks.door_bunker, 1, false, rand.nextBoolean(), 3, 1, 0); + if(path) fillWithAir(world, box, 8, 1, 7, 8, 2, 8); + + return true; + } + + public static StructureComponent findValidPlacement(List components, Random rand, int x, int y, int z, int coordMode, int type) { + StructureBoundingBox box = ProceduralStructureStart.getComponentToAddBoundingBox(x, y, z, -3, -1, 0, 9, 6, 11, coordMode); + return box.minY > 10 && StructureComponent.findIntersecting(components, box) == null ? new BathroomL(type, box, coordMode) : null; + } + } +} diff --git a/src/main/java/com/hbm/world/worldgen/components/CivilianFeatures.java b/src/main/java/com/hbm/world/gen/component/CivilianFeatures.java similarity index 99% rename from src/main/java/com/hbm/world/worldgen/components/CivilianFeatures.java rename to src/main/java/com/hbm/world/gen/component/CivilianFeatures.java index 958313bd7..60190d1c0 100644 --- a/src/main/java/com/hbm/world/worldgen/components/CivilianFeatures.java +++ b/src/main/java/com/hbm/world/gen/component/CivilianFeatures.java @@ -1,4 +1,4 @@ -package com.hbm.world.worldgen.components; +package com.hbm.world.gen.component; import java.util.Random; diff --git a/src/main/java/com/hbm/world/worldgen/components/Component.java b/src/main/java/com/hbm/world/gen/component/Component.java similarity index 94% rename from src/main/java/com/hbm/world/worldgen/components/Component.java rename to src/main/java/com/hbm/world/gen/component/Component.java index 9c6c8e527..effd0c592 100644 --- a/src/main/java/com/hbm/world/worldgen/components/Component.java +++ b/src/main/java/com/hbm/world/gen/component/Component.java @@ -1,4 +1,4 @@ -package com.hbm.world.worldgen.components; +package com.hbm.world.gen.component; import java.util.Random; @@ -108,6 +108,26 @@ abstract public class Component extends StructureComponent { return true; } + protected static int getAverageHeight(World world, StructureBoundingBox area, StructureBoundingBox box, int y) { + + int total = 0; + int iterations = 0; + + for(int z = area.minZ; z <= area.maxZ; z++) { + for(int x = area.minX; x <= area.maxX; x++) { + if(box.isVecInside(x, y, z)) { + total += Math.max(world.getTopSolidOrLiquidBlock(x, z), world.provider.getAverageGroundLevel()); + iterations++; + } + } + } + + if(iterations == 0) + return -1; + + return total / iterations; + } + public int getCoordMode() { return this.coordBaseMode; } @@ -224,35 +244,41 @@ abstract public class Component 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 + /* + * Assuming door is on opposite side of block from direction: East: 0, South: 1, West: 2, North: 3
+ * Doors cleverly take advantage of the use of two blocks to get around the 16 value limit on metadata, with the top and bottom blocks essentially relying on eachother for everything.
+ *
  • The 4th bit (0b1000 or 8) indicates whether it is the top block: on for yes, off for no. + *
  • When the 4th bit is on, the 1st bit indicates whether the door opens to the right or not: on (0b1001) for yes, off (0b1000) for no. + *
  • The bits 1 & 2 (0b0011 or 3) indicate the direction the door is facing. + *
  • When the 4th bit is off, the 3rd bit (0b0100 or 4) indicates whether the door is open or not: on for yes, off for no. Used for doors' interactions with redstone power. + *
  • */ - 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; - } - + protected void placeDoor(World world, StructureBoundingBox box, Block door, int dirMeta, boolean opensRight, boolean isOpen, int featureX, int featureY, int featureZ) { //isOpen for randomly opened doors 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); + if(!box.isVecInside(posX, posY, posZ)) return; + + switch(this.coordBaseMode) { + default: + break; + case 1: + dirMeta = (dirMeta + 1) % 4; break; + case 2: + dirMeta ^= 2; break; //Flip second bit + case 3: + dirMeta = (dirMeta - 1) % 4; break; + } + + //hee hoo + int metaTop = opensRight ? 0b1001 : 0b1000; + int metaBottom = dirMeta | (isOpen ? 0b100 : 0); + + if(world.doesBlockHaveSolidTopSurface(world, posX, posY - 1, posZ)) { + world.setBlock(posX, posY, posZ, door, metaBottom, 2); + world.setBlock(posX, posY + 1, posZ, door, metaTop, 2); + } } /**N:0 W:1 S:2 E:3 */ diff --git a/src/main/java/com/hbm/world/worldgen/components/OfficeFeatures.java b/src/main/java/com/hbm/world/gen/component/OfficeFeatures.java similarity index 96% rename from src/main/java/com/hbm/world/worldgen/components/OfficeFeatures.java rename to src/main/java/com/hbm/world/gen/component/OfficeFeatures.java index 22ad5fead..3a3549106 100644 --- a/src/main/java/com/hbm/world/worldgen/components/OfficeFeatures.java +++ b/src/main/java/com/hbm/world/gen/component/OfficeFeatures.java @@ -1,4 +1,4 @@ -package com.hbm.world.worldgen.components; +package com.hbm.world.gen.component; import java.util.Random; @@ -200,9 +200,9 @@ public class OfficeFeatures { 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); + placeDoor(world, box, ModBlocks.door_office, 3, false, rand.nextBoolean(), 2, 1, 7); + placeDoor(world, box, ModBlocks.door_office, 3, false, rand.nextBoolean(), 3, 1, 7); + placeDoor(world, box, ModBlocks.door_office, 0, false, rand.nextBoolean(), 5, 1, 6); //Woot if(!this.hasPlacedLoot[0]) @@ -427,16 +427,16 @@ public class OfficeFeatures { fillWithRandomizedBlocks(world, box, 2, 11, 10, 3, 11, 10, rand, ConcreteBricks); fillWithRandomizedBlocks(world, box, 2, 9, 10, 2, 10, 10, rand, ConcreteBricks); //Doors - placeDoor(world, box, Blocks.wooden_door, 3, 1, 1, 14); - placeDoor(world, box, Blocks.wooden_door, 3, 2, 1, 14); - placeDoor(world, box, Blocks.wooden_door, 0, 0, 1, 12); - placeDoor(world, box, Blocks.wooden_door, 0, 0, 1, 13); - placeDoor(world, box, ModBlocks.door_office, 0, 6, 1, 3); - placeDoor(world, box, ModBlocks.door_office, 0, 5, 5, 3); - placeDoor(world, box, ModBlocks.door_office, 2, 4, 5, 11); - placeDoor(world, box, ModBlocks.door_office, 0, 10, 9, 3); - placeDoor(world, box, ModBlocks.door_office, 1, 3, 9, 10); - placeDoor(world, box, ModBlocks.door_metal, 0, 5, 13, 3); + placeDoor(world, box, Blocks.wooden_door, 3, false, rand.nextBoolean(), 1, 1, 14); + placeDoor(world, box, Blocks.wooden_door, 3, true, rand.nextBoolean(), 2, 1, 14); + placeDoor(world, box, Blocks.wooden_door, 0, false, rand.nextBoolean(), 0, 1, 12); + placeDoor(world, box, Blocks.wooden_door, 0, true, rand.nextBoolean(), 0, 1, 13); + placeDoor(world, box, ModBlocks.door_office, 0, false, rand.nextBoolean(), 6, 1, 3); + placeDoor(world, box, ModBlocks.door_office, 0, false, rand.nextBoolean(), 5, 5, 3); + placeDoor(world, box, ModBlocks.door_office, 2, false, rand.nextBoolean(), 4, 5, 11); + placeDoor(world, box, ModBlocks.door_office, 0, false, rand.nextBoolean(), 10, 9, 3); + placeDoor(world, box, ModBlocks.door_office, 1, false, rand.nextBoolean(), 3, 9, 10); + placeDoor(world, box, ModBlocks.door_metal, 0, false, rand.nextBoolean(), 5, 13, 3); //Furniture //Floor 1 int NorthStairMeta = getStairMeta(2); diff --git a/src/main/java/com/hbm/world/worldgen/components/RuinFeatures.java b/src/main/java/com/hbm/world/gen/component/RuinFeatures.java similarity index 99% rename from src/main/java/com/hbm/world/worldgen/components/RuinFeatures.java rename to src/main/java/com/hbm/world/gen/component/RuinFeatures.java index a04e2ca2c..b5f5d141d 100644 --- a/src/main/java/com/hbm/world/worldgen/components/RuinFeatures.java +++ b/src/main/java/com/hbm/world/gen/component/RuinFeatures.java @@ -1,4 +1,4 @@ -package com.hbm.world.worldgen.components; +package com.hbm.world.gen.component; import java.util.Random; diff --git a/src/main/java/com/hbm/world/worldgen/NTMWorldGenerator.java b/src/main/java/com/hbm/world/worldgen/NTMWorldGenerator.java deleted file mode 100644 index 01c7b7acc..000000000 --- a/src/main/java/com/hbm/world/worldgen/NTMWorldGenerator.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.hbm.world.worldgen; - -import java.util.Random; - -import com.hbm.config.StructureConfig; - -import cpw.mods.fml.common.IWorldGenerator; -import net.minecraft.block.Block; -import net.minecraft.world.World; -import net.minecraft.world.chunk.IChunkProvider; -import net.minecraftforge.event.terraingen.InitMapGenEvent.EventType; -import net.minecraftforge.event.terraingen.TerrainGen; - -public class NTMWorldGenerator implements IWorldGenerator { - - private MapGenNTMFeatures NTMFeatureGenerator = new MapGenNTMFeatures(); - - { - NTMFeatureGenerator = (MapGenNTMFeatures) TerrainGen.getModdedMapGen(NTMFeatureGenerator, EventType.CUSTOM); - } - - @Override - public void generate(Random rand, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { - - switch (world.provider.dimensionId) { - case -1: - generateNether(world, rand, chunkGenerator, chunkX, chunkZ); break; - case 0: - generateSurface(world, rand, chunkGenerator, chunkX, chunkZ); break; - case 1: - generateEnd(world, rand, chunkGenerator, chunkX, chunkZ); break; - } - } - - private void generateNether(World world, Random rand, IChunkProvider chunkGenerator, int chunkX, int chunkZ) { } - - private void generateSurface(World world, Random rand, IChunkProvider chunkGenerator, int chunkX, int chunkZ) { - Block[] ablock = new Block[65536]; - - //WorldConfig.enableStructures - /** Spawns structure starts. Utilizes canSpawnStructureAtCoords() + if else checks in Start constructor */ - if(StructureConfig.enableStructures) { - this.NTMFeatureGenerator.func_151539_a(chunkGenerator, world, chunkX, chunkZ, ablock); - } - - /** Actually generates structures in a given chunk. */ - if(StructureConfig.enableStructures) { - this.NTMFeatureGenerator.generateStructuresInChunk(world, rand, chunkX, chunkZ); - } - } - - private void generateEnd(World world, Random rand, IChunkProvider chunkGenerator, int chunkX, int chunkZ) { } -} diff --git a/src/main/java/com/hbm/world/worldgen/components/ProceduralComponents.java b/src/main/java/com/hbm/world/worldgen/components/ProceduralComponents.java deleted file mode 100644 index 4bf1f4801..000000000 --- a/src/main/java/com/hbm/world/worldgen/components/ProceduralComponents.java +++ /dev/null @@ -1,240 +0,0 @@ -package com.hbm.world.worldgen.components; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.Random; - -import net.minecraft.world.gen.structure.StructureBoundingBox; - -public abstract class ProceduralComponents { - - protected List componentWeightList; - - protected static Weight[] weightArray = new Weight[] { }; - - public void prepareComponents() { - componentWeightList = new ArrayList(); - - for(int i = 0; i < weightArray.length; i++) { - weightArray[i].instancesSpawned = 0; - componentWeightList.add(weightArray[i]); - } - } - - protected int getTotalWeight() { - boolean flag = false; - int totalWeight = 0; - Weight weight; - - for(Iterator iterator = componentWeightList.iterator(); iterator.hasNext(); totalWeight += weight.weight) { //Iterates over the entire list to find the total weight - weight = (Weight) iterator.next(); - - if(weight.instanceLimit >= 0 && weight.instancesSpawned < weight.instanceLimit) //can more structure pieces be added, in general? - flag = true; - } - - return flag ? totalWeight : -1; - } - - protected ProceduralComponent getWeightedComponent(ControlComponent original, List components, Random rand, int minX, int minY, int minZ, int coordMode, int componentType) { - int totalWeight = getTotalWeight(); - - if(totalWeight < 0) - return null; - - for(int i = 0; i < 5; i++) { - int value = rand.nextInt(totalWeight); //Pick a random value, based on how many parts there are already - Iterator iterator = componentWeightList.iterator(); - - while(iterator.hasNext()) { - Weight weight = (Weight)iterator.next(); - value -= weight.weight; //Iterate over the list until the value is less than 0 - - if(value < 0) { - if(!weight.canSpawnStructure(componentType, coordMode, original.lastComponent)) //Additional checks based on game state info preventing spawn? start from beginning - break; - - ProceduralComponent component = (ProceduralComponent) weight.lambda.findValidPlacement(components, rand, minX, minY, minZ, coordMode, componentType); //Construct the chosen component - - if(component != null) { //If it has been constructed, add it - weight.instancesSpawned++; - - if(!weight.canSpawnMoreStructures()) //Structure can no longer be spawned regardless of game state? remove as an option - componentWeightList.remove(weight); - - return component; - } - - } - } - } - - return null; - } - - protected int sizeLimit = 50; - protected int distanceLimit = 64; - - protected ProceduralComponent getNextValidComponent(ControlComponent original, List components, Random rand, int minX, int minY, int minZ, int coordMode, int componentType) { - - if(components.size() > sizeLimit) //Hard limit on amount of components - return null; - - if(Math.abs(minX - original.getBoundingBox().minX) <= distanceLimit && Math.abs(minZ - original.getBoundingBox().minZ) <= distanceLimit) { //Hard limit on spread of structure - - ProceduralComponent structure = getWeightedComponent(original, components, rand, minX, minY, minZ, coordMode, componentType + 1); //Returns null if all checks fail - - if(structure != null) { - components.add(structure); //Adds component to structure start list - original.queuedComponents.add(structure); //Add it to the list of queued components waiting to be built - } - - return structure; - } - - return null; - } - - public static StructureBoundingBox getComponentToAddBoundingBox(int posX, int posY, int posZ, int offsetX, int offsetY, int offsetZ, int maxX, int maxY, int maxZ, int coordMode) { - switch(coordMode) { - case 0: //South - return new StructureBoundingBox(posX + offsetX, posY + offsetY, posZ + offsetZ, posX + maxX - 1 + offsetX, posY + maxY - 1 + offsetY, posZ + maxZ - 1 + offsetZ); - case 1: //West - return new StructureBoundingBox(posX - maxZ + 1 - offsetZ, posY + offsetY, posZ + offsetX, posX - offsetZ, posY + maxY - 1 + offsetY, posZ + maxX - 1 + offsetX); - case 2: //North - return new StructureBoundingBox(posX - maxX + 1 - offsetX, posY + offsetY, posZ - maxZ + 1 - offsetZ, posX - offsetX, posY + maxY - 1 + offsetY, posZ + offsetZ); - case 3: //East - return new StructureBoundingBox(posX + offsetZ, posY + offsetY, posZ - maxX + 1 - offsetX, posX + maxZ - 1 + offsetZ, posY + maxY - 1 + offsetY, posZ - offsetX); - default: - return new StructureBoundingBox(posX + offsetX, posY + offsetY, posZ + offsetZ, posX + maxX - 1 + offsetX, posY + maxY - 1 + offsetY, posZ + maxZ - 1 + offsetZ); - } - } - - /** StructureComponent that supports procedural generation */ - public abstract static class ProceduralComponent extends Component { - - public ProceduralComponent() { } - - public ProceduralComponent(int componentType) { - super(componentType); //Important to carry over. - } - - public void buildComponent(ProceduralComponents instance, ControlComponent original, List components, Random rand) { } - - /** Gets next component in the direction this component is facing.
    'original' refers to the initial starting component (hard distance limits), 'components' refers to the StructureStart list. */ - protected ProceduralComponent getNextComponentNormal(ProceduralComponents instance, ControlComponent original, List components, Random rand, int offset, int offsetY) { - switch(this.coordBaseMode) { - case 0: //South - return instance.getNextValidComponent(original, components, rand, this.boundingBox.minX + offset, this.boundingBox.minY + offsetY, this.boundingBox.maxZ + 1, this.coordBaseMode, this.getComponentType()); - case 1: //West - return instance.getNextValidComponent(original, components, rand, this.boundingBox.minX - 1, this.boundingBox.minY + offsetY, this.boundingBox.minZ + offset, this.coordBaseMode, this.getComponentType()); - case 2: //North - return instance.getNextValidComponent(original, components, rand, this.boundingBox.maxX - offset, this.boundingBox.minY + offsetY, this.boundingBox.minZ - 1, this.coordBaseMode, this.getComponentType()); - case 3: //East - return instance.getNextValidComponent(original, components, rand, this.boundingBox.maxX + 1, this.boundingBox.minY + offsetY, this.boundingBox.maxZ - offset, this.coordBaseMode, this.getComponentType()); - default: - return null; - } - } - - /** Gets next component in the opposite direction this component is facing. */ - protected ProceduralComponent getNextComponentAntiNormal(ProceduralComponents instance, ControlComponent original, List components, Random rand, int offset, int offsetY) { - switch(this.coordBaseMode) { - case 0: //South - return instance.getNextValidComponent(original, components, rand, this.boundingBox.maxX - offset, this.boundingBox.minY + offsetY, this.boundingBox.minZ - 1, 2, this.getComponentType()); - case 1: //West - return instance.getNextValidComponent(original, components, rand, this.boundingBox.maxX + 1, this.boundingBox.minY + offsetY, this.boundingBox.maxZ - offset, 3, this.getComponentType()); - case 2: //North - return instance.getNextValidComponent(original, components, rand, this.boundingBox.minX + offset, this.boundingBox.minY + offsetY, this.boundingBox.maxZ + 1, 0, this.getComponentType()); - case 3: //East - return instance.getNextValidComponent(original, components, rand, this.boundingBox.minX - 1, this.boundingBox.minY + offsetY, this.boundingBox.minZ + offset, 1, this.getComponentType()); - default: - return null; - } - } - - //Keep in mind for these methods: a given room would have its *actual entrance* opposite the side it is facing. - /** Gets next component, to the West (-X) relative to this component. */ - protected ProceduralComponent getNextComponentNX(ProceduralComponents instance, ControlComponent original, List components, Random rand, int offset, int offsetY) { - switch(this.coordBaseMode) { - case 0: //South - return instance.getNextValidComponent(original, components, rand, this.boundingBox.minX - 1, this.boundingBox.minY + offsetY, this.boundingBox.minZ + offset, 1, this.getComponentType()); - case 1: //West - return instance.getNextValidComponent(original, components, rand, this.boundingBox.maxX - offset, this.boundingBox.minY + offsetY, this.boundingBox.minZ - 1, 2, this.getComponentType()); - case 2: //North - return instance.getNextValidComponent(original, components, rand, this.boundingBox.maxX + 1, this.boundingBox.minY + offsetY, this.boundingBox.maxZ - offset, 3, this.getComponentType()); - case 3: //East - return instance.getNextValidComponent(original, components, rand, this.boundingBox.minX + offset, this.boundingBox.minY + offsetY, this.boundingBox.maxZ + 1, 0, this.getComponentType()); - default: - return null; - } - } - - /** Gets next component, to the East (+X) relative to this component. */ - protected ProceduralComponent getNextComponentPX(ProceduralComponents instance, ControlComponent original, List components, Random rand, int offset, int offsetY) { - switch(this.coordBaseMode) { - case 0: //South - return instance.getNextValidComponent(original, components, rand, this.boundingBox.maxX + 1, this.boundingBox.minY + offsetY, this.boundingBox.maxZ - offset, 3, this.getComponentType() + 1); - case 1: //West - return instance.getNextValidComponent(original, components, rand, this.boundingBox.minX + offset, this.boundingBox.minY + offsetY, this.boundingBox.maxZ + 1, 0, this.getComponentType() + 1); - case 2: //North - return instance.getNextValidComponent(original, components, rand, this.boundingBox.minX - 1, this.boundingBox.minY + offsetY, this.boundingBox.minZ + offset, 1, this.getComponentType() + 1); - case 3: //East - return instance.getNextValidComponent(original, components, rand, this.boundingBox.maxX - offset, this.boundingBox.minY + offsetY, this.boundingBox.minZ - 1, 2, this.getComponentType() + 1); - default: - return null; - } - } - - /** Finds valid placement, using input information. Should be passed as a method reference to its respective Weight. */ - //Static so no override (cringe!) - //public static ProceduralComponent findValidPlacement(List components, Random rand, int minX, int minY, int minZ, int coordMode, int componentType) { return null; } - } - - /** ProceduralComponent that can serve as a master "control component" for procedural generation and building of components. */ - public abstract static class ControlComponent extends ProceduralComponent { - - public List queuedComponents = new ArrayList(); //List of all queued ProceduralComponents waiting to be built. Randomly iterated over until limits like component amt or dist are reached. - public ProceduralComponent lastComponent = this; //Last component to be built. Used as input for the random selection's checks for specific components. - - public ControlComponent() { } - - public ControlComponent(int componentType) { - super(componentType); - } - } - - /** Returns a new instance of this structureComponent, or null if not able to be placed.
    Based on bounding box checks. */ - @FunctionalInterface - interface instantiateStructure { - ProceduralComponent findValidPlacement(List components, Random rand, int minX, int minY, int minZ, int coordMode, int componentType); - } - - protected static class Weight { - - public final instantiateStructure lambda; //Read above - - public final int weight; //Weight of this component - public int instancesSpawned; //How many components spawned? - public int instanceLimit; //Limit on amount of components: -1 for no limit - - public Weight(int weight, int limit, instantiateStructure lambda) { - this.weight = weight; - this.instanceLimit = limit; - this.lambda = lambda; - } - - //Checks if another structure can be spawned based on input data - public boolean canSpawnStructure(int componentAmount, int coordMode, ProceduralComponent component) { - return this.instanceLimit < 0 || this.instancesSpawned < this.instanceLimit; - } - - //Checks if another structure can be spawned at all (used to flag for removal from the list) - public boolean canSpawnMoreStructures() { - return this.instanceLimit < 0 || this.instancesSpawned < this.instanceLimit; - } - - } - -} From f4d67be51eef1b4e03748223d8ebe4e8ec133432 Mon Sep 17 00:00:00 2001 From: Vaern Date: Tue, 30 May 2023 20:04:55 -0700 Subject: [PATCH 2/8] deco --- .../world/gen/component/BunkerComponents.java | 73 +++++++++++++++---- 1 file changed, 59 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/hbm/world/gen/component/BunkerComponents.java b/src/main/java/com/hbm/world/gen/component/BunkerComponents.java index b132b862d..3efd261fd 100644 --- a/src/main/java/com/hbm/world/gen/component/BunkerComponents.java +++ b/src/main/java/com/hbm/world/gen/component/BunkerComponents.java @@ -141,7 +141,7 @@ public class BunkerComponents { placeBlockAtCurrentPosition(world, ModBlocks.fan, 0, 5, 4, 5, box); //machine placeBlockAtCurrentPosition(world, ModBlocks.deco_tungsten, 0, 3, 1, 6, box); - generateInvContents(world, box, rand, Blocks.chest, getDecoMeta(2), 4, 1, 6, HbmChestContents.antenna/*TODO change */, 5); + generateInvContents(world, box, rand, Blocks.chest, getDecoMeta(3), 4, 1, 6, HbmChestContents.antenna/*TODO change */, 5); placeBlockAtCurrentPosition(world, ModBlocks.deco_tungsten, 0, 5, 1, 6, box); fillWithMetadataBlocks(world, box, 3, 2, 6, 5, 2, 6, ModBlocks.concrete_smooth_stairs, getStairMeta(2) | 4); fillWithMetadataBlocks(world, box, 3, 3, 6, 5, 3, 6, ModBlocks.tape_recorder, getDecoMeta(2)); @@ -149,7 +149,7 @@ public class BunkerComponents { placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, getStairMeta(1) | 4, 3, 1, 4, box); placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, getStairMeta(3) | 4, 4, 1, 4, box); placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, getStairMeta(0) | 4, 5, 1, 4, box); - placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, getDecoModelMeta(0), 4, 2, 4, box); + placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, getDecoModelMeta(1), 4, 2, 4, box); //clear out entryways based on path if(paths[0]) fillWithAir(world, box, 7, 1, 2, 7, 2, 3); if(paths[1]) fillWithAir(world, box, 3, 1, 0, 4, 2, 0); @@ -162,13 +162,17 @@ public class BunkerComponents { public static class Corridor extends Component implements ProceduralComponent { private boolean path; + private int[] decorations = new int[2]; public Corridor() { } - public Corridor(int componentType, StructureBoundingBox box, int coordMode) { + public Corridor(int componentType, StructureBoundingBox box, int coordMode, Random rand) { super(componentType); this.boundingBox = box; this.coordBaseMode = coordMode; + + decorations[0] = rand.nextInt(6); + decorations[1] = rand.nextInt(6); } /** write to nbt */ @@ -176,6 +180,7 @@ public class BunkerComponents { protected void func_143012_a(NBTTagCompound nbt) { super.func_143012_a(nbt); nbt.setBoolean("p", path); + nbt.setIntArray("d", decorations); } /** read from nbt */ @@ -183,6 +188,7 @@ public class BunkerComponents { protected void func_143011_b(NBTTagCompound nbt) { super.func_143011_b(nbt); path = nbt.getBoolean("p"); + decorations = nbt.getIntArray("d"); } @Override @@ -212,18 +218,57 @@ public class BunkerComponents { //lamps fillWithBlocks(world, box, 2, 5, 3, 3, 5, 3, ModBlocks.reinforced_lamp_off); fillWithBlocks(world, box, 2, 4, 3, 3, 4, 3, ModBlocks.fan); - //table w/ chairs - final int stairMetaS = getStairMeta(3); + //deco misc + final int stairMetaW = getStairMeta(0); + final int stairMetaE = getStairMeta(1); final int stairMetaN = getStairMeta(2); + final int stairMetaS = getStairMeta(3); + final int decoMetaE = getDecoMeta(4); + final int decoMetaW = getDecoMeta(5); - placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaS, 1, 1, 2, box); - placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaN, 1, 1, 4, box); - placeBlockAtCurrentPosition(world, Blocks.fence, 0, 1, 1, 3, box); - placeBlockAtCurrentPosition(world, Blocks.wooden_pressure_plate, 1, 1, 2, 3, box); - //desk w/ computer - placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaS | 4, 4, 1, 2, box); - placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaN, 4, 1, 4, box); - placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, getDecoModelMeta(1), 4, 2, 2, box); + for(int i = 0; i <= 1; i++) { + final int x = 1 + i * 3; + switch (decorations[i]) { + default: //table w/ chairs + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaS, x, 1, 2, box); + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaN, x, 1, 4, box); + placeBlockAtCurrentPosition(world, Blocks.fence, 0, x, 1, 3, box); + placeBlockAtCurrentPosition(world, Blocks.wooden_pressure_plate, 1, x, 2, 3, box); + break; + case 1://desk w/ computer + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaS | 4, x, 1, 2, box); + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaN, x, 1, 4, box); + placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, getDecoModelMeta(1), x, 2, 2, box); + break; + case 2: //couch + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaS, x, 1, 2, box); + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, i < 1 ? stairMetaE : stairMetaW, x, 1, 3, box); + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaN, x, 1, 4, box); + break; + case 3: + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaS | 4, x, 1, 2, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, (i < 1 ? stairMetaE : stairMetaW) | 4, x, 1, 3, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaN | 4, x, 1, 4, box); + placeBlockAtCurrentPosition(world, Blocks.flower_pot, 0, x, 2, 2, box); + break; + case 4: + fillWithBlocks(world, box, x, 1, 1, x, 3, 1, ModBlocks.deco_tungsten); + placeBlockAtCurrentPosition(world, ModBlocks.deco_tungsten, 0, x, 1, 3, box); + fillWithMetadataBlocks(world, box, x, 3, 2, x, 3, 4, ModBlocks.concrete_smooth_stairs, i < 1 ? stairMetaE : stairMetaW); + fillWithBlocks(world, box, x, 1, 5, x, 3, 5, ModBlocks.deco_tungsten); + fillWithMetadataBlocks(world, box, x, 1, 2, x, 2, 2, ModBlocks.tape_recorder, i < 1 ? decoMetaW : decoMetaE); //don't ask me + fillWithMetadataBlocks(world, box, x, 1, 4, x, 2, 4, ModBlocks.tape_recorder, i < 1 ? decoMetaW : decoMetaE); + placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, i < 1 ? getDecoModelMeta(3) : getDecoModelMeta(2), x, 2, 3, box); + break; + case 5: + placeBlockAtCurrentPosition(world, Blocks.fence, 0, x, 1, 1, box); + placeBlockAtCurrentPosition(world, Blocks.wooden_pressure_plate, 0, x, 2, 1, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaS | 4, x, 1, 3, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaN | 4, x, 1, 4, box); + placeBlockAtCurrentPosition(world, ModBlocks.radiorec, i < 1 ? decoMetaE : decoMetaW, x, 2, 3, box); + break; + } + } //doors placeDoor(world, box, ModBlocks.door_bunker, 1, true, rand.nextBoolean(), 2, 1, 0); placeDoor(world, box, ModBlocks.door_bunker, 1, false, rand.nextBoolean(), 3, 1, 0); @@ -234,7 +279,7 @@ public class BunkerComponents { public static StructureComponent findValidPlacement(List components, Random rand, int x, int y, int z, int coordMode, int type) { StructureBoundingBox box = ProceduralStructureStart.getComponentToAddBoundingBox(x, y, z, -3, -1, 0, 6, 6, 7, coordMode); - return box.minY > 10 && StructureComponent.findIntersecting(components, box) == null ? new Corridor(type, box, coordMode) : null; + return box.minY > 10 && StructureComponent.findIntersecting(components, box) == null ? new Corridor(type, box, coordMode, rand) : null; } } From af695359b325c1c1d0ac957504dc30d47d3ff75f Mon Sep 17 00:00:00 2001 From: Vaern Date: Tue, 30 May 2023 20:52:47 -0700 Subject: [PATCH 3/8] small fix --- src/main/java/com/hbm/world/gen/component/BunkerComponents.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/hbm/world/gen/component/BunkerComponents.java b/src/main/java/com/hbm/world/gen/component/BunkerComponents.java index 3efd261fd..9937ac15f 100644 --- a/src/main/java/com/hbm/world/gen/component/BunkerComponents.java +++ b/src/main/java/com/hbm/world/gen/component/BunkerComponents.java @@ -113,7 +113,7 @@ public class BunkerComponents { fillWithRandomizedBlocks(world, box, 7, 0, 0, 7, 4, 7, rand, ConcreteBricks); fillWithRandomizedBlocks(world, box, 1, 0, 0, 6, 4, 0, rand, ConcreteBricks); //meh, fix the area later - final int hpos = Component.getAverageHeight(world, boundingBox, box, componentType - boundingBox.minY); + final int hpos = Component.getAverageHeight(world, boundingBox, box, boundingBox.maxY) - boundingBox.minY; //top hatch placeBlockAtCurrentPosition(world, ModBlocks.concrete_slab, 1, 0, hpos, 5, box); fillWithMetadataBlocks(world, box, 1, hpos, 4, 1, hpos, 6, ModBlocks.concrete_smooth_stairs, getStairMeta(0)); From 7ed32a6c7f99d8e4794d39c3a8d3b971e01a6a7e Mon Sep 17 00:00:00 2001 From: Vaern Date: Wed, 31 May 2023 20:08:36 -0700 Subject: [PATCH 4/8] a --- .../world/gen/component/BunkerComponents.java | 130 +++++++++++++++++- .../hbm/world/gen/component/Component.java | 18 ++- 2 files changed, 142 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/hbm/world/gen/component/BunkerComponents.java b/src/main/java/com/hbm/world/gen/component/BunkerComponents.java index 9937ac15f..2f14105b6 100644 --- a/src/main/java/com/hbm/world/gen/component/BunkerComponents.java +++ b/src/main/java/com/hbm/world/gen/component/BunkerComponents.java @@ -31,9 +31,10 @@ public class BunkerComponents { Weight[] weights = new Weight[] { new Weight(6, 3, Corridor::findValidPlacement), - new Weight(7, 4, BedroomL::findValidPlacement), + new Weight(5, 4, BedroomL::findValidPlacement), new Weight(10, 3, FunJunction::findValidPlacement), new Weight(5, 2, BathroomL::findValidPlacement), + new Weight(7, 2, Laboratory::findValidPlacement), }; StructureComponent starter = new StartingHub(rand, x, z); @@ -51,6 +52,7 @@ public class BunkerComponents { MapGenStructureIO.func_143031_a(BedroomL.class, "NTMBBedroomL"); MapGenStructureIO.func_143031_a(FunJunction.class, "NTMBFunJunction"); MapGenStructureIO.func_143031_a(BathroomL.class, "NTMBBathroomL"); + MapGenStructureIO.func_143031_a(Laboratory.class, "NTMBLaboratory"); //TODO more rooms for more variety } @@ -569,7 +571,6 @@ public class BunkerComponents { placeBlockAtCurrentPosition(world, Blocks.stone_button, 1, 7, 2, 9, box); //stalls w/ toilets for(int i = 1; i <= 5; i += 2) { - placeBlockAtCurrentPosition(world, ModBlocks.door_metal, 0, 5, 1, i, box); placeDoor(world, box, ModBlocks.door_metal, 0, false, rand.nextBoolean(), 5, 1, i); fillWithMetadataBlocks(world, box, 5, 1, i + 1, 5, 2, i + 1, ModBlocks.steel_corner, getDecoMeta(2)); fillWithMetadataBlocks(world, box, 6, 1, i + 1, 7, 2, i + 1, ModBlocks.steel_wall, getDecoMeta(2)); @@ -589,4 +590,129 @@ public class BunkerComponents { return box.minY > 10 && StructureComponent.findIntersecting(components, box) == null ? new BathroomL(type, box, coordMode) : null; } } + + public static class Laboratory extends Component implements ProceduralComponent { + + private boolean[] paths = new boolean[2]; + + public Laboratory() { } + + public Laboratory(int componentType, StructureBoundingBox box, int coordMode) { + super(componentType); + this.boundingBox = box; + this.coordBaseMode = coordMode; + } + + /** write to nbt */ + @Override + protected void func_143012_a(NBTTagCompound nbt) { + super.func_143012_a(nbt); + for(int i = 0; i < paths.length; i++) + nbt.setBoolean("p" + i, paths[i]); + } + + /** read from nbt */ + @Override + protected void func_143011_b(NBTTagCompound nbt) { + super.func_143011_b(nbt); + for(int i = 0; i < paths.length; i++) + paths[i] = nbt.getBoolean("p" + i); + } + + @Override + public void buildComponent(ProceduralStructureStart start, Random rand) { + paths[0] = this.getNextComponentWest(start, this, coordBaseMode, rand, 3, 1) != null; + paths[1] = this.getNextComponentNormal(start, this, coordBaseMode, rand, 6, 1) != null; + } + + @Override + public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { + + fillWithAir(world, box, 1, 1, 1, 7, 3, 11); + //floor + fillWithMetadataBlocks(world, box, 1, 0, 1, 7, 0, 11, ModBlocks.vinyl_tile, 1); + //ceiling + fillWithBlocks(world, box, 1, 4, 1, 7, 4, 11, ModBlocks.vinyl_tile); + //upper shield + fillWithBlocks(world, box, 0, 5, 0, 8, 5, 12, ModBlocks.reinforced_stone); + //walls + fillWithBlocks(world, box, 0, 0, 0, 0, 4, 12, ModBlocks.brick_concrete); + fillWithBlocks(world, box, 1, 0, 12, 7, 4, 12, ModBlocks.brick_concrete); + fillWithBlocks(world, box, 8, 0, 0, 8, 4, 12, ModBlocks.brick_concrete); + fillWithBlocks(world, box, 1, 0, 0, 7, 4, 0, ModBlocks.brick_concrete); + + /* DECO */ + //lamps + for(int x = 3; x <= 5; x += 2) { + for(int z = 3; z <= 9; z += 3) { + placeBlockAtCurrentPosition(world, ModBlocks.reinforced_lamp_off, 0, x, 5, z, box); + placeBlockAtCurrentPosition(world, ModBlocks.fan, 0, x, 4, z, box); + } + } + //couch w/ table + final int stairMetaW = getStairMeta(0); + final int stairMetaE = getStairMeta(1); + final int stairMetaN = getStairMeta(2); + final int stairMetaS = getStairMeta(3); + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaE, 1, 1, 1, box); + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaS, 2, 1, 1, box); + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaW, 3, 1, 1, box); + placeBlockAtCurrentPosition(world, Blocks.fence, 0, 4, 1, 1, box); + placeBlockAtCurrentPosition(world, Blocks.wooden_pressure_plate, 0, 4, 2, 1, box); + //big ole wall machine + final int decoMetaE = getDecoMeta(4); + final int decoMetaW = getDecoMeta(5); + final int decoModelMetaW = getDecoModelMeta(2); + final int decoModelMetaE = getDecoModelMeta(3); + fillWithBlocks(world, box, 1, 1, 5, 1, 3, 5, ModBlocks.deco_tungsten); + placeBlockAtCurrentPosition(world, ModBlocks.deco_steel, 0, 1, 1, 6, box); + placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, decoModelMetaE, 1, 2, 6, box); + placeBlockAtCurrentPosition(world, ModBlocks.tape_recorder, decoMetaW, 1, 3, 6, box); + fillWithMetadataBlocks(world, box, 1, 1, 7, 1, 3, 7, ModBlocks.tape_recorder, decoMetaW); + fillWithBlocks(world, box, 1, 1, 8, 1, 3, 8, ModBlocks.deco_tungsten); + fillWithMetadataBlocks(world, box, 1, 1, 9, 1, 1, 10, ModBlocks.tape_recorder, decoMetaW); + fillWithMetadataBlocks(world, box, 1, 2, 9, 1, 2, 10, ModBlocks.concrete_smooth_stairs, stairMetaE | 4); + fillWithMetadataBlocks(world, box, 1, 3, 9, 1, 3, 10, ModBlocks.tape_recorder, decoMetaW); + fillWithBlocks(world, box, 1, 1, 11, 1, 3, 11, ModBlocks.deco_tungsten); + //desks w/ computers + generateInvContents(world, box, rand, Blocks.chest, getDecoMeta(2), 3, 1, 4, HbmChestContents.antenna, 4); //wip + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaS | 4, 3, 1, 5, box); + fillWithMetadataBlocks(world, box, 4, 1, 5, 4, 1, 7, ModBlocks.concrete_smooth_stairs, stairMetaW | 4); + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaN, 3, 1, 7, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaS | 4, 3, 1, 9, box); + fillWithMetadataBlocks(world, box, 4, 1, 9, 4, 1, 11, ModBlocks.concrete_smooth_stairs, 4); + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaN, 3, 1, 11, box); + placeBlockAtCurrentPosition(world, Blocks.flower_pot, 0, 3, 2, 5, box); + placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, decoModelMetaW, 4, 2, 6, box); + placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, decoModelMetaW, 4, 2, 10, box); + //lever wall machine + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaW | 4, 7, 1, 3, box); + placeBlockAtCurrentPosition(world, ModBlocks.deco_red_copper, 0, 7, 2, 3, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaW, 7, 3, 3, box); + placeBlockAtCurrentPosition(world, Blocks.lever, 2, 6, 2, 3, box); //TODO lever meta + fillWithMetadataBlocks(world, box, 7, 1, 4, 7, 2, 4, ModBlocks.steel_poles, decoMetaE); + placeBlockAtCurrentPosition(world, ModBlocks.deco_steel, 0, 7, 3, 4, box); + placeBlockAtCurrentPosition(world, ModBlocks.deco_tungsten, 0, 7, 1, 5, box); + placeBlockAtCurrentPosition(world, ModBlocks.tape_recorder, decoMetaE, 7, 1, 6, box); + placeBlockAtCurrentPosition(world, ModBlocks.deco_tungsten, 0, 7, 1, 7, box); + fillWithMetadataBlocks(world, box, 7, 2, 5, 7, 2, 7, ModBlocks.concrete_smooth_stairs, stairMetaW | 4); + fillWithMetadataBlocks(world, box, 7, 3, 5, 7, 3, 7, ModBlocks.tape_recorder, decoMetaE); + //table w/ chest + placeBlockAtCurrentPosition(world, Blocks.fence, 0, 7, 1, 9, box); + placeBlockAtCurrentPosition(world, Blocks.wooden_pressure_plate, 0, 7, 2, 9, box); + generateInvContents(world, box, rand, Blocks.chest, getDecoMeta(4), 7, 1, 10, HbmChestContents.antenna, 4); //wip + //doors + placeDoor(world, box, ModBlocks.door_bunker, 1, true, rand.nextBoolean(), 5, 1, 0); + placeDoor(world, box, ModBlocks.door_bunker, 1, false, rand.nextBoolean(), 6, 1, 0); + if(paths[0]) fillWithAir(world, box, 0, 1, 2, 0, 2, 3); + if(paths[1]) fillWithAir(world, box, 5, 1, 12, 6, 2, 12); + + return true; + } + + public static StructureComponent findValidPlacement(List components, Random rand, int x, int y, int z, int coordMode, int type) { + StructureBoundingBox box = ProceduralStructureStart.getComponentToAddBoundingBox(x, y, z, -6, -1, 0, 9, 6, 12, coordMode); + return box.minY > 10 && StructureComponent.findIntersecting(components, box) == null ? new Laboratory(type, box, coordMode) : null; + } + } } diff --git a/src/main/java/com/hbm/world/gen/component/Component.java b/src/main/java/com/hbm/world/gen/component/Component.java index effd0c592..eb42dc9b7 100644 --- a/src/main/java/com/hbm/world/gen/component/Component.java +++ b/src/main/java/com/hbm/world/gen/component/Component.java @@ -261,13 +261,13 @@ abstract public class Component extends StructureComponent { if(!box.isVecInside(posX, posY, posZ)) return; switch(this.coordBaseMode) { - default: + default: //South break; - case 1: + case 1: //West dirMeta = (dirMeta + 1) % 4; break; - case 2: + case 2: //North dirMeta ^= 2; break; //Flip second bit - case 3: + case 3: //East dirMeta = (dirMeta - 1) % 4; break; } @@ -281,6 +281,16 @@ abstract public class Component extends StructureComponent { } } + protected void placeLever(World world, StructureBoundingBox box, int dirMeta, boolean on, int featureX, int featureY, int featureZ) { + int posX = this.getXWithOffset(featureX, featureZ); + int posY = this.getYWithOffset(featureY); + int posZ = this.getZWithOffset(featureX, featureZ); + + if(!box.isVecInside(posX, posY, posZ)) return; + + //levers suck ass + } + /**N:0 W:1 S:2 E:3 */ protected void placeBed(World world, StructureBoundingBox box, int meta, int featureX, int featureY, int featureZ) { int xOffset = 0; From 3ecc74f6db1b9aa17cf94d65f00af468059d4a16 Mon Sep 17 00:00:00 2001 From: Vaern Date: Thu, 8 Jun 2023 23:29:25 -0700 Subject: [PATCH 5/8] reactor room, meta pain --- .../world/gen/component/BunkerComponents.java | 212 +++++++++++++++++- .../hbm/world/gen/component/Component.java | 38 +++- 2 files changed, 243 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/hbm/world/gen/component/BunkerComponents.java b/src/main/java/com/hbm/world/gen/component/BunkerComponents.java index 2f14105b6..d23b1f733 100644 --- a/src/main/java/com/hbm/world/gen/component/BunkerComponents.java +++ b/src/main/java/com/hbm/world/gen/component/BunkerComponents.java @@ -35,6 +35,7 @@ public class BunkerComponents { new Weight(10, 3, FunJunction::findValidPlacement), new Weight(5, 2, BathroomL::findValidPlacement), new Weight(7, 2, Laboratory::findValidPlacement), + new Weight(5, 1, PowerRoom::findValidPlacement), }; StructureComponent starter = new StartingHub(rand, x, z); @@ -53,6 +54,7 @@ public class BunkerComponents { MapGenStructureIO.func_143031_a(FunJunction.class, "NTMBFunJunction"); MapGenStructureIO.func_143031_a(BathroomL.class, "NTMBBathroomL"); MapGenStructureIO.func_143031_a(Laboratory.class, "NTMBLaboratory"); + MapGenStructureIO.func_143031_a(PowerRoom.class, "NTMBPowerRoom"); //TODO more rooms for more variety } @@ -483,7 +485,7 @@ public class BunkerComponents { placeBlockAtCurrentPosition(world, ModBlocks.deco_tungsten, 0, 6, 1, 9, box); placeBlockAtCurrentPosition(world, ModBlocks.tape_recorder, getDecoMeta(4), 6, 2, 9, box); fillWithBlocks(world, box, 6, 3, 8, 6, 3, 9, ModBlocks.concrete_slab); - placeBlockAtCurrentPosition(world, Blocks.lever, getDecoMeta(2), 5, 1, 9, box); //double-check meta + placeLever(world, box, 2, rand.nextBoolean(), 5, 1, 9); //doors placeDoor(world, box, ModBlocks.door_bunker, 1, true, rand.nextBoolean(), 4, 1, 0); placeDoor(world, box, ModBlocks.door_bunker, 1, false, rand.nextBoolean(), 5, 1, 0); @@ -565,10 +567,10 @@ public class BunkerComponents { //hand-dryers (industrial-strength) placeBlockAtCurrentPosition(world, ModBlocks.steel_beam, 3, 4, 1, 9, box); placeBlockAtCurrentPosition(world, ModBlocks.fan, getDecoMeta(2), 4, 2, 9, box); - placeBlockAtCurrentPosition(world, Blocks.stone_button, 2, 3, 2, 9, box); //TODO button meta + placeBlockAtCurrentPosition(world, Blocks.stone_button, getButtonMeta(2), 3, 2, 9, box); //TODO button meta placeBlockAtCurrentPosition(world, ModBlocks.steel_beam, 3, 6, 1, 9, box); placeBlockAtCurrentPosition(world, ModBlocks.fan, getDecoMeta(2), 6, 2, 9, box); - placeBlockAtCurrentPosition(world, Blocks.stone_button, 1, 7, 2, 9, box); + placeBlockAtCurrentPosition(world, Blocks.stone_button, getButtonMeta(1), 7, 2, 9, box); //stalls w/ toilets for(int i = 1; i <= 5; i += 2) { placeDoor(world, box, ModBlocks.door_metal, 0, false, rand.nextBoolean(), 5, 1, i); @@ -689,7 +691,7 @@ public class BunkerComponents { placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaW | 4, 7, 1, 3, box); placeBlockAtCurrentPosition(world, ModBlocks.deco_red_copper, 0, 7, 2, 3, box); placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaW, 7, 3, 3, box); - placeBlockAtCurrentPosition(world, Blocks.lever, 2, 6, 2, 3, box); //TODO lever meta + placeLever(world, box, 2, rand.nextBoolean(), 6, 2, 3); fillWithMetadataBlocks(world, box, 7, 1, 4, 7, 2, 4, ModBlocks.steel_poles, decoMetaE); placeBlockAtCurrentPosition(world, ModBlocks.deco_steel, 0, 7, 3, 4, box); placeBlockAtCurrentPosition(world, ModBlocks.deco_tungsten, 0, 7, 1, 5, box); @@ -715,4 +717,206 @@ public class BunkerComponents { return box.minY > 10 && StructureComponent.findIntersecting(components, box) == null ? new Laboratory(type, box, coordMode) : null; } } + + public static class PowerRoom extends Component implements ProceduralComponent { + + private boolean path; + + private int powerType; + + public PowerRoom() { } + + public PowerRoom(int componentType, StructureBoundingBox box, int coordMode, Random rand) { + super(componentType); + this.boundingBox = box; + this.coordBaseMode = coordMode; + + float chance = rand.nextFloat(); + powerType = chance < 0.2 ? 2 : chance < 0.6 ? 1 : 0; + } + + /** write to nbt */ + @Override + protected void func_143012_a(NBTTagCompound nbt) { + super.func_143012_a(nbt); + nbt.setBoolean("p", path); + } + + /** read from nbt */ + @Override + protected void func_143011_b(NBTTagCompound nbt) { + super.func_143011_b(nbt); + path = nbt.getBoolean("p"); + } + + @Override + public void buildComponent(ProceduralStructureStart start, Random rand) { + path = this.getNextComponentEast(start, this, coordBaseMode, rand, 4, 1) != null; + } + + @Override + public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { + + fillWithAir(world, box, 1, 1, 1, 10, 3, 10); + //floor + fillWithMetadataBlocks(world, box, 1, 0, 1, 10, 0, 10, ModBlocks.vinyl_tile, 1); + //ceiling + fillWithBlocks(world, box, 1, 4, 1, 10, 4, 10, ModBlocks.vinyl_tile); + //upper shield + fillWithBlocks(world, box, 0, 5, 0, 11, 5, 11, ModBlocks.reinforced_stone); + //walls + fillWithRandomizedBlocks(world, box, 0, 0, 0, 11, 4, 0, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 0, 0, 1, 0, 4, 10, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 0, 0, 11, 11, 4, 11, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 11, 0, 1, 11, 4, 10, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 5, 1, 1, 5, 3, 6, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 6, 1, 6, 10, 3, 6, rand, ConcreteBricks); + + /* DECO */ + //lamps + placeBlockAtCurrentPosition(world, ModBlocks.reinforced_lamp_off, 0, 3, 5, 2, box); + placeBlockAtCurrentPosition(world, ModBlocks.reinforced_lamp_off, 0, 3, 5, 5, box); + placeBlockAtCurrentPosition(world, ModBlocks.reinforced_lamp_off, 0, 3, 5, 8, box); + placeBlockAtCurrentPosition(world, ModBlocks.reinforced_lamp_off, 0, 6, 5, 8, box); + placeBlockAtCurrentPosition(world, ModBlocks.reinforced_lamp_off, 0, 9, 5, 8, box); + placeBlockAtCurrentPosition(world, ModBlocks.fan, 0, 3, 4, 2, box); + placeBlockAtCurrentPosition(world, ModBlocks.fan, 0, 3, 4, 5, box); + placeBlockAtCurrentPosition(world, ModBlocks.fan, 0, 3, 4, 8, box); + placeBlockAtCurrentPosition(world, ModBlocks.fan, 0, 6, 4, 8, box); + placeBlockAtCurrentPosition(world, ModBlocks.fan, 0, 9, 4, 8, box); + //power room stuff + fillWithBlocks(world, box, 7, 2, 6, 9, 2, 6, ModBlocks.reinforced_glass); + int decoMetaE = getDecoMeta(5); + int decoMetaW = getDecoMeta(4); + int decoMetaN = getDecoMeta(3); + int decoMetaS = getDecoMeta(2); + + int stairMetaS = getStairMeta(3); + int stairMetaN = getStairMeta(2); + int stairMetaW = getStairMeta(1); + int stairMetaE = getStairMeta(0); + + switch(this.powerType) { + default: + fillWithBlocks(world, box, 6, 1, 1, 6, 3, 1, ModBlocks.deco_pipe_framed_rusted); + for(int i = 7; i <= 9; i += 2) { + placeBlockAtCurrentPosition(world, ModBlocks.machine_coal_off, decoMetaN, i, 1, 1, box); + placeBlockAtCurrentPosition(world, ModBlocks.steel_beam, 2, i, 2, 1, box); + placeBlockAtCurrentPosition(world, ModBlocks.machine_coal_off, decoMetaN, i, 3, 1, box); + } + placeBlockAtCurrentPosition(world, ModBlocks.deco_red_copper, 0, 8, 1, 1, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 5, 8, 2, 1, box); + placeBlockAtCurrentPosition(world, ModBlocks.deco_red_copper, 0, 8, 3, 1, box); + placeLever(world, box, 3, rand.nextBoolean(), 8, 2, 2); + for(int i = 1; i <= 3; i += 2) { + placeBlockAtCurrentPosition(world, ModBlocks.deco_steel, 0, 10, i, 1, box); + fillWithMetadataBlocks(world, box, 10, i, 2, 10, i, 4, ModBlocks.deco_pipe_quad_rusted, getPillarMeta(8)); + placeBlockAtCurrentPosition(world, ModBlocks.deco_steel, 0, 10, i, 5, box); + } + placeBlockAtCurrentPosition(world, ModBlocks.deco_pipe_framed_rusted, 0, 10, 2, 1, box); + placeBlockAtCurrentPosition(world, ModBlocks.fluid_duct_gauge, decoMetaW, 10, 2, 5, box); + placeBlockAtCurrentPosition(world, ModBlocks.barrel_plastic, 0, 6, 1, 5, box); + //chests + generateInvContents(world, box, rand, Blocks.chest, decoMetaS, 7, 1, 5, HbmChestContents.antenna, 4); //WIP + generateInvContents(world, box, rand, Blocks.chest, decoMetaS, 9, 1, 5, HbmChestContents.antenna, 4); + break; + case 1: + placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 5, 6, 1, 1, box); + placeBlockAtCurrentPosition(world, ModBlocks.cable_detector, 0, 6, 2, 1, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 5, 6, 3, 1, box); + placeLever(world, box, 3, false, 6, 2, 2); + for(int i = 7; i <= 9; i += 2) { + placeBlockAtCurrentPosition(world, ModBlocks.steel_scaffold, 8, i, 1, 1, box); //i'm not making another fucking meta method + placeBlockAtCurrentPosition(world, ModBlocks.machine_diesel, decoMetaE, i, 2, 1, box); + } + placeBlockAtCurrentPosition(world, ModBlocks.deco_pipe_rim_rusted, getPillarMeta(4), 8, 2, 1, box); + placeBlockAtCurrentPosition(world, ModBlocks.deco_pipe_rim_rusted, getPillarMeta(4), 8, 2, 1, box); + fillWithMetadataBlocks(world, box, 7, 3, 1, 9, 3, 1, ModBlocks.concrete_smooth_stairs, stairMetaS); + fillWithBlocks(world, box, 10, 1, 1, 10, 1, 3, ModBlocks.deco_steel); + placeBlockAtCurrentPosition(world, ModBlocks.deco_red_copper, 0, 10, 2, 1, box); + placeBlockAtCurrentPosition(world, ModBlocks.deco_steel, 0, 10, 3, 1, box); + placeBlockAtCurrentPosition(world, ModBlocks.steel_grate, 7, 10, 2, 2, box); + placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, getDecoModelMeta(2), 10, 3, 2, box); + fillWithMetadataBlocks(world, box, 10, 2, 3, 10, 3, 3, ModBlocks.tape_recorder, decoMetaW); + fillWithMetadataBlocks(world, box, 9, 1, 2, 9, 1, 3, ModBlocks.steel_grate, 7); + fillWithBlocks(world, box, 9, 1, 5, 10, 1, 5, ModBlocks.barrel_iron); + placeBlockAtCurrentPosition(world, ModBlocks.barrel_iron, 0, 10, 2, 5, box); + fillWithBlocks(world, box, 6, 1, 5, 6, 2, 5, ModBlocks.barrel_iron); + placeBlockAtCurrentPosition(world, ModBlocks.barrel_iron, 0, 6, 1, 2, box); + break; + case 2: + for(int i = 7; i <= 9; i += 2) { + fillWithBlocks(world, box, i, 1, 2, i, 1, 4, ModBlocks.deco_lead); + fillWithBlocks(world, box, i, 2, 2, i, 2, 4, ModBlocks.block_lead); + fillWithBlocks(world, box, i, 3, 2, i, 3, 4, ModBlocks.deco_lead); + } + placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 5, 8, 1, 4, box); + placeBlockAtCurrentPosition(world, ModBlocks.reactor_computer, 0, 8, 2, 4, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 5, 8, 3, 4, box); + placeLever(world, box, 3, rand.nextBoolean(), 8, 2, 5); + placeBlockAtCurrentPosition(world, ModBlocks.reactor_element, 0, 8, 1, 3, box); + placeBlockAtCurrentPosition(world, ModBlocks.reactor_control, 0, 8, 2, 3, box); + placeBlockAtCurrentPosition(world, ModBlocks.reactor_element, 0, 8, 3, 3, box); + placeBlockAtCurrentPosition(world, ModBlocks.block_copper, 0, 8, 1, 2, box); + placeBlockAtCurrentPosition(world, ModBlocks.block_lead, 0, 8, 2, 2, box); + placeBlockAtCurrentPosition(world, ModBlocks.block_copper, 0, 8, 3, 2, box); + placeBlockAtCurrentPosition(world, ModBlocks.reactor_conductor, 0, 8, 1, 1, box); + placeBlockAtCurrentPosition(world, ModBlocks.machine_turbine, 0, 8, 2, 1, box); + placeBlockAtCurrentPosition(world, ModBlocks.reactor_conductor, 0, 8, 3, 1, box); + fillWithBlocks(world, box, 9, 1, 1, 9, 3, 1, ModBlocks.deco_steel); + placeBlockAtCurrentPosition(world, ModBlocks.steel_grate, 7, 10, 1, 1, box); + placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, getDecoModelMeta(1), 10, 2, 1, box); + placeBlockAtCurrentPosition(world, ModBlocks.tape_recorder, decoMetaN, 10, 3, 1, box); + fillWithMetadataBlocks(world, box, 6, 1, 1, 7, 1, 1, ModBlocks.deco_pipe_quad_rusted, getPillarMeta(4)); + placeBlockAtCurrentPosition(world, ModBlocks.deco_pipe_quad_rusted, getPillarMeta(4), 7, 3, 1, box); + placeBlockAtCurrentPosition(world, ModBlocks.fluid_duct_gauge, decoMetaN, 6, 3, 1, box); + //chest + generateInvContents(world, box, rand, Blocks.chest, decoMetaN, 6, 1, 2, HbmChestContents.antenna, 4); //WIP + break; + } + //transformer + fillWithMetadataBlocks(world, box, 1, 1, 1, 1, 1, 5, ModBlocks.concrete_smooth_stairs, stairMetaW | 4); + fillWithBlocks(world, box, 1, 1, 6, 1, 3, 6, ModBlocks.concrete_pillar); + fillWithMetadataBlocks(world, box, 1, 3, 1, 1, 3, 5, ModBlocks.concrete_smooth_stairs, stairMetaW); + placeBlockAtCurrentPosition(world, ModBlocks.machine_transformer_20, 0, 1, 2, 1, box); + placeBlockAtCurrentPosition(world, ModBlocks.cable_diode, decoMetaN, 1, 2, 2, box); + placeBlockAtCurrentPosition(world, ModBlocks.machine_battery, decoMetaE, 1, 2, 3, box); + placeBlockAtCurrentPosition(world, ModBlocks.deco_red_copper, 0, 1, 2, 4, box); + placeBlockAtCurrentPosition(world, ModBlocks.cable_switch, 0, 1, 2, 5, box); + //machine + for(int i = 1; i <= 5; i += 4) { + placeBlockAtCurrentPosition(world, ModBlocks.deco_beryllium, 0, i, 1, 10, box); + placeBlockAtCurrentPosition(world, ModBlocks.steel_scaffold, 0, i, 2, 10, box); + placeBlockAtCurrentPosition(world, ModBlocks.deco_beryllium, 0, i, 3, 10, box); + } + placeBlockAtCurrentPosition(world, ModBlocks.steel_scaffold, 0, 2, 1, 10, box); + placeBlockAtCurrentPosition(world, ModBlocks.deco_tungsten, 0, 3, 1, 10, box); + placeBlockAtCurrentPosition(world, ModBlocks.steel_scaffold, 0, 4, 1, 10, box); + placeBlockAtCurrentPosition(world, ModBlocks.tape_recorder, decoMetaS, 2, 2, 10, box); + placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, getDecoModelMeta(0), 3, 2, 10, box); + placeBlockAtCurrentPosition(world, ModBlocks.tape_recorder, decoMetaS, 4, 2, 10, box); + fillWithMetadataBlocks(world, box, 2, 3, 10, 4, 3, 10, ModBlocks.tape_recorder, decoMetaS); + //desk + fillWithMetadataBlocks(world, box, 8, 1, 10, 10, 1, 10, ModBlocks.concrete_smooth_stairs, stairMetaN | 4); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaE | 4, 10, 1, 9, box); + placeBlockAtCurrentPosition(world, Blocks.oak_stairs,stairMetaS, 9, 1, 9, box); + placeBlockAtCurrentPosition(world, Blocks.flower_pot, 0, 8, 2, 10, box); + placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, getDecoModelMeta(0), 9, 2, 10, box); + //loot + generateInvContents(world, box, rand, Blocks.chest, decoMetaE, 1, 1, 7, HbmChestContents.antenna, 4); //WIP + generateInvContents(world, box, rand, ModBlocks.filing_cabinet, getDecoModelMeta(0), 7, 1, 10, HbmChestContents.antenna, 4); + //doors + placeDoor(world, box, ModBlocks.door_bunker, 1, true, rand.nextBoolean(), 3, 1, 0); + placeDoor(world, box, ModBlocks.door_bunker, 1, false, rand.nextBoolean(), 4, 1, 0); + placeDoor(world, box, ModBlocks.door_bunker, 0, false, false, 5, 1, 3); + if(path) fillWithAir(world, box, 11, 1, 7, 11, 2, 8); + + return true; + } + + public static StructureComponent findValidPlacement(List components, Random rand, int x, int y, int z, int coordMode, int type) { + StructureBoundingBox box = ProceduralStructureStart.getComponentToAddBoundingBox(x, y, z, -4, -1, 0, 12, 6, 12, coordMode); + return box.minY > 10 && StructureComponent.findIntersecting(components, box) == null ? new PowerRoom(type, box, coordMode, rand) : null; + } + } } diff --git a/src/main/java/com/hbm/world/gen/component/Component.java b/src/main/java/com/hbm/world/gen/component/Component.java index eb42dc9b7..73a1ce5f8 100644 --- a/src/main/java/com/hbm/world/gen/component/Component.java +++ b/src/main/java/com/hbm/world/gen/component/Component.java @@ -268,7 +268,7 @@ abstract public class Component extends StructureComponent { case 2: //North dirMeta ^= 2; break; //Flip second bit case 3: //East - dirMeta = (dirMeta - 1) % 4; break; + dirMeta = Math.abs(dirMeta - 1) % 4; break; //fuck you modulo } //hee hoo @@ -280,7 +280,7 @@ abstract public class Component extends StructureComponent { world.setBlock(posX, posY + 1, posZ, door, metaTop, 2); } } - + /** 1 for west face, 2 for east face, 3 for north, 4 for south*/ protected void placeLever(World world, StructureBoundingBox box, int dirMeta, boolean on, int featureX, int featureY, int featureZ) { int posX = this.getXWithOffset(featureX, featureZ); int posY = this.getYWithOffset(featureY); @@ -288,7 +288,39 @@ abstract public class Component extends StructureComponent { if(!box.isVecInside(posX, posY, posZ)) return; - //levers suck ass + if(dirMeta <= 0 || dirMeta >= 7) { //levers suck ass + switch(this.coordBaseMode) { + case 1: case 3: //west / east + dirMeta ^= 0b111; + } + } else if(dirMeta >= 5) { + switch(this.coordBaseMode) { + case 1: case 3: //west / east + dirMeta = (dirMeta + 1) % 2 + 5; + } + } else { + dirMeta = getButtonMeta(dirMeta); + } + + world.setBlock(posX, posY, posZ, Blocks.lever, on ? dirMeta | 8 : dirMeta, 2); + } + + /** pain. works for side-facing levers as well */ + protected int getButtonMeta(int dirMeta) { + switch(this.coordBaseMode) { //are you ready for the pain? + case 1: //West + if(dirMeta <= 2) return dirMeta + 2; + else if(dirMeta < 4) return dirMeta - 1; + else return dirMeta - 3;// this shit sucks ass + case 2: //North + return dirMeta + (dirMeta % 2 == 0 ? -1 : 1); + case 3: //East + if(dirMeta <= 1) return dirMeta + 3; + else if(dirMeta <= 2) return dirMeta + 1; + else return dirMeta - 2; + default: //South + return dirMeta; + } } /**N:0 W:1 S:2 E:3 */ From 0239ea79682ccdbad9931af6d8cb17c4f894e1a8 Mon Sep 17 00:00:00 2001 From: Vaern Date: Fri, 9 Jun 2023 13:36:57 -0700 Subject: [PATCH 6/8] finished enough --- .../java/com/hbm/lib/HbmChestContents.java | 52 +++++++++++++++++++ src/main/java/com/hbm/lib/HbmWorld.java | 2 + .../com/hbm/world/gen/MapGenNTMFeatures.java | 4 ++ .../world/gen/component/BunkerComponents.java | 30 ++++++----- 4 files changed, 74 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/hbm/lib/HbmChestContents.java b/src/main/java/com/hbm/lib/HbmChestContents.java index 343a46e75..3cdf8a771 100644 --- a/src/main/java/com/hbm/lib/HbmChestContents.java +++ b/src/main/java/com/hbm/lib/HbmChestContents.java @@ -8,6 +8,7 @@ import com.hbm.items.ModItems; import com.hbm.items.machine.ItemBreedingRod.*; import com.hbm.items.machine.ItemZirnoxRod.EnumZirnoxType; import com.hbm.items.special.ItemBookLore.BookLoreType; +import com.hbm.items.tool.ItemBlowtorch; import net.minecraft.init.Items; import net.minecraft.item.Item; @@ -355,6 +356,57 @@ public class HbmChestContents { new WeightedRandomChestContent(ModItems.ink, 0, 1, 1, 1), //make that mf rare; 1:555 weight }; + public static WeightedRandomChestContent[] solidFuel = new WeightedRandomChestContent[] { + new WeightedRandomChestContent(ModItems.solid_fuel, 0, 1, 5, 1), + new WeightedRandomChestContent(ModItems.solid_fuel_presto, 0, 1, 2, 2), + new WeightedRandomChestContent(ModItems.ball_dynamite, 0, 1, 4, 2), + new WeightedRandomChestContent(Items.redstone, 0, 1, 3, 1), + new WeightedRandomChestContent(ModItems.niter, 0, 1, 3, 1) + }; + + public static WeightedRandomChestContent[] labVault = new WeightedRandomChestContent[] { + new WeightedRandomChestContent(ItemBlowtorch.getEmptyTool(ModItems.blowtorch), 1, 1, 4), + new WeightedRandomChestContent(ModItems.chemistry_set, 0, 1, 1, 15), + new WeightedRandomChestContent(ModItems.screwdriver, 0, 1, 1, 10), + new WeightedRandomChestContent(ModItems.nugget_mercury, 0, 1, 1, 3), + new WeightedRandomChestContent(ModItems.morning_glory, 0, 1, 1, 1), + new WeightedRandomChestContent(ModItems.filter_coal, 0, 1, 1, 5), + new WeightedRandomChestContent(ModItems.dust, 0, 1, 3, 25), + new WeightedRandomChestContent(Items.paper, 0, 1, 2, 15), + new WeightedRandomChestContent(ModItems.cell_empty, 0, 1, 1, 5), + new WeightedRandomChestContent(Items.glass_bottle, 0, 1, 1, 5), + new WeightedRandomChestContent(ModItems.powder_iodine, 0, 1, 1, 1), + new WeightedRandomChestContent(ModItems.powder_bromine, 0, 1, 1, 1), + new WeightedRandomChestContent(ModItems.powder_cobalt, 0, 1, 1, 1), + new WeightedRandomChestContent(ModItems.powder_neodymium, 0, 1, 1, 1), + new WeightedRandomChestContent(ModItems.powder_boron, 0, 1, 1, 1), + }; + + public static WeightedRandomChestContent[] lockersVault = new WeightedRandomChestContent[] { + new WeightedRandomChestContent(ModItems.robes_helmet, 0, 1, 1, 1), + new WeightedRandomChestContent(ModItems.robes_plate, 0, 1, 1, 1), + new WeightedRandomChestContent(ModItems.robes_legs, 0, 1, 1, 1), + new WeightedRandomChestContent(ModItems.robes_boots, 0, 1, 1, 1), + new WeightedRandomChestContent(ModItems.jackt, 0, 1, 1, 1), + new WeightedRandomChestContent(ModItems.jackt2, 0, 1, 1, 1), + new WeightedRandomChestContent(ModItems.gas_mask_m65, 0, 1, 1, 2), + new WeightedRandomChestContent(ModItems.gas_mask_mono, 0, 1, 1, 2), + new WeightedRandomChestContent(ModItems.goggles, 0, 1, 1, 2), + new WeightedRandomChestContent(ModItems.gas_mask_filter, 0, 1, 1, 4), + new WeightedRandomChestContent(ModItems.flame_opinion, 0, 1, 3, 5), + new WeightedRandomChestContent(ModItems.flame_conspiracy, 0, 1, 3, 5), + new WeightedRandomChestContent(ModItems.flame_politics, 0, 1, 3, 5), + new WeightedRandomChestContent(ModItems.cigarette, 0, 1, 8, 5), + new WeightedRandomChestContent(ModItems.canteen_13, 0, 1, 1, 2), + new WeightedRandomChestContent(ModItems.armor_polish, 0, 1, 1, 3), + new WeightedRandomChestContent(ModItems.gun_kit_1, 0, 1, 1, 3), + new WeightedRandomChestContent(ModItems.rag, 0, 1, 3, 5), + new WeightedRandomChestContent(Items.paper, 0, 1, 6, 7), + new WeightedRandomChestContent(Items.clock, 0, 1, 1, 3), + new WeightedRandomChestContent(Items.book, 0, 1, 5, 10), + new WeightedRandomChestContent(Items.experience_bottle, 0, 1, 3, 1), + }; + /** ITEMBOOKLORE ARRAYS */ //might make a wrapper class for this, if game-state knowledge using the nbt system becomes that relevant public final static BookLoreType[] books_office_sch = new BookLoreType[] { diff --git a/src/main/java/com/hbm/lib/HbmWorld.java b/src/main/java/com/hbm/lib/HbmWorld.java index c12dd3f6c..4a24a192f 100644 --- a/src/main/java/com/hbm/lib/HbmWorld.java +++ b/src/main/java/com/hbm/lib/HbmWorld.java @@ -6,6 +6,7 @@ import com.hbm.world.gen.component.BunkerComponents; import com.hbm.world.gen.component.CivilianFeatures; import com.hbm.world.gen.component.OfficeFeatures; import com.hbm.world.gen.component.RuinFeatures; +import com.hbm.world.gen.component.BunkerComponents.BunkerStart; import cpw.mods.fml.common.IWorldGenerator; import cpw.mods.fml.common.registry.GameRegistry; @@ -23,6 +24,7 @@ public class HbmWorld { //MapGenStructureIO.registerStructure(StructureStartTest.class, "HFR_STRUCTURE"); //MapGenStructureIO.func_143031_a(StructureComponentTest.class, "HFR_COMPONENT"); MapGenStructureIO.registerStructure(MapGenNTMFeatures.Start.class, "NTMFeatures"); + MapGenStructureIO.registerStructure(BunkerStart.class, "NTMBunker"); registerNTMFeatures(); registerWorldGen(new HbmWorldGen(), 1); diff --git a/src/main/java/com/hbm/world/gen/MapGenNTMFeatures.java b/src/main/java/com/hbm/world/gen/MapGenNTMFeatures.java index 9c1a55339..c5383cca0 100644 --- a/src/main/java/com/hbm/world/gen/MapGenNTMFeatures.java +++ b/src/main/java/com/hbm/world/gen/MapGenNTMFeatures.java @@ -7,6 +7,7 @@ import java.util.Random; import com.hbm.config.GeneralConfig; import com.hbm.config.StructureConfig; +import com.hbm.world.gen.component.BunkerComponents.BunkerStart; import com.hbm.world.gen.component.CivilianFeatures.*; import com.hbm.world.gen.component.OfficeFeatures.*; import com.hbm.world.gen.component.RuinFeatures.*; @@ -89,6 +90,9 @@ public class MapGenNTMFeatures extends MapGenStructure { /** Returns new StructureStart if structure can be spawned at coords */ @Override protected StructureStart getStructureStart(int chunkX, int chunkZ) { + if(this.rand.nextInt(15) == 0) { //eh might as well, they'll already be prettty rare anyway + return new BunkerStart(this.worldObj, this.rand, chunkX, chunkZ); + } return new MapGenNTMFeatures.Start(this.worldObj, this.rand, chunkX, chunkZ); } diff --git a/src/main/java/com/hbm/world/gen/component/BunkerComponents.java b/src/main/java/com/hbm/world/gen/component/BunkerComponents.java index d23b1f733..acb8481c3 100644 --- a/src/main/java/com/hbm/world/gen/component/BunkerComponents.java +++ b/src/main/java/com/hbm/world/gen/component/BunkerComponents.java @@ -20,6 +20,8 @@ public class BunkerComponents { public static class BunkerStart extends ProceduralStructureStart { + public BunkerStart() {} + public BunkerStart(World world, Random rand, int chunkX, int chunkZ) { super(chunkX, chunkZ); @@ -373,13 +375,13 @@ public class BunkerComponents { placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaE | 4, 4, 1, 9, box); placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaS, 5, 1, 8, box); placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, getDecoModelMeta(0), 5, 2, 9, box); - generateInvContents(world, box, rand, ModBlocks.filing_cabinet, getDecoModelMeta(0), 3, 1, 9, HbmChestContents.antenna/*TODO change */, 5); + generateInvContents(world, box, rand, ModBlocks.filing_cabinet, getDecoModelMeta(0), 3, 1, 9, HbmChestContents.filingCabinet, 5); //lockers - generateInvContents(world, box, rand, Blocks.chest, getDecoMeta(4), 8, 1, 7, HbmChestContents.antenna/*TODO change */, 3); - generateInvContents(world, box, rand, Blocks.chest, getDecoMeta(4), 8, 2, 7, HbmChestContents.antenna/*TODO change */, 3); + generateInvContents(world, box, rand, Blocks.chest, getDecoMeta(4), 8, 1, 7, HbmChestContents.lockersVault, 3); + generateInvContents(world, box, rand, Blocks.chest, getDecoMeta(4), 8, 2, 7, HbmChestContents.lockersVault, 5); fillWithBlocks(world, box, 8, 1, 8, 8, 2, 8, ModBlocks.deco_tungsten); - generateInvContents(world, box, rand, Blocks.chest, getDecoMeta(4), 8, 1, 9, HbmChestContents.antenna/*TODO change */, 3); - generateInvContents(world, box, rand, Blocks.chest, getDecoMeta(4), 8, 2, 9, HbmChestContents.antenna/*TODO change */, 3); + generateInvContents(world, box, rand, Blocks.chest, getDecoMeta(4), 8, 1, 9, HbmChestContents.lockersVault, 4); + generateInvContents(world, box, rand, Blocks.chest, getDecoMeta(4), 8, 2, 9, HbmChestContents.lockersVault, 5); fillWithMetadataBlocks(world, box, 8, 3, 7, 8, 3, 9, Blocks.trapdoor, getDecoModelMeta(2) >> 2); //doors placeDoor(world, box, ModBlocks.door_bunker, 1, true, rand.nextBoolean(), 7, 1, 0); @@ -472,7 +474,7 @@ public class BunkerComponents { //table & chest placeBlockAtCurrentPosition(world, Blocks.fence, 0, 6, 1, 2, box); placeBlockAtCurrentPosition(world, Blocks.wooden_pressure_plate, 0, 6, 2, 2, box); - generateInvContents(world, box, rand, Blocks.chest, getDecoMeta(4), 6, 1, 3, HbmChestContents.antenna/*TODO change */, 7); + generateInvContents(world, box, rand, Blocks.chest, getDecoMeta(4), 6, 1, 3, HbmChestContents.lockersVault, 8); //desk w/ computer + bobblehead placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaS | 4, 1, 1, 8, box); placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaE | 4, 1, 1, 9, box); @@ -677,12 +679,12 @@ public class BunkerComponents { fillWithMetadataBlocks(world, box, 1, 3, 9, 1, 3, 10, ModBlocks.tape_recorder, decoMetaW); fillWithBlocks(world, box, 1, 1, 11, 1, 3, 11, ModBlocks.deco_tungsten); //desks w/ computers - generateInvContents(world, box, rand, Blocks.chest, getDecoMeta(2), 3, 1, 4, HbmChestContents.antenna, 4); //wip + generateInvContents(world, box, rand, Blocks.chest, getDecoMeta(2), 3, 1, 4, HbmChestContents.machineParts, 6); placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaS | 4, 3, 1, 5, box); fillWithMetadataBlocks(world, box, 4, 1, 5, 4, 1, 7, ModBlocks.concrete_smooth_stairs, stairMetaW | 4); placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaN, 3, 1, 7, box); placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaS | 4, 3, 1, 9, box); - fillWithMetadataBlocks(world, box, 4, 1, 9, 4, 1, 11, ModBlocks.concrete_smooth_stairs, 4); + fillWithMetadataBlocks(world, box, 4, 1, 9, 4, 1, 11, ModBlocks.concrete_smooth_stairs, stairMetaW | 4); placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaN, 3, 1, 11, box); placeBlockAtCurrentPosition(world, Blocks.flower_pot, 0, 3, 2, 5, box); placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, decoModelMetaW, 4, 2, 6, box); @@ -702,7 +704,7 @@ public class BunkerComponents { //table w/ chest placeBlockAtCurrentPosition(world, Blocks.fence, 0, 7, 1, 9, box); placeBlockAtCurrentPosition(world, Blocks.wooden_pressure_plate, 0, 7, 2, 9, box); - generateInvContents(world, box, rand, Blocks.chest, getDecoMeta(4), 7, 1, 10, HbmChestContents.antenna, 4); //wip + generateInvContents(world, box, rand, Blocks.chest, getDecoMeta(4), 7, 1, 10, HbmChestContents.labVault, 8); //doors placeDoor(world, box, ModBlocks.door_bunker, 1, true, rand.nextBoolean(), 5, 1, 0); placeDoor(world, box, ModBlocks.door_bunker, 1, false, rand.nextBoolean(), 6, 1, 0); @@ -817,8 +819,8 @@ public class BunkerComponents { placeBlockAtCurrentPosition(world, ModBlocks.fluid_duct_gauge, decoMetaW, 10, 2, 5, box); placeBlockAtCurrentPosition(world, ModBlocks.barrel_plastic, 0, 6, 1, 5, box); //chests - generateInvContents(world, box, rand, Blocks.chest, decoMetaS, 7, 1, 5, HbmChestContents.antenna, 4); //WIP - generateInvContents(world, box, rand, Blocks.chest, decoMetaS, 9, 1, 5, HbmChestContents.antenna, 4); + generateInvContents(world, box, rand, Blocks.chest, decoMetaS, 7, 1, 5, HbmChestContents.solidFuel, 5); + generateInvContents(world, box, rand, Blocks.chest, decoMetaS, 9, 1, 5, HbmChestContents.solidFuel, 6); break; case 1: placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 5, 6, 1, 1, box); @@ -871,7 +873,7 @@ public class BunkerComponents { placeBlockAtCurrentPosition(world, ModBlocks.deco_pipe_quad_rusted, getPillarMeta(4), 7, 3, 1, box); placeBlockAtCurrentPosition(world, ModBlocks.fluid_duct_gauge, decoMetaN, 6, 3, 1, box); //chest - generateInvContents(world, box, rand, Blocks.chest, decoMetaN, 6, 1, 2, HbmChestContents.antenna, 4); //WIP + generateInvContents(world, box, rand, Blocks.chest, decoMetaN, 6, 1, 2, HbmChestContents.nuclearFuel, 8); break; } //transformer @@ -903,8 +905,8 @@ public class BunkerComponents { placeBlockAtCurrentPosition(world, Blocks.flower_pot, 0, 8, 2, 10, box); placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, getDecoModelMeta(0), 9, 2, 10, box); //loot - generateInvContents(world, box, rand, Blocks.chest, decoMetaE, 1, 1, 7, HbmChestContents.antenna, 4); //WIP - generateInvContents(world, box, rand, ModBlocks.filing_cabinet, getDecoModelMeta(0), 7, 1, 10, HbmChestContents.antenna, 4); + generateInvContents(world, box, rand, Blocks.chest, decoMetaE, 1, 1, 7, HbmChestContents.machineParts, 6); + generateInvContents(world, box, rand, ModBlocks.filing_cabinet, getDecoModelMeta(0), 7, 1, 10, HbmChestContents.filingCabinet, 4); //doors placeDoor(world, box, ModBlocks.door_bunker, 1, true, rand.nextBoolean(), 3, 1, 0); placeDoor(world, box, ModBlocks.door_bunker, 1, false, rand.nextBoolean(), 4, 1, 0); From 5df2465a169f1db0ba70ff4ff6528f21bb50c90d Mon Sep 17 00:00:00 2001 From: Vaern Date: Fri, 9 Jun 2023 13:41:04 -0700 Subject: [PATCH 7/8] o --- src/main/java/com/hbm/items/tool/ItemWandD.java | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/main/java/com/hbm/items/tool/ItemWandD.java b/src/main/java/com/hbm/items/tool/ItemWandD.java index a9c9a49ae..1debe2a22 100644 --- a/src/main/java/com/hbm/items/tool/ItemWandD.java +++ b/src/main/java/com/hbm/items/tool/ItemWandD.java @@ -3,14 +3,12 @@ package com.hbm.items.tool; import java.util.List; import com.hbm.lib.Library; -import com.hbm.world.gen.component.BunkerComponents; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; -import net.minecraft.world.gen.structure.StructureBoundingBox; public class ItemWandD extends Item { @@ -52,13 +50,6 @@ public class ItemWandD extends Item { tom.destructionRange = 600; world.spawnEntityInWorld(tom);*/ - //use sparingly - int k = ((pos.blockX >> 4) << 4) + 8; - int l = ((pos.blockZ >> 4) << 4) + 8; - - BunkerComponents.BunkerStart start = new BunkerComponents.BunkerStart(world, world.rand, pos.blockX >> 4, pos.blockZ >> 4); - start.generateStructure(world, world.rand, new StructureBoundingBox(k - 124, l - 124, k + 15 + 124, l + 15 + 124)); - /*EntityNukeTorex torex = new EntityNukeTorex(world); torex.setPositionAndRotation(pos.blockX, pos.blockY + 1, pos.blockZ, 0, 0); torex.getDataWatcher().updateObject(10, 1.5F); From 55d2330219e606b397e0935b61cf9e1bffb3ebbe Mon Sep 17 00:00:00 2001 From: Vaern Date: Fri, 9 Jun 2023 13:50:07 -0700 Subject: [PATCH 8/8] destroy --- src/main/java/com/hbm/config/WorldConfig.java | 3 - src/main/java/com/hbm/lib/HbmWorldGen.java | 9 - .../java/com/hbm/world/dungeon/Bunker.java | 1596 ----------------- 3 files changed, 1608 deletions(-) delete mode 100644 src/main/java/com/hbm/world/dungeon/Bunker.java diff --git a/src/main/java/com/hbm/config/WorldConfig.java b/src/main/java/com/hbm/config/WorldConfig.java index faedff279..cf0f08a67 100644 --- a/src/main/java/com/hbm/config/WorldConfig.java +++ b/src/main/java/com/hbm/config/WorldConfig.java @@ -78,7 +78,6 @@ public class WorldConfig { public static int dungeonStructure = 64; public static int relayStructure = 500; public static int satelliteStructure = 500; - public static int bunkerStructure = 1000; public static int siloStructure = 1000; public static int factoryStructure = 1000; public static int dudStructure = 500; @@ -185,7 +184,6 @@ public class WorldConfig { dungeonStructure = CommonConfig.createConfigInt(config, CATEGORY_DUNGEON, "4.04_dungeonSpawn", "Spawn library dungeon on every nTH chunk", 64); relayStructure = CommonConfig.createConfigInt(config, CATEGORY_DUNGEON, "4.05_relaySpawn", "Spawn relay on every nTH chunk", 500); satelliteStructure = CommonConfig.createConfigInt(config, CATEGORY_DUNGEON, "4.06_satelliteSpawn", "Spawn satellite dish on every nTH chunk", 500); - bunkerStructure = CommonConfig.createConfigInt(config, CATEGORY_DUNGEON, "4.07_bunkerSpawn", "Spawn bunker on every nTH chunk", 1000); siloStructure = CommonConfig.createConfigInt(config, CATEGORY_DUNGEON, "4.08_siloSpawn", "Spawn missile silo on every nTH chunk", 1000); factoryStructure = CommonConfig.createConfigInt(config, CATEGORY_DUNGEON, "4.09_factorySpawn", "Spawn factory on every nTH chunk", 1000); dudStructure = CommonConfig.createConfigInt(config, CATEGORY_DUNGEON, "4.10_dudSpawn", "Spawn dud on every nTH chunk", 500); @@ -220,7 +218,6 @@ public class WorldConfig { dungeonStructure = CommonConfig.setDefZero(dungeonStructure, 1000); relayStructure = CommonConfig.setDefZero(relayStructure, 1000); satelliteStructure = CommonConfig.setDefZero(satelliteStructure, 1000); - bunkerStructure = CommonConfig.setDefZero(bunkerStructure, 1000); siloStructure = CommonConfig.setDefZero(siloStructure, 1000); factoryStructure = CommonConfig.setDefZero(factoryStructure, 1000); dudStructure = CommonConfig.setDefZero(dudStructure, 1000); diff --git a/src/main/java/com/hbm/lib/HbmWorldGen.java b/src/main/java/com/hbm/lib/HbmWorldGen.java index dac6fed84..2d1bd69c5 100644 --- a/src/main/java/com/hbm/lib/HbmWorldGen.java +++ b/src/main/java/com/hbm/lib/HbmWorldGen.java @@ -18,7 +18,6 @@ import com.hbm.world.dungeon.AncientTomb; import com.hbm.world.dungeon.Antenna; import com.hbm.world.dungeon.ArcticVault; import com.hbm.world.dungeon.Barrel; -import com.hbm.world.dungeon.Bunker; import com.hbm.world.dungeon.CrashedVertibird; import com.hbm.world.dungeon.DesertAtom001; import com.hbm.world.dungeon.Factory; @@ -314,14 +313,6 @@ public class HbmWorldGen implements IWorldGenerator { } } - if(WorldConfig.bunkerStructure > 0 && rand.nextInt(WorldConfig.bunkerStructure) == 0) { - int x = i + rand.nextInt(16); - int z = j + rand.nextInt(16); - int y = world.getHeightValue(x, z); - - new Bunker().generate(world, rand, x, y, z); - } - if(WorldConfig.siloStructure > 0 && rand.nextInt(WorldConfig.siloStructure) == 0) { int x = i + rand.nextInt(16); int z = j + rand.nextInt(16); diff --git a/src/main/java/com/hbm/world/dungeon/Bunker.java b/src/main/java/com/hbm/world/dungeon/Bunker.java deleted file mode 100644 index 3290d5ebd..000000000 --- a/src/main/java/com/hbm/world/dungeon/Bunker.java +++ /dev/null @@ -1,1596 +0,0 @@ -//Schematic to java Structure by jajo_11 | inspired by "MITHION'S .SCHEMATIC TO JAVA CONVERTINGTOOL" - -package com.hbm.world.dungeon; - -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.GeneralConfig; -import com.hbm.lib.HbmChestContents; -import com.hbm.lib.Library; -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemDoor; -import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.WeightedRandomChestContent; -import net.minecraft.world.World; -import net.minecraft.world.gen.feature.WorldGenerator; - -public class Bunker extends WorldGenerator { - Block Block1 = ModBlocks.reinforced_brick; - Block Block3 = ModBlocks.reinforced_light; - Block Block4 = ModBlocks.deco_steel; - Block Block5 = ModBlocks.deco_tungsten; - - protected Block[] GetValidSpawnBlocks() { - return new Block[] { Blocks.grass, Blocks.dirt, Blocks.stone, Blocks.sand, Blocks.sandstone, }; - } - - @Override - public boolean generate(World world, Random rand, int x, int y, int z) { - int i = rand.nextInt(1); - - if(i == 0) { - generate_r0(world, rand, x, y, z); - } - - return true; - - } - - public boolean LocationIsValidSpawn(World world, int x, int y, int z) { - - Block checkBlock = world.getBlock(x, y - 1, z); - Block blockAbove = world.getBlock(x, y, z); - Block blockBelow = world.getBlock(x, y - 2, z); - - for(Block i : GetValidSpawnBlocks()) { - if(blockAbove != Blocks.air) { - return false; - } - if(checkBlock == i) { - return true; - } else if(checkBlock == Blocks.snow_layer && blockBelow == i) { - return true; - } else if(checkBlock.getMaterial() == Material.plants && blockBelow == i) { - return true; - } - } - return false; - } - - public boolean generate_r0(World world, Random rand, int x, int y, int z) { - y += 1; - - if(!LocationIsValidSpawn(world, x + 9, y, z + 9)) { - return false; - } - - if(!LocationIsValidSpawn(world, x, y, z)) - { - return false; - } - - for(int i = 0; i < 11; i++) { - for(int j = 0; j < 9; j++) { - for(int k = 0; k < 15; k++) { - world.setBlock(x + i, y + j - 25, z + k, Blocks.air, 0, 3); - } - } - } - - world.setBlock(x + 0, y + -25, z + 0, Block1, 0, 3); - world.setBlock(x + 1, y + -25, z + 0, Block1, 0, 3); - world.setBlock(x + 2, y + -25, z + 0, Block1, 0, 3); - world.setBlock(x + 3, y + -25, z + 0, Block1, 0, 3); - world.setBlock(x + 4, y + -25, z + 0, Block1, 0, 3); - world.setBlock(x + 5, y + -25, z + 0, Block1, 0, 3); - world.setBlock(x + 6, y + -25, z + 0, Block1, 0, 3); - world.setBlock(x + 7, y + -25, z + 0, Block1, 0, 3); - world.setBlock(x + 8, y + -25, z + 0, Block1, 0, 3); - world.setBlock(x + 9, y + -25, z + 0, Block1, 0, 3); - world.setBlock(x + 10, y + -25, z + 0, Block1, 0, 3); - world.setBlock(x + 11, y + -25, z + 0, Block1, 0, 3); - world.setBlock(x + 0, y + -25, z + 1, Block1, 0, 3); - world.setBlock(x + 1, y + -25, z + 1, Block1, 0, 3); - world.setBlock(x + 2, y + -25, z + 1, Block1, 0, 3); - world.setBlock(x + 3, y + -25, z + 1, Block1, 0, 3); - world.setBlock(x + 4, y + -25, z + 1, Block1, 0, 3); - world.setBlock(x + 5, y + -25, z + 1, Block1, 0, 3); - world.setBlock(x + 6, y + -25, z + 1, Block1, 0, 3); - world.setBlock(x + 7, y + -25, z + 1, Block1, 0, 3); - world.setBlock(x + 8, y + -25, z + 1, Block1, 0, 3); - world.setBlock(x + 9, y + -25, z + 1, Block1, 0, 3); - world.setBlock(x + 10, y + -25, z + 1, Block1, 0, 3); - world.setBlock(x + 11, y + -25, z + 1, Block1, 0, 3); - world.setBlock(x + 0, y + -25, z + 2, Block1, 0, 3); - world.setBlock(x + 1, y + -25, z + 2, Block1, 0, 3); - world.setBlock(x + 2, y + -25, z + 2, Block1, 0, 3); - world.setBlock(x + 3, y + -25, z + 2, Block1, 0, 3); - world.setBlock(x + 4, y + -25, z + 2, Block1, 0, 3); - world.setBlock(x + 5, y + -25, z + 2, Block1, 0, 3); - world.setBlock(x + 6, y + -25, z + 2, Block1, 0, 3); - world.setBlock(x + 7, y + -25, z + 2, Block1, 0, 3); - world.setBlock(x + 8, y + -25, z + 2, Block1, 0, 3); - world.setBlock(x + 9, y + -25, z + 2, Block1, 0, 3); - world.setBlock(x + 10, y + -25, z + 2, Block1, 0, 3); - world.setBlock(x + 11, y + -25, z + 2, Block1, 0, 3); - world.setBlock(x + 0, y + -25, z + 3, Block1, 0, 3); - world.setBlock(x + 1, y + -25, z + 3, Block1, 0, 3); - world.setBlock(x + 2, y + -25, z + 3, Block1, 0, 3); - world.setBlock(x + 3, y + -25, z + 3, Block1, 0, 3); - world.setBlock(x + 4, y + -25, z + 3, Block1, 0, 3); - world.setBlock(x + 5, y + -25, z + 3, Block1, 0, 3); - world.setBlock(x + 6, y + -25, z + 3, Block1, 0, 3); - world.setBlock(x + 7, y + -25, z + 3, Block1, 0, 3); - world.setBlock(x + 8, y + -25, z + 3, Block1, 0, 3); - world.setBlock(x + 9, y + -25, z + 3, Block1, 0, 3); - world.setBlock(x + 10, y + -25, z + 3, Block1, 0, 3); - world.setBlock(x + 11, y + -25, z + 3, Block1, 0, 3); - world.setBlock(x + 0, y + -25, z + 4, Block1, 0, 3); - world.setBlock(x + 1, y + -25, z + 4, Block1, 0, 3); - world.setBlock(x + 2, y + -25, z + 4, Block1, 0, 3); - world.setBlock(x + 3, y + -25, z + 4, Block1, 0, 3); - world.setBlock(x + 4, y + -25, z + 4, Block1, 0, 3); - world.setBlock(x + 5, y + -25, z + 4, Block1, 0, 3); - world.setBlock(x + 6, y + -25, z + 4, Block1, 0, 3); - world.setBlock(x + 7, y + -25, z + 4, Block1, 0, 3); - world.setBlock(x + 8, y + -25, z + 4, Block1, 0, 3); - world.setBlock(x + 9, y + -25, z + 4, Block1, 0, 3); - world.setBlock(x + 10, y + -25, z + 4, Block1, 0, 3); - world.setBlock(x + 11, y + -25, z + 4, Block1, 0, 3); - world.setBlock(x + 0, y + -25, z + 5, Block1, 0, 3); - world.setBlock(x + 1, y + -25, z + 5, Block1, 0, 3); - world.setBlock(x + 2, y + -25, z + 5, Block1, 0, 3); - world.setBlock(x + 3, y + -25, z + 5, Block1, 0, 3); - world.setBlock(x + 4, y + -25, z + 5, Block1, 0, 3); - world.setBlock(x + 5, y + -25, z + 5, Block1, 0, 3); - world.setBlock(x + 6, y + -25, z + 5, Block1, 0, 3); - world.setBlock(x + 7, y + -25, z + 5, Block1, 0, 3); - world.setBlock(x + 8, y + -25, z + 5, Block1, 0, 3); - world.setBlock(x + 9, y + -25, z + 5, Block1, 0, 3); - world.setBlock(x + 10, y + -25, z + 5, Block1, 0, 3); - world.setBlock(x + 11, y + -25, z + 5, Block1, 0, 3); - world.setBlock(x + 0, y + -25, z + 6, Block1, 0, 3); - world.setBlock(x + 1, y + -25, z + 6, Block1, 0, 3); - world.setBlock(x + 2, y + -25, z + 6, Block1, 0, 3); - world.setBlock(x + 3, y + -25, z + 6, Block1, 0, 3); - world.setBlock(x + 4, y + -25, z + 6, Block1, 0, 3); - world.setBlock(x + 5, y + -25, z + 6, Block1, 0, 3); - world.setBlock(x + 6, y + -25, z + 6, Block1, 0, 3); - world.setBlock(x + 7, y + -25, z + 6, Block1, 0, 3); - world.setBlock(x + 8, y + -25, z + 6, Block1, 0, 3); - world.setBlock(x + 9, y + -25, z + 6, Block1, 0, 3); - world.setBlock(x + 10, y + -25, z + 6, Block1, 0, 3); - world.setBlock(x + 11, y + -25, z + 6, Block1, 0, 3); - world.setBlock(x + 0, y + -25, z + 7, Block1, 0, 3); - world.setBlock(x + 1, y + -25, z + 7, Block1, 0, 3); - world.setBlock(x + 2, y + -25, z + 7, Block1, 0, 3); - world.setBlock(x + 3, y + -25, z + 7, Block1, 0, 3); - world.setBlock(x + 4, y + -25, z + 7, Block1, 0, 3); - world.setBlock(x + 5, y + -25, z + 7, Block1, 0, 3); - world.setBlock(x + 6, y + -25, z + 7, Block1, 0, 3); - world.setBlock(x + 7, y + -25, z + 7, Block1, 0, 3); - world.setBlock(x + 8, y + -25, z + 7, Block1, 0, 3); - world.setBlock(x + 9, y + -25, z + 7, Block1, 0, 3); - world.setBlock(x + 10, y + -25, z + 7, Block1, 0, 3); - world.setBlock(x + 11, y + -25, z + 7, Block1, 0, 3); - world.setBlock(x + 0, y + -25, z + 8, Block1, 0, 3); - world.setBlock(x + 1, y + -25, z + 8, Block1, 0, 3); - world.setBlock(x + 2, y + -25, z + 8, Block1, 0, 3); - world.setBlock(x + 3, y + -25, z + 8, Block1, 0, 3); - world.setBlock(x + 4, y + -25, z + 8, Block1, 0, 3); - world.setBlock(x + 5, y + -25, z + 8, Block1, 0, 3); - world.setBlock(x + 6, y + -25, z + 8, Block1, 0, 3); - world.setBlock(x + 7, y + -25, z + 8, Block1, 0, 3); - world.setBlock(x + 8, y + -25, z + 8, Block1, 0, 3); - world.setBlock(x + 9, y + -25, z + 8, Block1, 0, 3); - world.setBlock(x + 10, y + -25, z + 8, Block1, 0, 3); - world.setBlock(x + 11, y + -25, z + 8, Block1, 0, 3); - world.setBlock(x + 0, y + -25, z + 9, Block1, 0, 3); - world.setBlock(x + 1, y + -25, z + 9, Block1, 0, 3); - world.setBlock(x + 2, y + -25, z + 9, Block1, 0, 3); - world.setBlock(x + 3, y + -25, z + 9, Block1, 0, 3); - world.setBlock(x + 4, y + -25, z + 9, Block1, 0, 3); - world.setBlock(x + 5, y + -25, z + 9, Block1, 0, 3); - world.setBlock(x + 6, y + -25, z + 9, Block1, 0, 3); - world.setBlock(x + 7, y + -25, z + 9, Block1, 0, 3); - world.setBlock(x + 8, y + -25, z + 9, Block1, 0, 3); - world.setBlock(x + 9, y + -25, z + 9, Block1, 0, 3); - world.setBlock(x + 10, y + -25, z + 9, Block1, 0, 3); - world.setBlock(x + 11, y + -25, z + 9, Block1, 0, 3); - world.setBlock(x + 0, y + -25, z + 10, Block1, 0, 3); - world.setBlock(x + 1, y + -25, z + 10, Block1, 0, 3); - world.setBlock(x + 2, y + -25, z + 10, Block1, 0, 3); - world.setBlock(x + 3, y + -25, z + 10, Block1, 0, 3); - world.setBlock(x + 4, y + -25, z + 10, Block1, 0, 3); - world.setBlock(x + 5, y + -25, z + 10, Block1, 0, 3); - world.setBlock(x + 6, y + -25, z + 10, Block1, 0, 3); - world.setBlock(x + 7, y + -25, z + 10, Block1, 0, 3); - world.setBlock(x + 8, y + -25, z + 10, Block1, 0, 3); - world.setBlock(x + 9, y + -25, z + 10, Block1, 0, 3); - world.setBlock(x + 10, y + -25, z + 10, Block1, 0, 3); - world.setBlock(x + 11, y + -25, z + 10, Block1, 0, 3); - world.setBlock(x + 0, y + -25, z + 11, Block1, 0, 3); - world.setBlock(x + 1, y + -25, z + 11, Block1, 0, 3); - world.setBlock(x + 2, y + -25, z + 11, Block1, 0, 3); - world.setBlock(x + 3, y + -25, z + 11, Block1, 0, 3); - world.setBlock(x + 4, y + -25, z + 11, Block1, 0, 3); - world.setBlock(x + 5, y + -25, z + 11, Block1, 0, 3); - world.setBlock(x + 6, y + -25, z + 11, Block1, 0, 3); - world.setBlock(x + 7, y + -25, z + 11, Block1, 0, 3); - world.setBlock(x + 8, y + -25, z + 11, Block1, 0, 3); - world.setBlock(x + 9, y + -25, z + 11, Block1, 0, 3); - world.setBlock(x + 10, y + -25, z + 11, Block1, 0, 3); - world.setBlock(x + 11, y + -25, z + 11, Block1, 0, 3); - world.setBlock(x + 0, y + -25, z + 12, Block1, 0, 3); - world.setBlock(x + 1, y + -25, z + 12, Block1, 0, 3); - world.setBlock(x + 2, y + -25, z + 12, Block1, 0, 3); - world.setBlock(x + 3, y + -25, z + 12, Block1, 0, 3); - world.setBlock(x + 4, y + -25, z + 12, Block1, 0, 3); - world.setBlock(x + 5, y + -25, z + 12, Block1, 0, 3); - world.setBlock(x + 6, y + -25, z + 12, Block1, 0, 3); - world.setBlock(x + 7, y + -25, z + 12, Block1, 0, 3); - world.setBlock(x + 8, y + -25, z + 12, Block1, 0, 3); - world.setBlock(x + 9, y + -25, z + 12, Block1, 0, 3); - world.setBlock(x + 10, y + -25, z + 12, Block1, 0, 3); - world.setBlock(x + 11, y + -25, z + 12, Block1, 0, 3); - world.setBlock(x + 0, y + -25, z + 13, Block1, 0, 3); - world.setBlock(x + 1, y + -25, z + 13, Block1, 0, 3); - world.setBlock(x + 2, y + -25, z + 13, Block1, 0, 3); - world.setBlock(x + 3, y + -25, z + 13, Block1, 0, 3); - world.setBlock(x + 4, y + -25, z + 13, Block1, 0, 3); - world.setBlock(x + 5, y + -25, z + 13, Block1, 0, 3); - world.setBlock(x + 6, y + -25, z + 13, Block1, 0, 3); - world.setBlock(x + 7, y + -25, z + 13, Block1, 0, 3); - world.setBlock(x + 8, y + -25, z + 13, Block1, 0, 3); - world.setBlock(x + 9, y + -25, z + 13, Block1, 0, 3); - world.setBlock(x + 10, y + -25, z + 13, Block1, 0, 3); - world.setBlock(x + 11, y + -25, z + 13, Block1, 0, 3); - world.setBlock(x + 0, y + -25, z + 14, Block1, 0, 3); - world.setBlock(x + 1, y + -25, z + 14, Block1, 0, 3); - world.setBlock(x + 2, y + -25, z + 14, Block1, 0, 3); - world.setBlock(x + 3, y + -25, z + 14, Block1, 0, 3); - world.setBlock(x + 4, y + -25, z + 14, Block1, 0, 3); - world.setBlock(x + 5, y + -25, z + 14, Block1, 0, 3); - world.setBlock(x + 6, y + -25, z + 14, Block1, 0, 3); - world.setBlock(x + 7, y + -25, z + 14, Block1, 0, 3); - world.setBlock(x + 8, y + -25, z + 14, Block1, 0, 3); - world.setBlock(x + 9, y + -25, z + 14, Block1, 0, 3); - world.setBlock(x + 10, y + -25, z + 14, Block1, 0, 3); - world.setBlock(x + 11, y + -25, z + 14, Block1, 0, 3); - world.setBlock(x + 0, y + -24, z + 0, Block1, 0, 3); - world.setBlock(x + 1, y + -24, z + 0, Block1, 0, 3); - world.setBlock(x + 2, y + -24, z + 0, Block1, 0, 3); - world.setBlock(x + 3, y + -24, z + 0, Block1, 0, 3); - world.setBlock(x + 4, y + -24, z + 0, Block1, 0, 3); - world.setBlock(x + 5, y + -24, z + 0, Block1, 0, 3); - world.setBlock(x + 6, y + -24, z + 0, Block1, 0, 3); - world.setBlock(x + 7, y + -24, z + 0, Block1, 0, 3); - world.setBlock(x + 8, y + -24, z + 0, Block1, 0, 3); - world.setBlock(x + 9, y + -24, z + 0, Block1, 0, 3); - world.setBlock(x + 10, y + -24, z + 0, Block1, 0, 3); - world.setBlock(x + 11, y + -24, z + 0, Block1, 0, 3); - world.setBlock(x + 0, y + -24, z + 1, Block1, 0, 3); - world.setBlock(x + 1, y + -24, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + -24, z + 1, Blocks.chest, 3, 3); - world.setBlockMetadataWithNotify(x + 2, y + -24, z + 1, 3, 3); - if(world.getBlock(x + 2, y + -24, z + 1) == Blocks.chest) { - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.expensive, (TileEntityChest) world.getTileEntity(x + 2, y + -24, z + 1), rand.nextInt(2) + 6); - } - - if(world.rand.nextInt(10) > 0) { - world.setBlock(x + 2, y + -23, z + 1, ModBlocks.geiger, 2, 3); - } else { - world.setBlock(x + 2, y + -23, z + 1, ModBlocks.bobblehead, 0, 3); - TileEntityBobble bobble = (TileEntityBobble) world.getTileEntity(x + 2, y + -23, z + 1); - - if(bobble != null) { - bobble.type = BobbleType.values()[world.rand.nextInt(BobbleType.values().length - 1) + 1]; - bobble.markDirty(); - } - } - - world.setBlock(x + 3, y + -24, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 4, y + -24, z + 1, Block1, 0, 3); - world.setBlock(x + 11, y + -24, z + 1, Block1, 0, 3); - world.setBlock(x + 0, y + -24, z + 2, Block1, 0, 3); - world.setBlock(x + 1, y + -24, z + 2, Blocks.chest, 5, 3); - world.setBlockMetadataWithNotify(x + 1, y + -24, z + 5, 3, 3); - if(world.getBlock(x + 2, y + -24, z + 1) == Blocks.chest) { - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.modGeneric, (TileEntityChest) world.getTileEntity(x + 1, y + -24, z + 2), 8); - } - world.setBlock(x + 3, y + -24, z + 2, Blocks.chest, 4, 3); - world.setBlockMetadataWithNotify(x + 3, y + -24, z + 2, 4, 3); - if(world.getBlock(x + 3, y + -24, z + 2) == Blocks.chest) { - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.modGeneric, (TileEntityChest) world.getTileEntity(x + 3, y + -24, z + 2), 8); - } - world.setBlock(x + 4, y + -24, z + 2, Block1, 0, 3); - world.setBlock(x + 11, y + -24, z + 2, Block1, 0, 3); - world.setBlock(x + 0, y + -24, z + 3, Block1, 0, 3); - world.setBlock(x + 1, y + -24, z + 3, Blocks.chest, 5, 3); - world.setBlockMetadataWithNotify(x + 1, y + -24, z + 3, 5, 3); - if(world.getBlock(x + 1, y + -24, z + 3) == Blocks.chest) { - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.modGeneric, (TileEntityChest) world.getTileEntity(x + 1, y + -24, z + 3), 8); - } - world.setBlock(x + 3, y + -24, z + 3, Blocks.chest, 4, 3); - world.setBlockMetadataWithNotify(x + 3, y + -24, z + 3, 5, 3); - if(world.getBlock(x + 3, y + -24, z + 3) == Blocks.chest) { - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.modGeneric, (TileEntityChest) world.getTileEntity(x + 3, y + -24, z + 3), 8); - } - world.setBlock(x + 4, y + -24, z + 3, Block1, 0, 3); - world.setBlock(x + 7, y + -24, z + 3, Block1, 0, 3); - world.setBlock(x + 8, y + -24, z + 3, Block1, 0, 3); - world.setBlock(x + 9, y + -24, z + 3, Blocks.iron_door, 5, 3); - ItemDoor.placeDoorBlock(world, x + 9, y + -24, z + 3, 5, Blocks.iron_door); - world.setBlock(x + 10, y + -24, z + 3, Block1, 0, 3); - world.setBlock(x + 11, y + -24, z + 3, Block1, 0, 3); - world.setBlock(x + 0, y + -24, z + 4, Block1, 0, 3); - world.setBlock(x + 1, y + -24, z + 4, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -24, z + 4, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 4, y + -24, z + 4, Block1, 0, 3); - world.setBlock(x + 7, y + -24, z + 4, Block1, 0, 3); - world.setBlock(x + 10, y + -24, z + 4, Blocks.cauldron, 0, 3); - world.setBlock(x + 11, y + -24, z + 4, Block1, 0, 3); - world.setBlock(x + 0, y + -24, z + 5, Block1, 0, 3); - world.setBlock(x + 1, y + -24, z + 5, Block1, 0, 3); - world.setBlock(x + 2, y + -24, z + 5, Blocks.iron_door, 3, 3); - ItemDoor.placeDoorBlock(world, x + 2, y + -24, z + 5, 3, Blocks.iron_door); - world.setBlock(x + 3, y + -24, z + 5, Block1, 0, 3); - world.setBlock(x + 4, y + -24, z + 5, Block1, 0, 3); - world.setBlock(x + 7, y + -24, z + 5, Block1, 0, 3); - world.setBlock(x + 10, y + -24, z + 5, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 11, y + -24, z + 5, Block1, 0, 3); - world.setBlock(x + 0, y + -24, z + 6, Block1, 0, 3); - world.setBlock(x + 7, y + -24, z + 6, Block1, 0, 3); - world.setBlock(x + 10, y + -24, z + 6, Blocks.cauldron, 0, 3); - world.setBlock(x + 11, y + -24, z + 6, Block1, 0, 3); - world.setBlock(x + 0, y + -24, z + 7, Block1, 0, 3); - world.setBlock(x + 7, y + -24, z + 7, Block1, 0, 3); - world.setBlock(x + 10, y + -24, z + 7, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 11, y + -24, z + 7, Block1, 0, 3); - world.setBlock(x + 0, y + -24, z + 8, Block1, 0, 3); - world.setBlock(x + 3, y + -24, z + 8, Block1, 0, 3); - world.setBlock(x + 4, y + -24, z + 8, Block1, 0, 3); - world.setBlock(x + 5, y + -24, z + 8, Block1, 0, 3); - world.setBlock(x + 6, y + -24, z + 8, Block1, 0, 3); - world.setBlock(x + 7, y + -24, z + 8, Block1, 0, 3); - world.setBlock(x + 10, y + -24, z + 8, Blocks.cauldron, 0, 3); - world.setBlock(x + 11, y + -24, z + 8, Block1, 0, 3); - world.setBlock(x + 0, y + -24, z + 9, Block1, 0, 3); - world.setBlock(x + 3, y + -24, z + 9, Block1, 0, 3); - world.setBlock(x + 7, y + -24, z + 9, Blocks.iron_door, 1, 3); - ItemDoor.placeDoorBlock(world, x + 7, y + -24, z + 9, 1, Blocks.iron_door); - world.setBlock(x + 10, y + -24, z + 9, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 11, y + -24, z + 9, Block1, 0, 3); - world.setBlock(x + 0, y + -24, z + 10, Block1, 0, 3); - world.setBlock(x + 3, y + -24, z + 10, Block1, 0, 3); - world.setBlock(x + 4, y + -24, z + 10, Blocks.hopper, 4, 3); - world.setBlock(x + 6, y + -24, z + 10, Blocks.cauldron, 0, 3); - world.setBlock(x + 7, y + -24, z + 10, Block1, 0, 3); - world.setBlock(x + 10, y + -24, z + 10, Blocks.cauldron, 0, 3); - world.setBlock(x + 11, y + -24, z + 10, Block1, 0, 3); - world.setBlock(x + 0, y + -24, z + 11, Block1, 0, 3); - world.setBlock(x + 3, y + -24, z + 11, Block1, 0, 3); - world.setBlock(x + 4, y + -24, z + 11, Block1, 0, 3); - world.setBlock(x + 5, y + -24, z + 11, Block1, 0, 3); - world.setBlock(x + 6, y + -24, z + 11, Block1, 0, 3); - world.setBlock(x + 7, y + -24, z + 11, Block1, 0, 3); - world.setBlock(x + 8, y + -24, z + 11, Block1, 0, 3); - world.setBlock(x + 9, y + -24, z + 11, Block1, 0, 3); - world.setBlock(x + 10, y + -24, z + 11, Block1, 0, 3); - world.setBlock(x + 11, y + -24, z + 11, Block1, 0, 3); - world.setBlock(x + 0, y + -24, z + 12, Block1, 0, 3); - world.setBlock(x + 11, y + -24, z + 12, Block1, 0, 3); - world.setBlock(x + 0, y + -24, z + 13, Block1, 0, 3); - world.setBlock(x + 11, y + -24, z + 13, Block1, 0, 3); - world.setBlock(x + 0, y + -24, z + 14, Block1, 0, 3); - world.setBlock(x + 1, y + -24, z + 14, Block1, 0, 3); - world.setBlock(x + 2, y + -24, z + 14, Block1, 0, 3); - world.setBlock(x + 3, y + -24, z + 14, Block1, 0, 3); - world.setBlock(x + 4, y + -24, z + 14, Block1, 0, 3); - world.setBlock(x + 5, y + -24, z + 14, Block1, 0, 3); - world.setBlock(x + 6, y + -24, z + 14, Block1, 0, 3); - world.setBlock(x + 7, y + -24, z + 14, Block1, 0, 3); - world.setBlock(x + 8, y + -24, z + 14, Block1, 0, 3); - world.setBlock(x + 9, y + -24, z + 14, Block1, 0, 3); - world.setBlock(x + 10, y + -24, z + 14, Block1, 0, 3); - world.setBlock(x + 11, y + -24, z + 14, Block1, 0, 3); - world.setBlock(x + 0, y + -23, z + 0, Block1, 0, 3); - world.setBlock(x + 1, y + -23, z + 0, Block1, 0, 3); - world.setBlock(x + 2, y + -23, z + 0, Block1, 0, 3); - world.setBlock(x + 3, y + -23, z + 0, Block1, 0, 3); - world.setBlock(x + 4, y + -23, z + 0, Block1, 0, 3); - world.setBlock(x + 5, y + -23, z + 0, Block1, 0, 3); - world.setBlock(x + 6, y + -23, z + 0, Block3, 0, 3); - world.setBlock(x + 7, y + -23, z + 0, Block1, 0, 3); - world.setBlock(x + 8, y + -23, z + 0, Block1, 0, 3); - world.setBlock(x + 9, y + -23, z + 0, Block3, 0, 3); - world.setBlock(x + 10, y + -23, z + 0, Block1, 0, 3); - world.setBlock(x + 11, y + -23, z + 0, Block1, 0, 3); - world.setBlock(x + 0, y + -23, z + 1, Block1, 0, 3); - world.setBlock(x + 1, y + -23, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -23, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 4, y + -23, z + 1, Block1, 0, 3); - world.setBlock(x + 5, y + -23, z + 1, Blocks.web, 0, 3); - world.setBlock(x + 10, y + -23, z + 1, Blocks.web, 0, 3); - world.setBlock(x + 11, y + -23, z + 1, Block1, 0, 3); - world.setBlock(x + 0, y + -23, z + 2, Block1, 0, 3); - world.setBlock(x + 4, y + -23, z + 2, Block1, 0, 3); - world.setBlock(x + 11, y + -23, z + 2, Block1, 0, 3); - world.setBlock(x + 0, y + -23, z + 3, Block1, 0, 3); - world.setBlock(x + 4, y + -23, z + 3, Block1, 0, 3); - world.setBlock(x + 7, y + -23, z + 3, Block1, 0, 3); - world.setBlock(x + 8, y + -23, z + 3, Block1, 0, 3); - // world.setBlock(x + 9, y + -23, z + 3, Blocks.iron_door, 8, 3); - world.setBlock(x + 10, y + -23, z + 3, Block1, 0, 3); - world.setBlock(x + 11, y + -23, z + 3, Block1, 0, 3); - world.setBlock(x + 0, y + -23, z + 4, Block1, 0, 3); - world.setBlock(x + 1, y + -23, z + 4, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -23, z + 4, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 4, y + -23, z + 4, Block1, 0, 3); - world.setBlock(x + 7, y + -23, z + 4, Block1, 0, 3); - world.setBlock(x + 11, y + -23, z + 4, Block1, 0, 3); - world.setBlock(x + 0, y + -23, z + 5, Block1, 0, 3); - world.setBlock(x + 1, y + -23, z + 5, Block1, 0, 3); - // world.setBlock(x + 2, y + -23, z + 5, Blocks.iron_door, 8, 3); - world.setBlock(x + 3, y + -23, z + 5, Block1, 0, 3); - world.setBlock(x + 4, y + -23, z + 5, Block3, 0, 3); - world.setBlock(x + 7, y + -23, z + 5, Block1, 0, 3); - world.setBlock(x + 11, y + -23, z + 5, Block1, 0, 3); - world.setBlock(x + 0, y + -23, z + 6, Block1, 0, 3); - world.setBlock(x + 7, y + -23, z + 6, Block1, 0, 3); - world.setBlock(x + 11, y + -23, z + 6, Block1, 0, 3); - world.setBlock(x + 0, y + -23, z + 7, Block1, 0, 3); - world.setBlock(x + 7, y + -23, z + 7, Block1, 0, 3); - world.setBlock(x + 11, y + -23, z + 7, Block1, 0, 3); - world.setBlock(x + 0, y + -23, z + 8, Block1, 0, 3); - world.setBlock(x + 3, y + -23, z + 8, Block1, 0, 3); - world.setBlock(x + 4, y + -23, z + 8, Block1, 0, 3); - world.setBlock(x + 5, y + -23, z + 8, Block1, 0, 3); - world.setBlock(x + 6, y + -23, z + 8, Block1, 0, 3); - world.setBlock(x + 7, y + -23, z + 8, Block1, 0, 3); - world.setBlock(x + 11, y + -23, z + 8, Block1, 0, 3); - world.setBlock(x + 0, y + -23, z + 9, Block1, 0, 3); - world.setBlock(x + 1, y + -23, z + 9, Blocks.web, 0, 3); - world.setBlock(x + 3, y + -23, z + 9, Block3, 0, 3); - // world.setBlock(x + 7, y + -23, z + 9, Blocks.iron_door, 8, 3); - world.setBlock(x + 11, y + -23, z + 9, Block1, 0, 3); - world.setBlock(x + 0, y + -23, z + 10, Block1, 0, 3); - world.setBlock(x + 3, y + -23, z + 10, Block1, 0, 3); - world.setBlock(x + 4, y + -23, z + 10, Blocks.trapdoor, 7, 3); - world.setBlock(x + 7, y + -23, z + 10, Block1, 0, 3); - world.setBlock(x + 11, y + -23, z + 10, Block1, 0, 3); - world.setBlock(x + 0, y + -23, z + 11, Block1, 0, 3); - world.setBlock(x + 3, y + -23, z + 11, Block1, 0, 3); - world.setBlock(x + 4, y + -23, z + 11, Block1, 0, 3); - world.setBlock(x + 5, y + -23, z + 11, Block1, 0, 3); - world.setBlock(x + 6, y + -23, z + 11, Block1, 0, 3); - world.setBlock(x + 7, y + -23, z + 11, Block1, 0, 3); - world.setBlock(x + 8, y + -23, z + 11, Block1, 0, 3); - world.setBlock(x + 9, y + -23, z + 11, Block1, 0, 3); - world.setBlock(x + 10, y + -23, z + 11, Block1, 0, 3); - world.setBlock(x + 11, y + -23, z + 11, Block1, 0, 3); - world.setBlock(x + 0, y + -23, z + 12, Block1, 0, 3); - world.setBlock(x + 11, y + -23, z + 12, Block1, 0, 3); - world.setBlock(x + 0, y + -23, z + 13, Block1, 0, 3); - world.setBlock(x + 1, y + -23, z + 13, Blocks.web, 0, 3); - world.setBlock(x + 11, y + -23, z + 13, Block1, 0, 3); - world.setBlock(x + 0, y + -23, z + 14, Block1, 0, 3); - world.setBlock(x + 1, y + -23, z + 14, Block1, 0, 3); - // prevent geiger displacement - // world.setBlock(x + 2, y + -23, z + 14, Block1, 0, 3); - world.setBlock(x + 3, y + -23, z + 14, Block1, 0, 3); - world.setBlock(x + 4, y + -23, z + 14, Block3, 0, 3); - world.setBlock(x + 5, y + -23, z + 14, Block1, 0, 3); - world.setBlock(x + 6, y + -23, z + 14, Block1, 0, 3); - world.setBlock(x + 7, y + -23, z + 14, Block3, 0, 3); - world.setBlock(x + 8, y + -23, z + 14, Block1, 0, 3); - world.setBlock(x + 9, y + -23, z + 14, Block1, 0, 3); - world.setBlock(x + 10, y + -23, z + 14, Block1, 0, 3); - world.setBlock(x + 11, y + -23, z + 14, Block1, 0, 3); - world.setBlock(x + 0, y + -22, z + 0, Block1, 0, 3); - world.setBlock(x + 1, y + -22, z + 0, Block1, 0, 3); - world.setBlock(x + 2, y + -22, z + 0, Block1, 0, 3); - world.setBlock(x + 3, y + -22, z + 0, Block1, 0, 3); - world.setBlock(x + 4, y + -22, z + 0, Block1, 0, 3); - world.setBlock(x + 5, y + -22, z + 0, Block1, 0, 3); - world.setBlock(x + 6, y + -22, z + 0, Block1, 0, 3); - world.setBlock(x + 7, y + -22, z + 0, Block1, 0, 3); - world.setBlock(x + 8, y + -22, z + 0, Block1, 0, 3); - world.setBlock(x + 9, y + -22, z + 0, Block1, 0, 3); - world.setBlock(x + 10, y + -22, z + 0, Block1, 0, 3); - world.setBlock(x + 11, y + -22, z + 0, Block1, 0, 3); - world.setBlock(x + 0, y + -22, z + 1, Block1, 0, 3); - world.setBlock(x + 1, y + -22, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + -22, z + 1, Block3, 0, 3); - world.setBlock(x + 3, y + -22, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 4, y + -22, z + 1, Block1, 0, 3); - world.setBlock(x + 5, y + -22, z + 1, Blocks.web, 0, 3); - world.setBlock(x + 6, y + -22, z + 1, Blocks.web, 0, 3); - world.setBlock(x + 9, y + -22, z + 1, Blocks.web, 0, 3); - world.setBlock(x + 11, y + -22, z + 1, Block1, 0, 3); - world.setBlock(x + 0, y + -22, z + 2, Block1, 0, 3); - world.setBlock(x + 4, y + -22, z + 2, Block1, 0, 3); - world.setBlock(x + 5, y + -22, z + 2, Blocks.web, 0, 3); - world.setBlock(x + 10, y + -22, z + 2, Blocks.web, 0, 3); - world.setBlock(x + 11, y + -22, z + 2, Block1, 0, 3); - world.setBlock(x + 0, y + -22, z + 3, Block1, 0, 3); - world.setBlock(x + 4, y + -22, z + 3, Block1, 0, 3); - world.setBlock(x + 7, y + -22, z + 3, Block1, 0, 3); - world.setBlock(x + 8, y + -22, z + 3, Block1, 0, 3); - world.setBlock(x + 9, y + -22, z + 3, Block1, 0, 3); - world.setBlock(x + 10, y + -22, z + 3, Block1, 0, 3); - world.setBlock(x + 11, y + -22, z + 3, Block1, 0, 3); - world.setBlock(x + 0, y + -22, z + 4, Block1, 0, 3); - world.setBlock(x + 1, y + -22, z + 4, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + -22, z + 4, Block3, 0, 3); - world.setBlock(x + 3, y + -22, z + 4, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 4, y + -22, z + 4, Block1, 0, 3); - world.setBlock(x + 7, y + -22, z + 4, Block1, 0, 3); - world.setBlock(x + 8, y + -22, z + 4, Blocks.web, 0, 3); - world.setBlock(x + 10, y + -22, z + 4, Block3, 0, 3); - world.setBlock(x + 11, y + -22, z + 4, Block1, 0, 3); - world.setBlock(x + 0, y + -22, z + 5, Block1, 0, 3); - world.setBlock(x + 1, y + -22, z + 5, Block1, 0, 3); - world.setBlock(x + 2, y + -22, z + 5, Block1, 0, 3); - world.setBlock(x + 3, y + -22, z + 5, Block1, 0, 3); - world.setBlock(x + 4, y + -22, z + 5, Block1, 0, 3); - world.setBlock(x + 7, y + -22, z + 5, Block1, 0, 3); - world.setBlock(x + 11, y + -22, z + 5, Block1, 0, 3); - world.setBlock(x + 0, y + -22, z + 6, Block1, 0, 3); - world.setBlock(x + 1, y + -22, z + 6, Blocks.web, 0, 3); - world.setBlock(x + 6, y + -22, z + 6, Blocks.web, 0, 3); - world.setBlock(x + 7, y + -22, z + 6, Block1, 0, 3); - world.setBlock(x + 10, y + -22, z + 6, Block3, 0, 3); - world.setBlock(x + 11, y + -22, z + 6, Block1, 0, 3); - world.setBlock(x + 0, y + -22, z + 7, Block1, 0, 3); - world.setBlock(x + 5, y + -22, z + 7, Blocks.web, 0, 3); - world.setBlock(x + 6, y + -22, z + 7, Blocks.web, 0, 3); - world.setBlock(x + 7, y + -22, z + 7, Block1, 0, 3); - world.setBlock(x + 10, y + -22, z + 7, Blocks.web, 0, 3); - world.setBlock(x + 11, y + -22, z + 7, Block1, 0, 3); - world.setBlock(x + 0, y + -22, z + 8, Block1, 0, 3); - world.setBlock(x + 1, y + -22, z + 8, Blocks.web, 0, 3); - world.setBlock(x + 3, y + -22, z + 8, Block1, 0, 3); - world.setBlock(x + 4, y + -22, z + 8, Block1, 0, 3); - world.setBlock(x + 5, y + -22, z + 8, Block1, 0, 3); - world.setBlock(x + 6, y + -22, z + 8, Block1, 0, 3); - world.setBlock(x + 7, y + -22, z + 8, Block1, 0, 3); - world.setBlock(x + 10, y + -22, z + 8, Block3, 0, 3); - world.setBlock(x + 11, y + -22, z + 8, Block1, 0, 3); - world.setBlock(x + 0, y + -22, z + 9, Block1, 0, 3); - world.setBlock(x + 2, y + -22, z + 9, Blocks.web, 0, 3); - world.setBlock(x + 3, y + -22, z + 9, Block1, 0, 3); - world.setBlock(x + 6, y + -22, z + 9, Blocks.web, 0, 3); - world.setBlock(x + 7, y + -22, z + 9, Block1, 0, 3); - world.setBlock(x + 8, y + -22, z + 9, Blocks.web, 0, 3); - world.setBlock(x + 11, y + -22, z + 9, Block1, 0, 3); - world.setBlock(x + 0, y + -22, z + 10, Block1, 0, 3); - world.setBlock(x + 1, y + -22, z + 10, Blocks.web, 0, 3); - world.setBlock(x + 3, y + -22, z + 10, Block1, 0, 3); - world.setBlock(x + 7, y + -22, z + 10, Block1, 0, 3); - world.setBlock(x + 8, y + -22, z + 10, Blocks.web, 0, 3); - world.setBlock(x + 10, y + -22, z + 10, Block3, 0, 3); - world.setBlock(x + 11, y + -22, z + 10, Block1, 0, 3); - world.setBlock(x + 0, y + -22, z + 11, Block1, 0, 3); - world.setBlock(x + 3, y + -22, z + 11, Block1, 0, 3); - world.setBlock(x + 4, y + -22, z + 11, Block1, 0, 3); - world.setBlock(x + 5, y + -22, z + 11, Block1, 0, 3); - world.setBlock(x + 6, y + -22, z + 11, Block1, 0, 3); - world.setBlock(x + 7, y + -22, z + 11, Block1, 0, 3); - world.setBlock(x + 8, y + -22, z + 11, Block1, 0, 3); - world.setBlock(x + 9, y + -22, z + 11, Block1, 0, 3); - world.setBlock(x + 10, y + -22, z + 11, Block1, 0, 3); - world.setBlock(x + 11, y + -22, z + 11, Block1, 0, 3); - world.setBlock(x + 0, y + -22, z + 12, Block1, 0, 3); - world.setBlock(x + 1, y + -22, z + 12, Blocks.web, 0, 3); - world.setBlock(x + 5, y + -22, z + 12, Blocks.web, 0, 3); - world.setBlock(x + 11, y + -22, z + 12, Block1, 0, 3); - world.setBlock(x + 0, y + -22, z + 13, Block1, 0, 3); - world.setBlock(x + 1, y + -22, z + 13, Blocks.web, 0, 3); - world.setBlock(x + 2, y + -22, z + 13, Blocks.web, 0, 3); - world.setBlock(x + 3, y + -22, z + 13, Blocks.web, 0, 3); - world.setBlock(x + 6, y + -22, z + 13, Blocks.web, 0, 3); - world.setBlock(x + 7, y + -22, z + 13, Blocks.web, 0, 3); - world.setBlock(x + 8, y + -22, z + 13, Blocks.web, 0, 3); - world.setBlock(x + 11, y + -22, z + 13, Block1, 0, 3); - world.setBlock(x + 0, y + -22, z + 14, Block1, 0, 3); - world.setBlock(x + 1, y + -22, z + 14, Block1, 0, 3); - world.setBlock(x + 2, y + -22, z + 14, Block1, 0, 3); - world.setBlock(x + 3, y + -22, z + 14, Block1, 0, 3); - world.setBlock(x + 4, y + -22, z + 14, Block1, 0, 3); - world.setBlock(x + 5, y + -22, z + 14, Block1, 0, 3); - world.setBlock(x + 6, y + -22, z + 14, Block1, 0, 3); - world.setBlock(x + 7, y + -22, z + 14, Block1, 0, 3); - world.setBlock(x + 8, y + -22, z + 14, Block1, 0, 3); - world.setBlock(x + 9, y + -22, z + 14, Block1, 0, 3); - world.setBlock(x + 10, y + -22, z + 14, Block1, 0, 3); - world.setBlock(x + 11, y + -22, z + 14, Block1, 0, 3); - world.setBlock(x + 0, y + -21, z + 0, Block1, 0, 3); - world.setBlock(x + 1, y + -21, z + 0, Block1, 0, 3); - world.setBlock(x + 2, y + -21, z + 0, Block1, 0, 3); - world.setBlock(x + 3, y + -21, z + 0, Block1, 0, 3); - world.setBlock(x + 4, y + -21, z + 0, Block1, 0, 3); - world.setBlock(x + 5, y + -21, z + 0, Block1, 0, 3); - world.setBlock(x + 6, y + -21, z + 0, Block1, 0, 3); - world.setBlock(x + 7, y + -21, z + 0, Block1, 0, 3); - world.setBlock(x + 8, y + -21, z + 0, Block1, 0, 3); - world.setBlock(x + 9, y + -21, z + 0, Block1, 0, 3); - world.setBlock(x + 10, y + -21, z + 0, Block1, 0, 3); - world.setBlock(x + 11, y + -21, z + 0, Block1, 0, 3); - world.setBlock(x + 0, y + -21, z + 1, Block1, 0, 3); - world.setBlock(x + 1, y + -21, z + 1, Block1, 0, 3); - world.setBlock(x + 2, y + -21, z + 1, Block1, 0, 3); - world.setBlock(x + 3, y + -21, z + 1, Block1, 0, 3); - world.setBlock(x + 4, y + -21, z + 1, Block1, 0, 3); - world.setBlock(x + 5, y + -21, z + 1, Block1, 0, 3); - world.setBlock(x + 6, y + -21, z + 1, Block1, 0, 3); - world.setBlock(x + 7, y + -21, z + 1, Block1, 0, 3); - world.setBlock(x + 8, y + -21, z + 1, Block1, 0, 3); - world.setBlock(x + 9, y + -21, z + 1, Block1, 0, 3); - world.setBlock(x + 10, y + -21, z + 1, Block1, 0, 3); - world.setBlock(x + 11, y + -21, z + 1, Block1, 0, 3); - world.setBlock(x + 0, y + -21, z + 2, Block1, 0, 3); - world.setBlock(x + 1, y + -21, z + 2, Block1, 0, 3); - world.setBlock(x + 2, y + -21, z + 2, Block1, 0, 3); - world.setBlock(x + 3, y + -21, z + 2, Block1, 0, 3); - world.setBlock(x + 4, y + -21, z + 2, Block1, 0, 3); - world.setBlock(x + 5, y + -21, z + 2, Block1, 0, 3); - world.setBlock(x + 6, y + -21, z + 2, Block1, 0, 3); - world.setBlock(x + 7, y + -21, z + 2, Block1, 0, 3); - world.setBlock(x + 8, y + -21, z + 2, Block1, 0, 3); - world.setBlock(x + 9, y + -21, z + 2, Block1, 0, 3); - world.setBlock(x + 10, y + -21, z + 2, Block1, 0, 3); - world.setBlock(x + 11, y + -21, z + 2, Block1, 0, 3); - world.setBlock(x + 0, y + -21, z + 3, Block1, 0, 3); - world.setBlock(x + 1, y + -21, z + 3, Block1, 0, 3); - world.setBlock(x + 2, y + -21, z + 3, Block1, 0, 3); - world.setBlock(x + 3, y + -21, z + 3, Block1, 0, 3); - world.setBlock(x + 4, y + -21, z + 3, Block1, 0, 3); - world.setBlock(x + 5, y + -21, z + 3, Block1, 0, 3); - world.setBlock(x + 6, y + -21, z + 3, Block1, 0, 3); - world.setBlock(x + 7, y + -21, z + 3, Block1, 0, 3); - world.setBlock(x + 8, y + -21, z + 3, Block1, 0, 3); - world.setBlock(x + 9, y + -21, z + 3, Block1, 0, 3); - world.setBlock(x + 10, y + -21, z + 3, Block1, 0, 3); - world.setBlock(x + 11, y + -21, z + 3, Block1, 0, 3); - world.setBlock(x + 0, y + -21, z + 4, Block1, 0, 3); - world.setBlock(x + 1, y + -21, z + 4, Block1, 0, 3); - world.setBlock(x + 2, y + -21, z + 4, Block1, 0, 3); - world.setBlock(x + 3, y + -21, z + 4, Block1, 0, 3); - world.setBlock(x + 4, y + -21, z + 4, Block1, 0, 3); - world.setBlock(x + 5, y + -21, z + 4, Block1, 0, 3); - world.setBlock(x + 6, y + -21, z + 4, Block1, 0, 3); - world.setBlock(x + 7, y + -21, z + 4, Block1, 0, 3); - world.setBlock(x + 8, y + -21, z + 4, Block1, 0, 3); - world.setBlock(x + 9, y + -21, z + 4, Block1, 0, 3); - world.setBlock(x + 10, y + -21, z + 4, Block1, 0, 3); - world.setBlock(x + 11, y + -21, z + 4, Block1, 0, 3); - world.setBlock(x + 0, y + -21, z + 5, Block1, 0, 3); - world.setBlock(x + 1, y + -21, z + 5, Block1, 0, 3); - world.setBlock(x + 2, y + -21, z + 5, Block1, 0, 3); - world.setBlock(x + 3, y + -21, z + 5, Block1, 0, 3); - world.setBlock(x + 4, y + -21, z + 5, Block1, 0, 3); - world.setBlock(x + 5, y + -21, z + 5, Block1, 0, 3); - world.setBlock(x + 6, y + -21, z + 5, Block1, 0, 3); - world.setBlock(x + 7, y + -21, z + 5, Block1, 0, 3); - world.setBlock(x + 8, y + -21, z + 5, Block1, 0, 3); - world.setBlock(x + 9, y + -21, z + 5, Block1, 0, 3); - world.setBlock(x + 10, y + -21, z + 5, Block1, 0, 3); - world.setBlock(x + 11, y + -21, z + 5, Block1, 0, 3); - world.setBlock(x + 0, y + -21, z + 6, Block1, 0, 3); - world.setBlock(x + 1, y + -21, z + 6, Block1, 0, 3); - world.setBlock(x + 2, y + -21, z + 6, Block1, 0, 3); - world.setBlock(x + 3, y + -21, z + 6, Block1, 0, 3); - world.setBlock(x + 4, y + -21, z + 6, Block1, 0, 3); - world.setBlock(x + 5, y + -21, z + 6, Block1, 0, 3); - world.setBlock(x + 6, y + -21, z + 6, Block1, 0, 3); - world.setBlock(x + 7, y + -21, z + 6, Block1, 0, 3); - world.setBlock(x + 8, y + -21, z + 6, Block1, 0, 3); - world.setBlock(x + 9, y + -21, z + 6, Block1, 0, 3); - world.setBlock(x + 10, y + -21, z + 6, Block1, 0, 3); - world.setBlock(x + 11, y + -21, z + 6, Block1, 0, 3); - world.setBlock(x + 0, y + -21, z + 7, Block1, 0, 3); - world.setBlock(x + 1, y + -21, z + 7, Block1, 0, 3); - world.setBlock(x + 2, y + -21, z + 7, Block1, 0, 3); - world.setBlock(x + 3, y + -21, z + 7, Block1, 0, 3); - world.setBlock(x + 4, y + -21, z + 7, Block1, 0, 3); - world.setBlock(x + 5, y + -21, z + 7, Block1, 0, 3); - world.setBlock(x + 6, y + -21, z + 7, Block1, 0, 3); - world.setBlock(x + 7, y + -21, z + 7, Block1, 0, 3); - world.setBlock(x + 8, y + -21, z + 7, Block1, 0, 3); - world.setBlock(x + 9, y + -21, z + 7, Block1, 0, 3); - world.setBlock(x + 10, y + -21, z + 7, Block1, 0, 3); - world.setBlock(x + 11, y + -21, z + 7, Block1, 0, 3); - world.setBlock(x + 0, y + -21, z + 8, Block1, 0, 3); - world.setBlock(x + 1, y + -21, z + 8, Block1, 0, 3); - world.setBlock(x + 2, y + -21, z + 8, Block1, 0, 3); - world.setBlock(x + 3, y + -21, z + 8, Block1, 0, 3); - world.setBlock(x + 4, y + -21, z + 8, Block1, 0, 3); - world.setBlock(x + 5, y + -21, z + 8, Block1, 0, 3); - world.setBlock(x + 6, y + -21, z + 8, Block1, 0, 3); - world.setBlock(x + 7, y + -21, z + 8, Block1, 0, 3); - world.setBlock(x + 8, y + -21, z + 8, Block1, 0, 3); - world.setBlock(x + 9, y + -21, z + 8, Block1, 0, 3); - world.setBlock(x + 10, y + -21, z + 8, Block1, 0, 3); - world.setBlock(x + 11, y + -21, z + 8, Block1, 0, 3); - world.setBlock(x + 0, y + -21, z + 9, Block1, 0, 3); - world.setBlock(x + 1, y + -21, z + 9, Block1, 0, 3); - world.setBlock(x + 2, y + -21, z + 9, Block1, 0, 3); - world.setBlock(x + 3, y + -21, z + 9, Block1, 0, 3); - world.setBlock(x + 4, y + -21, z + 9, Block1, 0, 3); - world.setBlock(x + 5, y + -21, z + 9, Block1, 0, 3); - world.setBlock(x + 6, y + -21, z + 9, Block1, 0, 3); - world.setBlock(x + 7, y + -21, z + 9, Block1, 0, 3); - world.setBlock(x + 8, y + -21, z + 9, Block1, 0, 3); - world.setBlock(x + 9, y + -21, z + 9, Block1, 0, 3); - world.setBlock(x + 10, y + -21, z + 9, Block1, 0, 3); - world.setBlock(x + 11, y + -21, z + 9, Block1, 0, 3); - world.setBlock(x + 0, y + -21, z + 10, Block1, 0, 3); - world.setBlock(x + 1, y + -21, z + 10, Block1, 0, 3); - world.setBlock(x + 2, y + -21, z + 10, Block1, 0, 3); - world.setBlock(x + 3, y + -21, z + 10, Block1, 0, 3); - world.setBlock(x + 4, y + -21, z + 10, Block1, 0, 3); - world.setBlock(x + 5, y + -21, z + 10, Block1, 0, 3); - world.setBlock(x + 6, y + -21, z + 10, Block1, 0, 3); - world.setBlock(x + 7, y + -21, z + 10, Block1, 0, 3); - world.setBlock(x + 8, y + -21, z + 10, Block1, 0, 3); - world.setBlock(x + 9, y + -21, z + 10, Block1, 0, 3); - world.setBlock(x + 10, y + -21, z + 10, Block1, 0, 3); - world.setBlock(x + 11, y + -21, z + 10, Block1, 0, 3); - world.setBlock(x + 0, y + -21, z + 11, Block1, 0, 3); - world.setBlock(x + 1, y + -21, z + 11, Block1, 0, 3); - world.setBlock(x + 2, y + -21, z + 11, Block1, 0, 3); - world.setBlock(x + 3, y + -21, z + 11, Block1, 0, 3); - world.setBlock(x + 4, y + -21, z + 11, Block1, 0, 3); - world.setBlock(x + 5, y + -21, z + 11, Block1, 0, 3); - world.setBlock(x + 6, y + -21, z + 11, Block1, 0, 3); - world.setBlock(x + 7, y + -21, z + 11, Block1, 0, 3); - world.setBlock(x + 8, y + -21, z + 11, Block1, 0, 3); - world.setBlock(x + 9, y + -21, z + 11, Block1, 0, 3); - world.setBlock(x + 10, y + -21, z + 11, Block1, 0, 3); - world.setBlock(x + 11, y + -21, z + 11, Block1, 0, 3); - world.setBlock(x + 0, y + -21, z + 12, Block1, 0, 3); - world.setBlock(x + 1, y + -21, z + 12, Block1, 0, 3); - world.setBlock(x + 2, y + -21, z + 12, Block1, 0, 3); - world.setBlock(x + 3, y + -21, z + 12, Block1, 0, 3); - world.setBlock(x + 4, y + -21, z + 12, Block1, 0, 3); - world.setBlock(x + 5, y + -21, z + 12, Block1, 0, 3); - world.setBlock(x + 6, y + -21, z + 12, Block1, 0, 3); - world.setBlock(x + 7, y + -21, z + 12, Block1, 0, 3); - world.setBlock(x + 8, y + -21, z + 12, Block1, 0, 3); - world.setBlock(x + 9, y + -21, z + 12, Block1, 0, 3); - world.setBlock(x + 11, y + -21, z + 12, Block1, 0, 3); - world.setBlock(x + 0, y + -21, z + 13, Block1, 0, 3); - world.setBlock(x + 1, y + -21, z + 13, Block1, 0, 3); - world.setBlock(x + 2, y + -21, z + 13, Block1, 0, 3); - world.setBlock(x + 3, y + -21, z + 13, Block1, 0, 3); - world.setBlock(x + 4, y + -21, z + 13, Block1, 0, 3); - world.setBlock(x + 5, y + -21, z + 13, Block1, 0, 3); - world.setBlock(x + 6, y + -21, z + 13, Block1, 0, 3); - world.setBlock(x + 7, y + -21, z + 13, Block1, 0, 3); - world.setBlock(x + 8, y + -21, z + 13, Block1, 0, 3); - world.setBlock(x + 9, y + -21, z + 13, Block1, 0, 3); - world.setBlock(x + 11, y + -21, z + 13, Block1, 0, 3); - world.setBlock(x + 0, y + -21, z + 14, Block1, 0, 3); - world.setBlock(x + 1, y + -21, z + 14, Block1, 0, 3); - world.setBlock(x + 2, y + -21, z + 14, Block1, 0, 3); - world.setBlock(x + 3, y + -21, z + 14, Block1, 0, 3); - world.setBlock(x + 4, y + -21, z + 14, Block1, 0, 3); - world.setBlock(x + 5, y + -21, z + 14, Block1, 0, 3); - world.setBlock(x + 6, y + -21, z + 14, Block1, 0, 3); - world.setBlock(x + 7, y + -21, z + 14, Block1, 0, 3); - world.setBlock(x + 8, y + -21, z + 14, Block1, 0, 3); - world.setBlock(x + 9, y + -21, z + 14, Block1, 0, 3); - world.setBlock(x + 10, y + -21, z + 14, Block1, 0, 3); - world.setBlock(x + 11, y + -21, z + 14, Block1, 0, 3); - world.setBlock(x + 0, y + -20, z + 0, Block1, 0, 3); - world.setBlock(x + 1, y + -20, z + 0, Block1, 0, 3); - world.setBlock(x + 2, y + -20, z + 0, Block1, 0, 3); - world.setBlock(x + 3, y + -20, z + 0, Block1, 0, 3); - world.setBlock(x + 4, y + -20, z + 0, Block1, 0, 3); - world.setBlock(x + 5, y + -20, z + 0, Block1, 0, 3); - world.setBlock(x + 6, y + -20, z + 0, Block1, 0, 3); - world.setBlock(x + 7, y + -20, z + 0, Block1, 0, 3); - world.setBlock(x + 8, y + -20, z + 0, Block1, 0, 3); - world.setBlock(x + 9, y + -20, z + 0, Block1, 0, 3); - world.setBlock(x + 10, y + -20, z + 0, Block1, 0, 3); - world.setBlock(x + 11, y + -20, z + 0, Block1, 0, 3); - world.setBlock(x + 0, y + -20, z + 1, Block1, 0, 3); - world.setBlock(x + 3, y + -20, z + 1, Block1, 0, 3); - world.setBlock(x + 4, y + -20, z + 1, Blocks.chest, 5, 3); - world.setBlockMetadataWithNotify(x + 4, y + -20, z + 1, 5, 3); - if(world.getBlock(x + 4, y + -20, z + 1) == Blocks.chest) { - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.modGeneric, (TileEntityChest) world.getTileEntity(x + 4, y + -20, z + 1), 12); - } - world.setBlock(x + 8, y + -20, z + 1, Block4, 0, 3); - world.setBlock(x + 9, y + -20, z + 1, Block4, 0, 3); - world.setBlock(x + 10, y + -20, z + 1, Block4, 0, 3); - world.setBlock(x + 11, y + -20, z + 1, Block1, 0, 3); - world.setBlock(x + 0, y + -20, z + 2, Block1, 0, 3); - world.setBlock(x + 3, y + -20, z + 2, Block1, 0, 3); - world.setBlock(x + 8, y + -20, z + 2, Block4, 0, 3); - world.setBlock(x + 9, y + -20, z + 2, Block4, 0, 3); - world.setBlock(x + 10, y + -20, z + 2, Block4, 0, 3); - world.setBlock(x + 11, y + -20, z + 2, Block1, 0, 3); - world.setBlock(x + 0, y + -20, z + 3, Block1, 0, 3); - world.setBlock(x + 3, y + -20, z + 3, Block1, 0, 3); - world.setBlock(x + 8, y + -20, z + 3, Block4, 0, 3); - world.setBlock(x + 9, y + -20, z + 3, Block4, 0, 3); - world.setBlock(x + 10, y + -20, z + 3, Block4, 0, 3); - world.setBlock(x + 11, y + -20, z + 3, Block1, 0, 3); - world.setBlock(x + 0, y + -20, z + 4, Block1, 0, 3); - world.setBlock(x + 3, y + -20, z + 4, Block1, 0, 3); - world.setBlock(x + 4, y + -20, z + 4, Block1, 0, 3); - world.setBlock(x + 5, y + -20, z + 4, Blocks.iron_door, 3, 3); - ItemDoor.placeDoorBlock(world, x + 5, y + -20, z + 4, 3, Blocks.iron_door); - world.setBlock(x + 6, y + -20, z + 4, Block1, 0, 3); - world.setBlock(x + 7, y + -20, z + 4, Block1, 0, 3); - world.setBlock(x + 8, y + -20, z + 4, Block1, 0, 3); - world.setBlock(x + 9, y + -20, z + 4, Block1, 0, 3); - world.setBlock(x + 10, y + -20, z + 4, Block1, 0, 3); - world.setBlock(x + 11, y + -20, z + 4, Block1, 0, 3); - world.setBlock(x + 0, y + -20, z + 5, Block1, 0, 3); - world.setBlock(x + 3, y + -20, z + 5, Block1, 0, 3); - world.setBlock(x + 11, y + -20, z + 5, Block1, 0, 3); - world.setBlock(x + 0, y + -20, z + 6, Block1, 0, 3); - world.setBlock(x + 3, y + -20, z + 6, Blocks.iron_door, 0, 3); - ItemDoor.placeDoorBlock(world, x + 3, y + -20, z + 6, 0, Blocks.iron_door); - world.setBlock(x + 11, y + -20, z + 6, Block1, 0, 3); - world.setBlock(x + 0, y + -20, z + 7, Block1, 0, 3); - world.setBlock(x + 3, y + -20, z + 7, Block1, 0, 3); - world.setBlock(x + 8, y + -20, z + 7, Blocks.iron_door, 1, 3); - ItemDoor.placeDoorBlock(world, x + 8, y + -20, z + 7, 1, Blocks.iron_door); - world.setBlock(x + 10, y + -20, z + 7, Blocks.iron_door, 1, 3); - ItemDoor.placeDoorBlock(world, x + 10, y + -20, z + 7, 1, Blocks.iron_door); - world.setBlock(x + 11, y + -20, z + 7, Block1, 0, 3); - world.setBlock(x + 0, y + -20, z + 8, Block1, 0, 3); - world.setBlock(x + 3, y + -20, z + 8, Block1, 0, 3); - world.setBlock(x + 4, y + -20, z + 8, Blocks.iron_door, 3, 3); - ItemDoor.placeDoorBlock(world, x + 4, y + -20, z + 8, 3, Blocks.iron_door); - world.setBlock(x + 6, y + -20, z + 8, Blocks.iron_door, 3, 3); - ItemDoor.placeDoorBlock(world, x + 6, y + -20, z + 8, 3, Blocks.iron_door); - world.setBlock(x + 8, y + -20, z + 8, Blocks.iron_door, 3, 3); - ItemDoor.placeDoorBlock(world, x + 8, y + -20, z + 8, 3, Blocks.iron_door); - world.setBlock(x + 10, y + -20, z + 8, Blocks.iron_door, 3, 3); - ItemDoor.placeDoorBlock(world, x + 10, y + -20, z + 8, 3, Blocks.iron_door); - world.setBlock(x + 11, y + -20, z + 8, Block1, 0, 3); - world.setBlock(x + 0, y + -20, z + 9, Block1, 0, 3); - world.setBlock(x + 3, y + -20, z + 9, Block1, 0, 3); - world.setBlock(x + 11, y + -20, z + 9, Block1, 0, 3); - world.setBlock(x + 0, y + -20, z + 10, Block1, 0, 3); - world.setBlock(x + 3, y + -20, z + 10, Block1, 0, 3); - world.setBlock(x + 11, y + -20, z + 10, Block1, 0, 3); - world.setBlock(x + 0, y + -20, z + 11, Block1, 0, 3); - world.setBlock(x + 3, y + -20, z + 11, Block1, 0, 3); - world.setBlock(x + 4, y + -20, z + 11, Block1, 0, 3); - world.setBlock(x + 5, y + -20, z + 11, Block1, 0, 3); - world.setBlock(x + 6, y + -20, z + 11, Block1, 0, 3); - world.setBlock(x + 7, y + -20, z + 11, Block1, 0, 3); - world.setBlock(x + 8, y + -20, z + 11, Block1, 0, 3); - world.setBlock(x + 9, y + -20, z + 11, Block1, 0, 3); - world.setBlock(x + 10, y + -20, z + 11, Block1, 0, 3); - world.setBlock(x + 11, y + -20, z + 11, Block1, 0, 3); - world.setBlock(x + 0, y + -20, z + 12, Block1, 0, 3); - world.setBlock(x + 11, y + -20, z + 12, Block1, 0, 3); - world.setBlock(x + 0, y + -20, z + 13, Block1, 0, 3); - world.setBlock(x + 11, y + -20, z + 13, Block1, 0, 3); - world.setBlock(x + 0, y + -20, z + 14, Block1, 0, 3); - world.setBlock(x + 1, y + -20, z + 14, Block1, 0, 3); - world.setBlock(x + 2, y + -20, z + 14, Block1, 0, 3); - world.setBlock(x + 3, y + -20, z + 14, Block1, 0, 3); - world.setBlock(x + 4, y + -20, z + 14, Block1, 0, 3); - world.setBlock(x + 5, y + -20, z + 14, Block1, 0, 3); - world.setBlock(x + 6, y + -20, z + 14, Block1, 0, 3); - world.setBlock(x + 7, y + -20, z + 14, Block1, 0, 3); - world.setBlock(x + 8, y + -20, z + 14, Block1, 0, 3); - world.setBlock(x + 9, y + -20, z + 14, Block1, 0, 3); - world.setBlock(x + 10, y + -20, z + 14, Block1, 0, 3); - world.setBlock(x + 11, y + -20, z + 14, Block1, 0, 3); - world.setBlock(x + 0, y + -19, z + 0, Block1, 0, 3); - world.setBlock(x + 1, y + -19, z + 0, Block1, 0, 3); - world.setBlock(x + 2, y + -19, z + 0, Block1, 0, 3); - world.setBlock(x + 3, y + -19, z + 0, Block1, 0, 3); - world.setBlock(x + 4, y + -19, z + 0, Block1, 0, 3); - world.setBlock(x + 5, y + -19, z + 0, Block1, 0, 3); - world.setBlock(x + 6, y + -19, z + 0, Block3, 0, 3); - world.setBlock(x + 7, y + -19, z + 0, Block1, 0, 3); - world.setBlock(x + 8, y + -19, z + 0, Block1, 0, 3); - world.setBlock(x + 9, y + -19, z + 0, Block1, 0, 3); - world.setBlock(x + 10, y + -19, z + 0, Block1, 0, 3); - world.setBlock(x + 11, y + -19, z + 0, Block1, 0, 3); - world.setBlock(x + 0, y + -19, z + 1, Block1, 0, 3); - world.setBlock(x + 1, y + -19, z + 1, Blocks.web, 0, 3); - world.setBlock(x + 3, y + -19, z + 1, Block1, 0, 3); - world.setBlock(x + 8, y + -19, z + 1, Block4, 0, 3); - world.setBlock(x + 9, y + -19, z + 1, Block4, 0, 3); - world.setBlock(x + 10, y + -19, z + 1, Block4, 0, 3); - world.setBlock(x + 11, y + -19, z + 1, Block1, 0, 3); - world.setBlock(x + 0, y + -19, z + 2, Block1, 0, 3); - world.setBlock(x + 3, y + -19, z + 2, Block1, 0, 3); - world.setBlock(x + 7, y + -19, z + 2, Block5, 0, 3); - world.setBlock(x + 8, y + -19, z + 2, Block5, 0, 3); - world.setBlock(x + 9, y + -19, z + 2, Block5, 0, 3); - world.setBlock(x + 10, y + -19, z + 2, Block5, 0, 3); - world.setBlock(x + 11, y + -19, z + 2, Block1, 0, 3); - world.setBlock(x + 0, y + -19, z + 3, Block1, 0, 3); - world.setBlock(x + 3, y + -19, z + 3, Block1, 0, 3); - world.setBlock(x + 4, y + -19, z + 3, Blocks.web, 0, 3); - world.setBlock(x + 8, y + -19, z + 3, Block4, 0, 3); - world.setBlock(x + 9, y + -19, z + 3, Block4, 0, 3); - world.setBlock(x + 10, y + -19, z + 3, Block4, 0, 3); - world.setBlock(x + 11, y + -19, z + 3, Block1, 0, 3); - world.setBlock(x + 0, y + -19, z + 4, Block1, 0, 3); - world.setBlock(x + 3, y + -19, z + 4, Block1, 0, 3); - world.setBlock(x + 4, y + -19, z + 4, Block1, 0, 3); - // world.setBlock(x + 5, y + -19, z + 4, Blocks.iron_door, 8, 3); - world.setBlock(x + 6, y + -19, z + 4, Block1, 0, 3); - world.setBlock(x + 7, y + -19, z + 4, Block1, 0, 3); - world.setBlock(x + 8, y + -19, z + 4, Block1, 0, 3); - world.setBlock(x + 9, y + -19, z + 4, Block3, 0, 3); - world.setBlock(x + 10, y + -19, z + 4, Block1, 0, 3); - world.setBlock(x + 11, y + -19, z + 4, Block1, 0, 3); - world.setBlock(x + 0, y + -19, z + 5, Block1, 0, 3); - world.setBlock(x + 3, y + -19, z + 5, Block1, 0, 3); - world.setBlock(x + 11, y + -19, z + 5, Block1, 0, 3); - world.setBlock(x + 0, y + -19, z + 6, Block1, 0, 3); - // world.setBlock(x + 3, y + -19, z + 6, Blocks.iron_door, 8, 3); - world.setBlock(x + 11, y + -19, z + 6, Block1, 0, 3); - world.setBlock(x + 0, y + -19, z + 7, Block1, 0, 3); - world.setBlock(x + 3, y + -19, z + 7, Block3, 0, 3); - // world.setBlock(x + 8, y + -19, z + 7, Blocks.iron_door, 8, 3); - // world.setBlock(x + 10, y + -19, z + 7, Blocks.iron_door, 8, 3); - world.setBlock(x + 11, y + -19, z + 7, Block1, 0, 3); - world.setBlock(x + 0, y + -19, z + 8, Block1, 0, 3); - world.setBlock(x + 3, y + -19, z + 8, Block1, 0, 3); - // world.setBlock(x + 4, y + -19, z + 8, Blocks.iron_door, 8, 3); - // world.setBlock(x + 6, y + -19, z + 8, Blocks.iron_door, 8, 3); - // world.setBlock(x + 8, y + -19, z + 8, Blocks.iron_door, 8, 3); - // world.setBlock(x + 10, y + -19, z + 8, Blocks.iron_door, 9, 3); - world.setBlock(x + 11, y + -19, z + 8, Block1, 0, 3); - world.setBlock(x + 0, y + -19, z + 9, Block1, 0, 3); - world.setBlock(x + 3, y + -19, z + 9, Block1, 0, 3); - world.setBlock(x + 11, y + -19, z + 9, Block1, 0, 3); - world.setBlock(x + 0, y + -19, z + 10, Block1, 0, 3); - world.setBlock(x + 3, y + -19, z + 10, Block1, 0, 3); - world.setBlock(x + 11, y + -19, z + 10, Block1, 0, 3); - world.setBlock(x + 0, y + -19, z + 11, Block1, 0, 3); - world.setBlock(x + 3, y + -19, z + 11, Block1, 0, 3); - world.setBlock(x + 4, y + -19, z + 11, Block1, 0, 3); - world.setBlock(x + 5, y + -19, z + 11, Block3, 0, 3); - world.setBlock(x + 6, y + -19, z + 11, Block1, 0, 3); - world.setBlock(x + 7, y + -19, z + 11, Block1, 0, 3); - world.setBlock(x + 8, y + -19, z + 11, Block1, 0, 3); - world.setBlock(x + 9, y + -19, z + 11, Block3, 0, 3); - world.setBlock(x + 10, y + -19, z + 11, Block1, 0, 3); - world.setBlock(x + 11, y + -19, z + 11, Block1, 0, 3); - world.setBlock(x + 0, y + -19, z + 12, Block1, 0, 3); - world.setBlock(x + 11, y + -19, z + 12, Block1, 0, 3); - world.setBlock(x + 0, y + -19, z + 13, Block1, 0, 3); - world.setBlock(x + 1, y + -19, z + 13, Blocks.web, 0, 3); - world.setBlock(x + 11, y + -19, z + 13, Block1, 0, 3); - world.setBlock(x + 0, y + -19, z + 14, Block1, 0, 3); - world.setBlock(x + 1, y + -19, z + 14, Block1, 0, 3); - world.setBlock(x + 2, y + -19, z + 14, Block1, 0, 3); - world.setBlock(x + 3, y + -19, z + 14, Block1, 0, 3); - world.setBlock(x + 4, y + -19, z + 14, Block1, 0, 3); - world.setBlock(x + 5, y + -19, z + 14, Block1, 0, 3); - world.setBlock(x + 6, y + -19, z + 14, Block1, 0, 3); - world.setBlock(x + 7, y + -19, z + 14, Block1, 0, 3); - world.setBlock(x + 8, y + -19, z + 14, Block1, 0, 3); - world.setBlock(x + 9, y + -19, z + 14, Block1, 0, 3); - world.setBlock(x + 10, y + -19, z + 14, Block1, 0, 3); - world.setBlock(x + 11, y + -19, z + 14, Block1, 0, 3); - world.setBlock(x + 0, y + -18, z + 0, Block1, 0, 3); - world.setBlock(x + 1, y + -18, z + 0, Block1, 0, 3); - world.setBlock(x + 2, y + -18, z + 0, Block1, 0, 3); - world.setBlock(x + 3, y + -18, z + 0, Block1, 0, 3); - world.setBlock(x + 4, y + -18, z + 0, Block1, 0, 3); - world.setBlock(x + 5, y + -18, z + 0, Block1, 0, 3); - world.setBlock(x + 6, y + -18, z + 0, Block1, 0, 3); - world.setBlock(x + 7, y + -18, z + 0, Block1, 0, 3); - world.setBlock(x + 8, y + -18, z + 0, Block1, 0, 3); - world.setBlock(x + 9, y + -18, z + 0, Block1, 0, 3); - world.setBlock(x + 10, y + -18, z + 0, Block1, 0, 3); - world.setBlock(x + 11, y + -18, z + 0, Block1, 0, 3); - world.setBlock(x + 0, y + -18, z + 1, Block1, 0, 3); - world.setBlock(x + 1, y + -18, z + 1, Blocks.web, 0, 3); - world.setBlock(x + 2, y + -18, z + 1, Blocks.web, 0, 3); - world.setBlock(x + 3, y + -18, z + 1, Block1, 0, 3); - world.setBlock(x + 9, y + -18, z + 1, Blocks.web, 0, 3); - world.setBlock(x + 10, y + -18, z + 1, Blocks.web, 0, 3); - world.setBlock(x + 11, y + -18, z + 1, Block1, 0, 3); - world.setBlock(x + 0, y + -18, z + 2, Block1, 0, 3); - world.setBlock(x + 3, y + -18, z + 2, Block1, 0, 3); - world.setBlock(x + 4, y + -18, z + 2, Blocks.web, 0, 3); - world.setBlock(x + 8, y + -18, z + 2, Block4, 0, 3); - world.setBlock(x + 9, y + -18, z + 2, Block4, 0, 3); - world.setBlock(x + 10, y + -18, z + 2, Block4, 0, 3); - world.setBlock(x + 11, y + -18, z + 2, Block1, 0, 3); - world.setBlock(x + 0, y + -18, z + 3, Block1, 0, 3); - world.setBlock(x + 3, y + -18, z + 3, Block1, 0, 3); - world.setBlock(x + 5, y + -18, z + 3, Blocks.web, 0, 3); - world.setBlock(x + 8, y + -18, z + 3, Blocks.web, 0, 3); - world.setBlock(x + 9, y + -18, z + 3, Blocks.web, 0, 3); - world.setBlock(x + 10, y + -18, z + 3, Blocks.web, 0, 3); - world.setBlock(x + 11, y + -18, z + 3, Block1, 0, 3); - world.setBlock(x + 0, y + -18, z + 4, Block1, 0, 3); - world.setBlock(x + 3, y + -18, z + 4, Block1, 0, 3); - world.setBlock(x + 4, y + -18, z + 4, Block1, 0, 3); - world.setBlock(x + 5, y + -18, z + 4, Block1, 0, 3); - world.setBlock(x + 6, y + -18, z + 4, Block1, 0, 3); - world.setBlock(x + 7, y + -18, z + 4, Block1, 0, 3); - world.setBlock(x + 8, y + -18, z + 4, Block1, 0, 3); - world.setBlock(x + 9, y + -18, z + 4, Block1, 0, 3); - world.setBlock(x + 10, y + -18, z + 4, Block1, 0, 3); - world.setBlock(x + 11, y + -18, z + 4, Block1, 0, 3); - world.setBlock(x + 0, y + -18, z + 5, Block1, 0, 3); - world.setBlock(x + 3, y + -18, z + 5, Block1, 0, 3); - world.setBlock(x + 4, y + -18, z + 5, Blocks.web, 0, 3); - world.setBlock(x + 9, y + -18, z + 5, Blocks.web, 0, 3); - world.setBlock(x + 10, y + -18, z + 5, Blocks.web, 0, 3); - world.setBlock(x + 11, y + -18, z + 5, Block1, 0, 3); - world.setBlock(x + 0, y + -18, z + 6, Block1, 0, 3); - world.setBlock(x + 3, y + -18, z + 6, Block1, 0, 3); - world.setBlock(x + 10, y + -18, z + 6, Blocks.web, 0, 3); - world.setBlock(x + 11, y + -18, z + 6, Block1, 0, 3); - world.setBlock(x + 0, y + -18, z + 7, Block1, 0, 3); - world.setBlock(x + 2, y + -18, z + 7, Blocks.web, 0, 3); - world.setBlock(x + 3, y + -18, z + 7, Block1, 0, 3); - world.setBlock(x + 11, y + -18, z + 7, Block1, 0, 3); - world.setBlock(x + 0, y + -18, z + 8, Block1, 0, 3); - world.setBlock(x + 1, y + -18, z + 8, Blocks.web, 0, 3); - world.setBlock(x + 3, y + -18, z + 8, Block1, 0, 3); - world.setBlock(x + 11, y + -18, z + 8, Block1, 0, 3); - world.setBlock(x + 0, y + -18, z + 9, Block1, 0, 3); - world.setBlock(x + 2, y + -18, z + 9, Blocks.web, 0, 3); - world.setBlock(x + 3, y + -18, z + 9, Block1, 0, 3); - world.setBlock(x + 4, y + -18, z + 9, Blocks.web, 0, 3); - world.setBlock(x + 11, y + -18, z + 9, Block1, 0, 3); - world.setBlock(x + 0, y + -18, z + 10, Block1, 0, 3); - world.setBlock(x + 3, y + -18, z + 10, Block1, 0, 3); - world.setBlock(x + 5, y + -18, z + 10, Blocks.web, 0, 3); - world.setBlock(x + 8, y + -18, z + 10, Blocks.web, 0, 3); - world.setBlock(x + 9, y + -18, z + 10, Blocks.web, 0, 3); - world.setBlock(x + 11, y + -18, z + 10, Block1, 0, 3); - world.setBlock(x + 0, y + -18, z + 11, Block1, 0, 3); - world.setBlock(x + 3, y + -18, z + 11, Block1, 0, 3); - world.setBlock(x + 4, y + -18, z + 11, Block1, 0, 3); - world.setBlock(x + 5, y + -18, z + 11, Block1, 0, 3); - world.setBlock(x + 6, y + -18, z + 11, Block1, 0, 3); - world.setBlock(x + 7, y + -18, z + 11, Block1, 0, 3); - world.setBlock(x + 8, y + -18, z + 11, Block1, 0, 3); - world.setBlock(x + 9, y + -18, z + 11, Block1, 0, 3); - world.setBlock(x + 10, y + -18, z + 11, Block1, 0, 3); - world.setBlock(x + 11, y + -18, z + 11, Block1, 0, 3); - world.setBlock(x + 0, y + -18, z + 12, Block1, 0, 3); - world.setBlock(x + 1, y + -18, z + 12, Blocks.web, 0, 3); - world.setBlock(x + 7, y + -18, z + 12, Blocks.web, 0, 3); - world.setBlock(x + 8, y + -18, z + 12, Blocks.web, 0, 3); - world.setBlock(x + 10, y + -18, z + 12, Blocks.web, 0, 3); - world.setBlock(x + 11, y + -18, z + 12, Block1, 0, 3); - world.setBlock(x + 0, y + -18, z + 13, Block1, 0, 3); - world.setBlock(x + 2, y + -18, z + 13, Blocks.web, 0, 3); - world.setBlock(x + 11, y + -18, z + 13, Block1, 0, 3); - world.setBlock(x + 0, y + -18, z + 14, Block1, 0, 3); - world.setBlock(x + 1, y + -18, z + 14, Block1, 0, 3); - world.setBlock(x + 2, y + -18, z + 14, Block1, 0, 3); - world.setBlock(x + 3, y + -18, z + 14, Block1, 0, 3); - world.setBlock(x + 4, y + -18, z + 14, Block1, 0, 3); - world.setBlock(x + 5, y + -18, z + 14, Block1, 0, 3); - world.setBlock(x + 6, y + -18, z + 14, Block1, 0, 3); - world.setBlock(x + 7, y + -18, z + 14, Block1, 0, 3); - world.setBlock(x + 8, y + -18, z + 14, Block1, 0, 3); - world.setBlock(x + 9, y + -18, z + 14, Block1, 0, 3); - world.setBlock(x + 10, y + -18, z + 14, Block1, 0, 3); - world.setBlock(x + 11, y + -18, z + 14, Block1, 0, 3); - world.setBlock(x + 0, y + -17, z + 0, Block1, 0, 3); - world.setBlock(x + 1, y + -17, z + 0, Block1, 0, 3); - world.setBlock(x + 2, y + -17, z + 0, Block1, 0, 3); - world.setBlock(x + 3, y + -17, z + 0, Block1, 0, 3); - world.setBlock(x + 4, y + -17, z + 0, Block1, 0, 3); - world.setBlock(x + 5, y + -17, z + 0, Block1, 0, 3); - world.setBlock(x + 6, y + -17, z + 0, Block1, 0, 3); - world.setBlock(x + 7, y + -17, z + 0, Block1, 0, 3); - world.setBlock(x + 8, y + -17, z + 0, Block1, 0, 3); - world.setBlock(x + 9, y + -17, z + 0, Block1, 0, 3); - world.setBlock(x + 10, y + -17, z + 0, Block1, 0, 3); - world.setBlock(x + 11, y + -17, z + 0, Block1, 0, 3); - world.setBlock(x + 0, y + -17, z + 1, Block1, 0, 3); - world.setBlock(x + 1, y + -17, z + 1, Block1, 0, 3); - world.setBlock(x + 2, y + -17, z + 1, Block1, 0, 3); - world.setBlock(x + 3, y + -17, z + 1, Block1, 0, 3); - world.setBlock(x + 4, y + -17, z + 1, Block1, 0, 3); - world.setBlock(x + 5, y + -17, z + 1, Block1, 0, 3); - world.setBlock(x + 6, y + -17, z + 1, Block1, 0, 3); - world.setBlock(x + 7, y + -17, z + 1, Block1, 0, 3); - world.setBlock(x + 8, y + -17, z + 1, Block1, 0, 3); - world.setBlock(x + 9, y + -17, z + 1, Block1, 0, 3); - world.setBlock(x + 10, y + -17, z + 1, Block1, 0, 3); - world.setBlock(x + 11, y + -17, z + 1, Block1, 0, 3); - world.setBlock(x + 0, y + -17, z + 2, Block1, 0, 3); - world.setBlock(x + 1, y + -17, z + 2, Block1, 0, 3); - world.setBlock(x + 3, y + -17, z + 2, Block1, 0, 3); - world.setBlock(x + 4, y + -17, z + 2, Block1, 0, 3); - world.setBlock(x + 5, y + -17, z + 2, Block1, 0, 3); - world.setBlock(x + 6, y + -17, z + 2, Block1, 0, 3); - world.setBlock(x + 7, y + -17, z + 2, Block1, 0, 3); - world.setBlock(x + 8, y + -17, z + 2, Block1, 0, 3); - world.setBlock(x + 9, y + -17, z + 2, Block1, 0, 3); - world.setBlock(x + 10, y + -17, z + 2, Block1, 0, 3); - world.setBlock(x + 11, y + -17, z + 2, Block1, 0, 3); - world.setBlock(x + 0, y + -17, z + 3, Block1, 0, 3); - world.setBlock(x + 1, y + -17, z + 3, Block1, 0, 3); - world.setBlock(x + 2, y + -17, z + 3, Block1, 0, 3); - world.setBlock(x + 3, y + -17, z + 3, Block1, 0, 3); - world.setBlock(x + 4, y + -17, z + 3, Block1, 0, 3); - world.setBlock(x + 5, y + -17, z + 3, Block1, 0, 3); - world.setBlock(x + 6, y + -17, z + 3, Block1, 0, 3); - world.setBlock(x + 7, y + -17, z + 3, Block1, 0, 3); - world.setBlock(x + 8, y + -17, z + 3, Block1, 0, 3); - world.setBlock(x + 9, y + -17, z + 3, Block1, 0, 3); - world.setBlock(x + 10, y + -17, z + 3, Block1, 0, 3); - world.setBlock(x + 11, y + -17, z + 3, Block1, 0, 3); - world.setBlock(x + 0, y + -17, z + 4, Block1, 0, 3); - world.setBlock(x + 1, y + -17, z + 4, Block1, 0, 3); - world.setBlock(x + 2, y + -17, z + 4, Block1, 0, 3); - world.setBlock(x + 3, y + -17, z + 4, Block1, 0, 3); - world.setBlock(x + 4, y + -17, z + 4, Block1, 0, 3); - world.setBlock(x + 5, y + -17, z + 4, Block1, 0, 3); - world.setBlock(x + 6, y + -17, z + 4, Block1, 0, 3); - world.setBlock(x + 7, y + -17, z + 4, Block1, 0, 3); - world.setBlock(x + 8, y + -17, z + 4, Block1, 0, 3); - world.setBlock(x + 9, y + -17, z + 4, Block1, 0, 3); - world.setBlock(x + 10, y + -17, z + 4, Block1, 0, 3); - world.setBlock(x + 11, y + -17, z + 4, Block1, 0, 3); - world.setBlock(x + 0, y + -17, z + 5, Block1, 0, 3); - world.setBlock(x + 1, y + -17, z + 5, Block1, 0, 3); - world.setBlock(x + 2, y + -17, z + 5, Block1, 0, 3); - world.setBlock(x + 3, y + -17, z + 5, Block1, 0, 3); - world.setBlock(x + 4, y + -17, z + 5, Block1, 0, 3); - world.setBlock(x + 5, y + -17, z + 5, Block1, 0, 3); - world.setBlock(x + 6, y + -17, z + 5, Block1, 0, 3); - world.setBlock(x + 7, y + -17, z + 5, Block1, 0, 3); - world.setBlock(x + 8, y + -17, z + 5, Block1, 0, 3); - world.setBlock(x + 9, y + -17, z + 5, Block1, 0, 3); - world.setBlock(x + 10, y + -17, z + 5, Block1, 0, 3); - world.setBlock(x + 11, y + -17, z + 5, Block1, 0, 3); - world.setBlock(x + 0, y + -17, z + 6, Block1, 0, 3); - world.setBlock(x + 1, y + -17, z + 6, Block1, 0, 3); - world.setBlock(x + 2, y + -17, z + 6, Block1, 0, 3); - world.setBlock(x + 3, y + -17, z + 6, Block1, 0, 3); - world.setBlock(x + 4, y + -17, z + 6, Block1, 0, 3); - world.setBlock(x + 5, y + -17, z + 6, Block1, 0, 3); - world.setBlock(x + 6, y + -17, z + 6, Block1, 0, 3); - world.setBlock(x + 7, y + -17, z + 6, Block1, 0, 3); - world.setBlock(x + 8, y + -17, z + 6, Block1, 0, 3); - world.setBlock(x + 9, y + -17, z + 6, Block1, 0, 3); - world.setBlock(x + 10, y + -17, z + 6, Block1, 0, 3); - world.setBlock(x + 11, y + -17, z + 6, Block1, 0, 3); - world.setBlock(x + 0, y + -17, z + 7, Block1, 0, 3); - world.setBlock(x + 1, y + -17, z + 7, Block1, 0, 3); - world.setBlock(x + 2, y + -17, z + 7, Block1, 0, 3); - world.setBlock(x + 3, y + -17, z + 7, Block1, 0, 3); - world.setBlock(x + 4, y + -17, z + 7, Block1, 0, 3); - world.setBlock(x + 5, y + -17, z + 7, Block1, 0, 3); - world.setBlock(x + 6, y + -17, z + 7, Block1, 0, 3); - world.setBlock(x + 7, y + -17, z + 7, Block1, 0, 3); - world.setBlock(x + 8, y + -17, z + 7, Block1, 0, 3); - world.setBlock(x + 9, y + -17, z + 7, Block1, 0, 3); - world.setBlock(x + 10, y + -17, z + 7, Block1, 0, 3); - world.setBlock(x + 11, y + -17, z + 7, Block1, 0, 3); - world.setBlock(x + 0, y + -17, z + 8, Block1, 0, 3); - world.setBlock(x + 1, y + -17, z + 8, Block1, 0, 3); - world.setBlock(x + 2, y + -17, z + 8, Block1, 0, 3); - world.setBlock(x + 3, y + -17, z + 8, Block1, 0, 3); - world.setBlock(x + 4, y + -17, z + 8, Block1, 0, 3); - world.setBlock(x + 5, y + -17, z + 8, Block1, 0, 3); - world.setBlock(x + 6, y + -17, z + 8, Block1, 0, 3); - world.setBlock(x + 7, y + -17, z + 8, Block1, 0, 3); - world.setBlock(x + 8, y + -17, z + 8, Block1, 0, 3); - world.setBlock(x + 9, y + -17, z + 8, Block1, 0, 3); - world.setBlock(x + 10, y + -17, z + 8, Block1, 0, 3); - world.setBlock(x + 11, y + -17, z + 8, Block1, 0, 3); - world.setBlock(x + 0, y + -17, z + 9, Block1, 0, 3); - world.setBlock(x + 1, y + -17, z + 9, Block1, 0, 3); - world.setBlock(x + 2, y + -17, z + 9, Block1, 0, 3); - world.setBlock(x + 3, y + -17, z + 9, Block1, 0, 3); - world.setBlock(x + 4, y + -17, z + 9, Block1, 0, 3); - world.setBlock(x + 5, y + -17, z + 9, Block1, 0, 3); - world.setBlock(x + 6, y + -17, z + 9, Block1, 0, 3); - world.setBlock(x + 7, y + -17, z + 9, Block1, 0, 3); - world.setBlock(x + 8, y + -17, z + 9, Block1, 0, 3); - world.setBlock(x + 9, y + -17, z + 9, Block1, 0, 3); - world.setBlock(x + 10, y + -17, z + 9, Block1, 0, 3); - world.setBlock(x + 11, y + -17, z + 9, Block1, 0, 3); - world.setBlock(x + 0, y + -17, z + 10, Block1, 0, 3); - world.setBlock(x + 1, y + -17, z + 10, Block1, 0, 3); - world.setBlock(x + 2, y + -17, z + 10, Block1, 0, 3); - world.setBlock(x + 3, y + -17, z + 10, Block1, 0, 3); - world.setBlock(x + 4, y + -17, z + 10, Block1, 0, 3); - world.setBlock(x + 5, y + -17, z + 10, Block1, 0, 3); - world.setBlock(x + 6, y + -17, z + 10, Block1, 0, 3); - world.setBlock(x + 7, y + -17, z + 10, Block1, 0, 3); - world.setBlock(x + 8, y + -17, z + 10, Block1, 0, 3); - world.setBlock(x + 9, y + -17, z + 10, Block1, 0, 3); - world.setBlock(x + 10, y + -17, z + 10, Block1, 0, 3); - world.setBlock(x + 11, y + -17, z + 10, Block1, 0, 3); - world.setBlock(x + 0, y + -17, z + 11, Block1, 0, 3); - world.setBlock(x + 1, y + -17, z + 11, Block1, 0, 3); - world.setBlock(x + 2, y + -17, z + 11, Block1, 0, 3); - world.setBlock(x + 3, y + -17, z + 11, Block1, 0, 3); - world.setBlock(x + 4, y + -17, z + 11, Block1, 0, 3); - world.setBlock(x + 5, y + -17, z + 11, Block1, 0, 3); - world.setBlock(x + 6, y + -17, z + 11, Block1, 0, 3); - world.setBlock(x + 7, y + -17, z + 11, Block1, 0, 3); - world.setBlock(x + 8, y + -17, z + 11, Block1, 0, 3); - world.setBlock(x + 9, y + -17, z + 11, Block1, 0, 3); - world.setBlock(x + 10, y + -17, z + 11, Block1, 0, 3); - world.setBlock(x + 11, y + -17, z + 11, Block1, 0, 3); - world.setBlock(x + 0, y + -17, z + 12, Block1, 0, 3); - world.setBlock(x + 1, y + -17, z + 12, Block1, 0, 3); - world.setBlock(x + 2, y + -17, z + 12, Block1, 0, 3); - world.setBlock(x + 3, y + -17, z + 12, Block1, 0, 3); - world.setBlock(x + 4, y + -17, z + 12, Block1, 0, 3); - world.setBlock(x + 5, y + -17, z + 12, Block1, 0, 3); - world.setBlock(x + 6, y + -17, z + 12, Block1, 0, 3); - world.setBlock(x + 7, y + -17, z + 12, Block1, 0, 3); - world.setBlock(x + 8, y + -17, z + 12, Block1, 0, 3); - world.setBlock(x + 9, y + -17, z + 12, Block1, 0, 3); - world.setBlock(x + 10, y + -17, z + 12, Block1, 0, 3); - world.setBlock(x + 11, y + -17, z + 12, Block1, 0, 3); - world.setBlock(x + 0, y + -17, z + 13, Block1, 0, 3); - world.setBlock(x + 1, y + -17, z + 13, Block1, 0, 3); - world.setBlock(x + 2, y + -17, z + 13, Block1, 0, 3); - world.setBlock(x + 3, y + -17, z + 13, Block1, 0, 3); - world.setBlock(x + 4, y + -17, z + 13, Block1, 0, 3); - world.setBlock(x + 5, y + -17, z + 13, Block1, 0, 3); - world.setBlock(x + 6, y + -17, z + 13, Block1, 0, 3); - world.setBlock(x + 7, y + -17, z + 13, Block1, 0, 3); - world.setBlock(x + 8, y + -17, z + 13, Block1, 0, 3); - world.setBlock(x + 9, y + -17, z + 13, Block1, 0, 3); - world.setBlock(x + 10, y + -17, z + 13, Block1, 0, 3); - world.setBlock(x + 11, y + -17, z + 13, Block1, 0, 3); - world.setBlock(x + 0, y + -17, z + 14, Block1, 0, 3); - world.setBlock(x + 1, y + -17, z + 14, Block1, 0, 3); - world.setBlock(x + 2, y + -17, z + 14, Block1, 0, 3); - world.setBlock(x + 3, y + -17, z + 14, Block1, 0, 3); - world.setBlock(x + 4, y + -17, z + 14, Block1, 0, 3); - world.setBlock(x + 5, y + -17, z + 14, Block1, 0, 3); - world.setBlock(x + 6, y + -17, z + 14, Block1, 0, 3); - world.setBlock(x + 7, y + -17, z + 14, Block1, 0, 3); - world.setBlock(x + 8, y + -17, z + 14, Block1, 0, 3); - world.setBlock(x + 9, y + -17, z + 14, Block1, 0, 3); - world.setBlock(x + 10, y + -17, z + 14, Block1, 0, 3); - world.setBlock(x + 11, y + -17, z + 14, Block1, 0, 3); - world.setBlock(x + 1, y + -16, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + -16, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -16, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -16, z + 2, Block3, 0, 3); - world.setBlock(x + 3, y + -16, z + 2, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -16, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + -16, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -16, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -15, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + -15, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -15, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -15, z + 2, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -15, z + 2, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -15, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + -15, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -15, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -14, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + -14, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -14, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -14, z + 2, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -14, z + 2, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -14, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + -14, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -14, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -13, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + -13, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -13, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -13, z + 2, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -13, z + 2, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -13, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + -13, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -13, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -12, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + -12, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -12, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -12, z + 2, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -12, z + 2, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -12, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + -12, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -12, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -11, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + -11, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -11, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -11, z + 2, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -11, z + 2, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -11, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + -11, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -11, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -10, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + -10, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -10, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -10, z + 2, Block3, 0, 3); - world.setBlock(x + 3, y + -10, z + 2, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -10, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + -10, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -10, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -9, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + -9, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -9, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -9, z + 2, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -9, z + 2, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -9, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + -9, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -9, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -8, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + -8, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -8, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -8, z + 2, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -8, z + 2, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -8, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + -8, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -8, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -7, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + -7, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -7, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -7, z + 2, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -7, z + 2, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -7, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + -7, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -7, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -6, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + -6, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -6, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -6, z + 2, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -6, z + 2, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -6, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + -6, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -6, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -5, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + -5, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -5, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -5, z + 2, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -5, z + 2, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -5, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + -5, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -5, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -4, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + -4, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -4, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -4, z + 2, Block3, 0, 3); - world.setBlock(x + 3, y + -4, z + 2, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -4, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + -4, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -4, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 0, y + -3, z + 0, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -3, z + 0, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + -3, z + 0, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -3, z + 0, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 4, y + -3, z + 0, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 0, y + -3, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -3, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + -3, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -3, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 4, y + -3, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 0, y + -3, z + 2, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -3, z + 2, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -3, z + 2, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 4, y + -3, z + 2, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 0, y + -3, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -3, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + -3, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -3, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 4, y + -3, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 0, y + -3, z + 4, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -3, z + 4, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + -3, z + 4, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -3, z + 4, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 4, y + -3, z + 4, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -3, z + 5, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + -3, z + 5, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -3, z + 5, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 0, y + -2, z + 0, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -2, z + 0, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + -2, z + 0, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -2, z + 0, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 4, y + -2, z + 0, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 0, y + -2, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -2, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + -2, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -2, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 4, y + -2, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 0, y + -2, z + 2, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -2, z + 2, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -2, z + 2, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 4, y + -2, z + 2, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 0, y + -2, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -2, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + -2, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -2, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 4, y + -2, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 0, y + -2, z + 4, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -2, z + 4, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + -2, z + 4, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -2, z + 4, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 4, y + -2, z + 4, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -2, z + 5, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + -2, z + 5, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -2, z + 5, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 0, y + -1, z + 0, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -1, z + 0, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + -1, z + 0, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -1, z + 0, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 4, y + -1, z + 0, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 0, y + -1, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -1, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + -1, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -1, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 4, y + -1, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 0, y + -1, z + 2, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -1, z + 2, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -1, z + 2, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 4, y + -1, z + 2, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 0, y + -1, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -1, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + -1, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -1, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 4, y + -1, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 0, y + -1, z + 4, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -1, z + 4, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + -1, z + 4, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -1, z + 4, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 4, y + -1, z + 4, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + -1, z + 5, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + -1, z + 5, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + -1, z + 5, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 0, y + 0, z + 0, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + 0, z + 0, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + 0, z + 0, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + 0, z + 0, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 4, y + 0, z + 0, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 0, y + 0, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 4, y + 0, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 0, y + 0, z + 2, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + 0, z + 2, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 4, y + 0, z + 2, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 0, y + 0, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 4, y + 0, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 0, y + 0, z + 4, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 4, y + 0, z + 4, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + 0, z + 5, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + 0, z + 5, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + 0, z + 5, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 0, y + 1, z + 0, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + 1, z + 0, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + 1, z + 0, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + 1, z + 0, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 4, y + 1, z + 0, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 0, y + 1, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 4, y + 1, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 0, y + 1, z + 2, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 4, y + 1, z + 2, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 0, y + 1, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 4, y + 1, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 0, y + 1, z + 4, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 4, y + 1, z + 4, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 0, y + 2, z + 0, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + 2, z + 0, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + 2, z + 0, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + 2, z + 0, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 4, y + 2, z + 0, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 0, y + 2, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + 2, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + 2, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 4, y + 2, z + 1, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 0, y + 2, z + 2, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + 2, z + 2, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + 2, z + 2, Block3, 0, 3); - world.setBlock(x + 3, y + 2, z + 2, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 4, y + 2, z + 2, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 0, y + 2, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + 2, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + 2, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + 2, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 4, y + 2, z + 3, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 0, y + 2, z + 4, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + 2, z + 4, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + 2, z + 4, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + 2, z + 4, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 4, y + 2, z + 4, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + 2, z + 5, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + 2, z + 5, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + 2, z + 5, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 1, y + 3, z + 0, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + 3, z + 0, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 3, y + 3, z + 0, Library.getRandomConcrete(), 0, 3); - world.setBlock(x + 2, y + 3, z + 1, Blocks.trapdoor, 1, 3); - - generate_r02_last(world, rand, x, y, z); - return true; - - } - - public boolean generate_r02_last(World world, Random rand, int x, int y, int z) { - - world.setBlock(x + 10, y + -24, z + 12, Blocks.ladder, 4, 3); - world.setBlock(x + 10, y + -24, z + 13, Blocks.ladder, 4, 3); - world.setBlock(x + 8, y + -23, z + 2, Blocks.lever, 12, 3); - world.setBlock(x + 10, y + -23, z + 4, Blocks.lever, 10, 3); - world.setBlock(x + 10, y + -23, z + 6, Blocks.lever, 10, 3); - world.setBlock(x + 10, y + -23, z + 8, Blocks.lever, 10, 3); - world.setBlock(x + 6, y + -23, z + 10, Blocks.lever, 12, 3); - world.setBlock(x + 10, y + -23, z + 10, Blocks.lever, 10, 3); - world.setBlock(x + 10, y + -23, z + 12, Blocks.ladder, 4, 3); - world.setBlock(x + 10, y + -23, z + 13, Blocks.ladder, 4, 3); - world.setBlock(x + 10, y + -22, z + 12, Blocks.ladder, 4, 3); - world.setBlock(x + 10, y + -22, z + 13, Blocks.ladder, 4, 3); - world.setBlock(x + 10, y + -21, z + 12, Blocks.ladder, 4, 3); - world.setBlock(x + 10, y + -21, z + 13, Blocks.ladder, 4, 3); - world.setBlock(x + 2, y + -20, z + 2, Blocks.ladder, 4, 3); - world.setBlock(x + 10, y + -20, z + 12, Blocks.ladder, 4, 3); - world.setBlock(x + 10, y + -20, z + 13, Blocks.ladder, 4, 3); - world.setBlock(x + 2, y + -19, z + 2, Blocks.ladder, 4, 3); - world.setBlock(x + 2, y + -19, z + 5, Blocks.lever, 2, 3); - world.setBlock(x + 5, y + -19, z + 5, Blocks.wall_sign, 3, 3); - world.setBlock(x + 2, y + -18, z + 2, Blocks.ladder, 4, 3); - world.setBlock(x + 2, y + -17, z + 2, Blocks.ladder, 4, 3); - world.setBlock(x + 2, y + -16, z + 2, Blocks.ladder, 4, 3); - world.setBlock(x + 2, y + -15, z + 2, Blocks.ladder, 4, 3); - world.setBlock(x + 2, y + -14, z + 2, Blocks.ladder, 4, 3); - world.setBlock(x + 2, y + -13, z + 2, Blocks.ladder, 4, 3); - world.setBlock(x + 2, y + -12, z + 2, Blocks.ladder, 4, 3); - world.setBlock(x + 2, y + -11, z + 2, Blocks.ladder, 4, 3); - world.setBlock(x + 2, y + -10, z + 2, Blocks.ladder, 4, 3); - world.setBlock(x + 2, y + -9, z + 2, Blocks.ladder, 4, 3); - world.setBlock(x + 2, y + -8, z + 2, Blocks.ladder, 4, 3); - world.setBlock(x + 2, y + -7, z + 2, Blocks.ladder, 4, 3); - world.setBlock(x + 2, y + -6, z + 2, Blocks.ladder, 4, 3); - world.setBlock(x + 2, y + -5, z + 2, Blocks.ladder, 4, 3); - world.setBlock(x + 2, y + -4, z + 2, Blocks.ladder, 4, 3); - world.setBlock(x + 2, y + -3, z + 2, Blocks.ladder, 4, 3); - world.setBlock(x + 2, y + -2, z + 2, Blocks.ladder, 4, 3); - world.setBlock(x + 2, y + -1, z + 2, Blocks.ladder, 4, 3); - world.setBlock(x + 2, y + 0, z + 1, Blocks.ladder, 3, 3); - world.setBlock(x + 2, y + 0, z + 2, Blocks.ladder, 4, 3); - world.setBlock(x + 2, y + 1, z + 1, Blocks.ladder, 3, 3); - world.setBlock(x + 2, y + 2, z + 1, Blocks.ladder, 3, 3); - world.setBlock(x + 8, y + -20, z + 5, Blocks.bed, 10, 3); - world.setBlock(x + 10, y + -20, z + 5, Blocks.bed, 10, 3); - world.setBlock(x + 8, y + -20, z + 6, Blocks.bed, 2, 3); - world.setBlock(x + 10, y + -20, z + 6, Blocks.bed, 2, 3); - world.setBlock(x + 4, y + -20, z + 9, Blocks.bed, 0, 3); - world.setBlock(x + 6, y + -20, z + 9, Blocks.bed, 0, 3); - world.setBlock(x + 8, y + -20, z + 9, Blocks.bed, 0, 3); - world.setBlock(x + 10, y + -20, z + 9, Blocks.bed, 0, 3); - world.setBlock(x + 4, y + -20, z + 10, Blocks.bed, 8, 3); - world.setBlock(x + 6, y + -20, z + 10, Blocks.bed, 8, 3); - world.setBlock(x + 8, y + -20, z + 10, Blocks.bed, 8, 3); - world.setBlock(x + 10, y + -20, z + 10, Blocks.bed, 8, 3); - world.setBlock(x + 8, y + -19, z + 5, Blocks.bed, 10, 3); - world.setBlock(x + 10, y + -19, z + 5, Blocks.bed, 10, 3); - world.setBlock(x + 8, y + -19, z + 6, Blocks.bed, 2, 3); - world.setBlock(x + 10, y + -19, z + 6, Blocks.bed, 2, 3); - world.setBlock(x + 4, y + -19, z + 9, Blocks.bed, 0, 3); - world.setBlock(x + 6, y + -19, z + 9, Blocks.bed, 0, 3); - world.setBlock(x + 8, y + -19, z + 9, Blocks.bed, 0, 3); - world.setBlock(x + 10, y + -19, z + 9, Blocks.bed, 0, 3); - world.setBlock(x + 4, y + -19, z + 10, Blocks.bed, 8, 3); - world.setBlock(x + 6, y + -19, z + 10, Blocks.bed, 8, 3); - world.setBlock(x + 8, y + -19, z + 10, Blocks.bed, 8, 3); - world.setBlock(x + 10, y + -19, z + 10, Blocks.bed, 8, 3); - if(GeneralConfig.enableDebugMode) - System.out.print("[Debug] Successfully spawned bunker at " + x + " " + y + " " + z + "\n"); - return true; - - } - -} \ No newline at end of file