diff --git a/src/main/java/com/hbm/blocks/generic/BlockDecoContainer.java b/src/main/java/com/hbm/blocks/generic/BlockDecoContainer.java index 4655116d1..e9f65a120 100644 --- a/src/main/java/com/hbm/blocks/generic/BlockDecoContainer.java +++ b/src/main/java/com/hbm/blocks/generic/BlockDecoContainer.java @@ -37,7 +37,7 @@ public class BlockDecoContainer extends BlockDecoModel implements ITileEntityPro try { return tile.newInstance(); } catch (Exception e) { - System.out.println("BlockDecoContainer attempted to create a TE, but couldn't. How does that even happen?"); + MainRegistry.logger.error("BlockDecoContainer attempted to create a TE, but couldn't. How does that even happen?"); return null; } } diff --git a/src/main/java/com/hbm/blocks/generic/BlockDecoModel.java b/src/main/java/com/hbm/blocks/generic/BlockDecoModel.java index dbe3af5ed..78320789c 100644 --- a/src/main/java/com/hbm/blocks/generic/BlockDecoModel.java +++ b/src/main/java/com/hbm/blocks/generic/BlockDecoModel.java @@ -52,6 +52,9 @@ public class BlockDecoModel extends Block { super.registerBlockIcons(iconRegister); icons = new IIcon[subTypes]; + if(subTypes == 1) + return; + for(byte i = 0; i < subTypes; i++) icons[i] = iconRegister.registerIcon(this.textureName + "_" + i); } diff --git a/src/main/java/com/hbm/items/tool/ItemStructurePattern.java b/src/main/java/com/hbm/items/tool/ItemStructurePattern.java index f65d4c80a..60f7c39f4 100644 --- a/src/main/java/com/hbm/items/tool/ItemStructurePattern.java +++ b/src/main/java/com/hbm/items/tool/ItemStructurePattern.java @@ -6,6 +6,7 @@ import com.hbm.util.fauxpointtwelve.BlockPos; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; @@ -43,10 +44,10 @@ public class ItemStructurePattern extends ItemStructureTool { int maxZ = Math.max(savedZ, z) - pos.getZ(); for(int ix = minX; ix <= maxX; ix++) { - for(int iy = minX; iy <= maxY; iy++) { - for(int iz = minX; iz <= maxZ; iz++) { + for(int iy = minY; iy <= maxY; iy++) { + for(int iz = minZ; iz <= maxZ; iz++) { - Block b = world.getBlock(ix + pos.getX(), iy + pos.getY(), iz + pos.getZ()); + Block b = world.getBlock(ix + pos.getX(), iy + pos.getY(), iz + pos.getZ()); int meta = world.getBlockMetadata(ix + pos.getX(), iy + pos.getY(), iz + pos.getZ()); message.concat("placeBlockAtCurrentPosition(world, " + b.getUnlocalizedName() + ", " + meta + ", " + ix + ", " + iy + ", " + iz + ", box);\n"); diff --git a/src/main/java/com/hbm/lib/HbmChestContents.java b/src/main/java/com/hbm/lib/HbmChestContents.java index aa7df0b1a..80b520b54 100644 --- a/src/main/java/com/hbm/lib/HbmChestContents.java +++ b/src/main/java/com/hbm/lib/HbmChestContents.java @@ -368,49 +368,67 @@ public class HbmChestContents { new WeightedRandomChestContent(ModItems.ink, 0, 1, 1, 1), //make that mf rare; 1:555 weight }; - /** Nowhere else to put this and this seems like the most fitting place **/ - public static ItemStack genetateBook(String key) { - - String author = resolve("book.lore." + key + ".author"); - String title = resolve("book.lore." + key + ".title"); - - ItemStack book = new ItemStack(Items.written_book); - book.stackTagCompound = new NBTTagCompound(); - book.stackTagCompound.setString("author", author); - book.stackTagCompound.setString("title", title); - NBTTagList nbt = new NBTTagList(); - - for(byte i = 1; i <= 50; i++) { - String unloc = "book.lore." + key + ".page" + i; - String page = resolve(unloc); - - if(page.equals(unloc)) - break; - else - nbt.appendTag(new NBTTagString(page)); - } - - book.stackTagCompound.setTag("pages", nbt); - - return book; - } + public static WeightedRandomChestContent[] bedroom1 = new WeightedRandomChestContent[] { //soda enjoyer who really needs to charge their radio + new WeightedRandomChestContent(ModItems.can_empty, 0, 1, 1, 2), + new WeightedRandomChestContent(ModItems.can_creature, 0, 1, 2, 2), + new WeightedRandomChestContent(ModItems.can_smart, 0, 1, 3, 2), + new WeightedRandomChestContent(ModItems.can_mrsugar, 0, 1, 2, 2), + new WeightedRandomChestContent(ModItems.med_ipecac, 0, 1, 1, 1), + new WeightedRandomChestContent(ModItems.radx, 0, 1, 1, 2), + new WeightedRandomChestContent(ModItems.dust_tiny, 0, 1, 3, 2), + new WeightedRandomChestContent(ModItems.dust, 0, 1, 1, 1), + new WeightedRandomChestContent(Items.paper, 0, 1, 12, 7), + new WeightedRandomChestContent(Items.book, 0, 1, 3, 5), + new WeightedRandomChestContent(ModItems.battery_su, 0, 1, 1, 3), + new WeightedRandomChestContent(ModItems.canteen_13, 0, 1, 1, 1), + }; - private static String resolve(String key) { - String result = books.get(key); - return result != null ? result : key; - } + public static WeightedRandomChestContent[] bedroom2 = new WeightedRandomChestContent[] { //overworking nuka-cola enthusiast + new WeightedRandomChestContent(ModItems.twinkie, 0, 1, 3, 7), + new WeightedRandomChestContent(ModItems.coffee, 0, 1, 1, 5), + new WeightedRandomChestContent(ModItems.bottle_nuka, 0, 1, 1, 3), + new WeightedRandomChestContent(ModItems.bottle_quantum, 0, 1, 1, 4), + new WeightedRandomChestContent(ModItems.bottle_cherry, 0, 1, 1, 3), + new WeightedRandomChestContent(ModItems.bottle_opener, 0, 1, 1, 3), + new WeightedRandomChestContent(ModItems.radaway, 0, 1, 1, 2), + new WeightedRandomChestContent(ModItems.dust_tiny, 0, 1, 3, 2), + new WeightedRandomChestContent(ModItems.dust, 0, 1, 1, 1), + new WeightedRandomChestContent(ModItems.battery_su_l, 0, 1, 1, 1), + new WeightedRandomChestContent(Items.paper, 0, 1, 12, 10), + new WeightedRandomChestContent(Items.book, 0, 1, 3, 5), + new WeightedRandomChestContent(ModItems.canteen_13, 0, 1, 1, 1), + }; - private static HashMap books = new HashMap(); + public static WeightedRandomChestContent[] bedroom3 = new WeightedRandomChestContent[] { //secretly alcoholic journaling fan who drinks straight from the canister + new WeightedRandomChestContent(Items.writable_book, 0, 1, 12, 10), + new WeightedRandomChestContent(Items.feather, 0, 1, 2, 5), + new WeightedRandomChestContent(new ItemStack(ModItems.canister_full, 1, Fluids.ETHANOL.getID()), 1, 2, 10), + new WeightedRandomChestContent(ModItems.scrumpy, 0, 1, 1, 1), + new WeightedRandomChestContent(ModItems.dust_tiny, 0, 1, 3, 3), + new WeightedRandomChestContent(ModItems.dust, 0, 1, 1, 2), + new WeightedRandomChestContent(Items.paper, 0, 1, 12, 10), + new WeightedRandomChestContent(Items.book, 0, 1, 3, 10), + new WeightedRandomChestContent(ModItems.canteen_13, 0, 1, 1, 2), + }; + + public static WeightedRandomChestContent[] bedroom4 = new WeightedRandomChestContent[] { //gun nut with a knack for self-made weapons + new WeightedRandomChestContent(ModItems.armor_polish, 0, 1, 1, 3), + new WeightedRandomChestContent(ModItems.gun_kit_1, 0, 1, 2, 2), + new WeightedRandomChestContent(ModItems.mechanism_revolver_1, 0, 1, 2, 2), + new WeightedRandomChestContent(ModItems.mechanism_revolver_2, 0, 1, 1, 2), + new WeightedRandomChestContent(ModItems.mechanism_rifle_1, 0, 1, 2, 1), + new WeightedRandomChestContent(ModItems.mechanism_rifle_2, 0, 1, 1, 1), + new WeightedRandomChestContent(ModItems.battery_su_l, 0, 1, 1, 1), + new WeightedRandomChestContent(ModItems.bolt_tungsten, 0, 1, 4, 1), + new WeightedRandomChestContent(ModItems.wire_aluminium, 0, 1, 5, 1), + new WeightedRandomChestContent(ModItems.steel_plate, 0, 1, 3, 1), + new WeightedRandomChestContent(ModItems.screwdriver, 0, 1, 1, 2), + new WeightedRandomChestContent(ModItems.wrench, 0, 1, 1, 2), + new WeightedRandomChestContent(ModItems.hand_drill, 0, 1, 1, 2), + new WeightedRandomChestContent(ModItems.clip_revolver_nopip, 0, 1, 1, 2), + new WeightedRandomChestContent(ModItems.ammo_20gauge, 0, 1, 8, 2), + new WeightedRandomChestContent(ModItems.gun_revolver_nopip, 0, 1, 1, 3), + new WeightedRandomChestContent(ModItems.canteen_13, 0, 1, 1, 1), + }; - static { - books.put("book.lore.office0.title", "Letter of Resignation"); - books.put("book.lore.office0.author", "Kosma"); - books.put("book.lore.office0.page1", "Management downsized our department again yesterday. Those idiots only have themselves to blame, I don't know what they were expecting after the Panay fiasco. Who the hell leaks that sort of information? We're losing millions and"); - books.put("book.lore.office0.page2", "it's ME who's the one out of a job now. I'M the one being asked to resign. I hope you asshats finally learn from your overabundance of mistakes and take that stick out of your ass."); - books.put("book.lore.office0.page3", "I'm not coming back on Friday. Just send the paycheck."); - books.put("book.lore.office1.title", "Note"); - books.put("book.lore.office1.author", "Jonas"); - books.put("book.lore.office1.page1", null); - books.put("book.lore.office2.page2", null); - } } diff --git a/src/main/java/com/hbm/lib/HbmWorld.java b/src/main/java/com/hbm/lib/HbmWorld.java index ec01ec220..86f1b6a61 100644 --- a/src/main/java/com/hbm/lib/HbmWorld.java +++ b/src/main/java/com/hbm/lib/HbmWorld.java @@ -2,11 +2,10 @@ package com.hbm.lib; import com.hbm.world.worldgen.MapGenNTMFeatures; import com.hbm.world.worldgen.NTMWorldGenerator; -import com.hbm.world.worldgen.components.BunkerComponents.*; -import com.hbm.world.worldgen.components.CivilianFeatures.*; -import com.hbm.world.worldgen.components.MilitaryBaseFeatures.*; -import com.hbm.world.worldgen.components.OfficeFeatures.*; -import com.hbm.world.worldgen.components.RuinFeatures.*; +import com.hbm.world.worldgen.components.BunkerComponents; +import com.hbm.world.worldgen.components.CivilianFeatures; +import com.hbm.world.worldgen.components.OfficeFeatures; +import com.hbm.world.worldgen.components.RuinFeatures; import cpw.mods.fml.common.IWorldGenerator; import cpw.mods.fml.common.registry.GameRegistry; @@ -36,32 +35,9 @@ public class HbmWorld { /** Register structures in MapGenStructureIO */ public static void registerNTMFeatures() { - MapGenStructureIO.func_143031_a(NTMHouse1.class, "NTMHouse1"); - MapGenStructureIO.func_143031_a(NTMHouse2.class, "NTMHouse2"); - MapGenStructureIO.func_143031_a(NTMLab1.class, "NTMLab1"); - MapGenStructureIO.func_143031_a(NTMLab2.class, "NTMLab2"); - MapGenStructureIO.func_143031_a(NTMWorkshop1.class, "NTMWorkshop1"); - MapGenStructureIO.func_143031_a(NTMRuin1.class, "NTMRuin1"); - MapGenStructureIO.func_143031_a(NTMRuin2.class, "NTMRuin2"); - MapGenStructureIO.func_143031_a(NTMRuin3.class, "NTMRuin3"); - MapGenStructureIO.func_143031_a(NTMRuin4.class, "NTMRuin4"); - //aggggggggggg - MapGenStructureIO.func_143031_a(BasicHelipad.class, "NTMBasicHelipad"); - MapGenStructureIO.func_143031_a(RadioShack.class, "NTMRadioShack"); - MapGenStructureIO.func_143031_a(LargeOffice.class, "NTMLargeOffice"); - MapGenStructureIO.func_143031_a(LargeOfficeCorner.class, "NTMLargeOfficeCorner"); - - //bunker - MapGenStructureIO.func_143031_a(Atrium.class, "NTMBAtrium"); - MapGenStructureIO.func_143031_a(Corridor.class, "NTMBCorridor"); - MapGenStructureIO.func_143031_a(WideCorridor.class, "NTMBWideCorridor"); - MapGenStructureIO.func_143031_a(Intersection.class, "NTMBIntersection"); - MapGenStructureIO.func_143031_a(WideIntersection.class, "NTMBWideIntersection"); - MapGenStructureIO.func_143031_a(UtilityCloset.class, "NTMBUtilityCloset"); - MapGenStructureIO.func_143031_a(SupplyRoom.class, "NTMBSupplyRoom"); - MapGenStructureIO.func_143031_a(WasteDisposal.class, "NTMBWasteDisposal"); - MapGenStructureIO.func_143031_a(Bedroom.class, "NTMBBedroom"); - MapGenStructureIO.func_143031_a(CenterCrossing.class, "NTMBCenterCrossing"); - MapGenStructureIO.func_143031_a(Reactor.class, "NTMBReactor"); + CivilianFeatures.registerComponents(); + OfficeFeatures.registerComponents(); + RuinFeatures.registerComponents(); + BunkerComponents.registerComponents(); } } diff --git a/src/main/java/com/hbm/util/LootGenerator.java b/src/main/java/com/hbm/util/LootGenerator.java index 2c5d0b500..519c4c428 100644 --- a/src/main/java/com/hbm/util/LootGenerator.java +++ b/src/main/java/com/hbm/util/LootGenerator.java @@ -83,6 +83,32 @@ public class LootGenerator { } } + public static void lootMakeshiftGun(World world, int x, int y, int z) { + + TileEntityLoot loot = (TileEntityLoot) world.getTileEntity(x, y, z); + + if(loot != null && loot.items.isEmpty()) { + + if(world.rand.nextInt(2) == 0) + addItemWithDeviation(loot, world.rand, new ItemStack(ModItems.gun_lever_action), 0, 0, 0.125); + + int count = world.rand.nextInt(2) + 1; + for(int i = 0; i < count; i++) { + int type = world.rand.nextInt(2); + Item parts = type < 1 ? ModItems.plate_steel : ModItems.mechanism_rifle_1; + addItemWithDeviation(loot, world.rand, new ItemStack(parts), -0.3125, i * 0.03125, 0.3125); + } + + count = world.rand.nextInt(2) + 2; + for(int i = 0; i < count; i++) + addItemWithDeviation(loot, world.rand, new ItemStack(ModItems.wire_aluminium), 0.3125, i * 0.03125, -0.125); + + int type = world.rand.nextInt(4); + Item tool = type > 2 ? ModItems.wrench : ModItems.screwdriver; + addItemWithDeviation(loot, world.rand, new ItemStack(tool), 0.005, 0, -0.3125); + } + } + public static void lootNukeStorage(World world, int x, int y, int z) { TileEntityLoot loot = (TileEntityLoot) world.getTileEntity(x, y, z); diff --git a/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java b/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java index f0d666dc8..f578cb70c 100644 --- a/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java +++ b/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java @@ -9,8 +9,6 @@ import java.util.Random; import com.hbm.config.GeneralConfig; import com.hbm.config.StructureConfig; import com.hbm.world.worldgen.components.CivilianFeatures.*; -import com.hbm.world.worldgen.components.MilitaryBaseFeatures; -import com.hbm.world.worldgen.components.MilitaryBaseFeatures.*; import com.hbm.world.worldgen.components.OfficeFeatures.*; import com.hbm.world.worldgen.components.RuinFeatures.*; @@ -140,10 +138,6 @@ public class MapGenNTMFeatures extends MapGenStructure { } else if(biome.temperature >= 0.25 && biome.temperature <= 0.3 && biome.rainfall >= 0.6 && biome.rainfall <= 0.9 && rand.nextBoolean()) { //Taiga & Mega Taiga NTMWorkshop1 workshop1 = new NTMWorkshop1(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); this.components.add(workshop1); - - } else if(biome.heightVariation <= 0.2 && biome.rainfall <= 0.5 && !(biome instanceof BiomeGenBeach) && rand.nextInt(5) == 0) { //Everything except jungles, extra-hilly areas, and beaches - MilitaryBaseFeatures.smallHelipad(components, chunkX, posY, chunkZ, rand); //agggggggg - } else { //Everything else switch(rand.nextInt(3)) { case 0: diff --git a/src/main/java/com/hbm/world/worldgen/components/BunkerComponents.java b/src/main/java/com/hbm/world/worldgen/components/BunkerComponents.java index f72706519..744a96d6a 100644 --- a/src/main/java/com/hbm/world/worldgen/components/BunkerComponents.java +++ b/src/main/java/com/hbm/world/worldgen/components/BunkerComponents.java @@ -9,6 +9,7 @@ import com.hbm.blocks.BlockDummyable; import com.hbm.blocks.ModBlocks; import com.hbm.lib.HbmChestContents; import com.hbm.tileentity.network.TileEntityPylonBase; +import com.hbm.util.LootGenerator; import com.hbm.world.worldgen.components.ProceduralComponents.ProceduralComponent; import net.minecraft.block.Block; @@ -17,12 +18,29 @@ import net.minecraft.init.Blocks; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; +import net.minecraft.world.gen.structure.MapGenStructureIO; import net.minecraft.world.gen.structure.StructureBoundingBox; import net.minecraft.world.gen.structure.StructureComponent; import net.minecraftforge.common.util.ForgeDirection; public class BunkerComponents extends ProceduralComponents { + public static void registerComponents() { + MapGenStructureIO.func_143031_a(Atrium.class, "NTMBAtrium"); + MapGenStructureIO.func_143031_a(Corridor.class, "NTMBCorridor"); + MapGenStructureIO.func_143031_a(WideCorridor.class, "NTMBWideCorridor"); + MapGenStructureIO.func_143031_a(Intersection.class, "NTMBIntersection"); + MapGenStructureIO.func_143031_a(WideIntersection.class, "NTMBWideIntersection"); + MapGenStructureIO.func_143031_a(DeadEnd.class, "NTMBDeadEnd"); + MapGenStructureIO.func_143031_a(CenterCrossing.class, "NTMBCenterCrossing"); + MapGenStructureIO.func_143031_a(UtilityCloset.class, "NTMBUtilityCloset"); + MapGenStructureIO.func_143031_a(SupplyRoom.class, "NTMBSupplyRoom"); + MapGenStructureIO.func_143031_a(WasteDisposal.class, "NTMBWasteDisposal"); + MapGenStructureIO.func_143031_a(Bedroom.class, "NTMBBedroom"); + MapGenStructureIO.func_143031_a(Reactor.class, "NTMBReactor"); + MapGenStructureIO.func_143031_a(RTG.class, "NTMBRTG"); + } + public BunkerComponents() { //Pass each respective method as a method reference (::) to the weight constructors, in order to boost clarity @@ -207,9 +225,9 @@ public class BunkerComponents extends ProceduralComponents { @Override public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { - if(!underwater && isLiquidInStructureBoundingBox(world, boundingBox)) { + /*if(!underwater && isLiquidInStructureBoundingBox(world, boundingBox)) { return false; - } else { + } else {*/ fillWithAir(world, box, 1, 1, 1, 3, 3, 2); //Floor @@ -272,7 +290,7 @@ public class BunkerComponents extends ProceduralComponents { fillWithCobwebs(world, box, rand, 1, 1, 1, 3, 3, 2); return true; - } + //} } protected void makeConnection(World world, int x1, int y1, int z1, int x2, int y2, int z2) { @@ -334,9 +352,9 @@ public class BunkerComponents extends ProceduralComponents { @Override public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { - if(!underwater && isLiquidInStructureBoundingBox(world, boundingBox)) { + /*if(!underwater && isLiquidInStructureBoundingBox(world, boundingBox)) { return false; - } else { + } else {*/ fillWithAir(world, box, 5, 1, 0, 7, 3, 0); fillWithAir(world, box, 1, 1, 1, 11, 3, 11); @@ -441,7 +459,7 @@ public class BunkerComponents extends ProceduralComponents { fillWithCobwebs(world, box, rand, 1, 1, 0, 11, 3, 11); return true; - } + //} } /** Finds valid placement, using input information. Should be passed as a method reference to its respective Weight. */ @@ -467,9 +485,11 @@ public class BunkerComponents extends ProceduralComponents { @Override public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { - if(!underwater && isLiquidInStructureBoundingBox(world, boundingBox)) { + /*if(!underwater && isLiquidInStructureBoundingBox(world, boundingBox)) { return false; - } else { + } else {*/ + fillWithAir(world, box, 1, 1, 1, 7, 3, 7); + //Floor placeBlockAtCurrentPosition(world, ModBlocks.vinyl_tile, 1, 4, 0, 0, box); fillWithBlocks(world, box, 1, 0, 1, 1, 0, 2, ModBlocks.concrete_brick_slab); @@ -514,7 +534,7 @@ public class BunkerComponents extends ProceduralComponents { generateInvContents(world, box, rand, ModBlocks.crate_iron, 1, 2, 7, HbmChestContents.filingCabinet, 10); fillWithMetadataBlocks(world, box, 7, 1, 1, 7, 1, 2, ModBlocks.steel_grate, 7); placeBlockAtCurrentPosition(world, ModBlocks.steel_wall, getDecoMeta(3), 7, 1, 3, box); - placeRandomBobble(world, box, rand, 7, 2, 1); + if(rand.nextInt(3) == 0) placeRandomBobble(world, box, rand, 7, 2, 1); //Cremator int pillarMetaWE = getPillarMeta(4); @@ -546,7 +566,7 @@ public class BunkerComponents extends ProceduralComponents { } return true; - } + //} } /** Finds valid placement, using input information. Should be passed as a method reference to its respective Weight. */ @@ -558,20 +578,35 @@ public class BunkerComponents extends ProceduralComponents { public static class Bedroom extends Bunker { + int decorationType = 0; + public Bedroom() { } public Bedroom(int componentType, Random rand, StructureBoundingBox box, int coordBaseMode) { super(componentType); this.coordBaseMode = coordBaseMode; this.boundingBox = box; + this.decorationType = rand.nextInt(4); + } + + protected void func_143012_a(NBTTagCompound data) { + super.func_143012_a(data); + data.setInteger("decoration", decorationType); + } + + protected void func_143011_b(NBTTagCompound data) { + super.func_143011_b(data); + decorationType = data.getInteger("decoration"); } @Override public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { - if(!underwater && isLiquidInStructureBoundingBox(world, boundingBox)) { + /*if(!underwater && isLiquidInStructureBoundingBox(world, boundingBox)) { return false; - } else { + } else {*/ + fillWithAir(world, box, 1, 1, 1, 6, 3, 8); + //Floor placeBlockAtCurrentPosition(world, ModBlocks.vinyl_tile, 1, 2, 0, 0, box); fillWithMetadataBlocks(world, box, 1, 0, 1, 6, 0, 8, ModBlocks.vinyl_tile, 1); @@ -617,6 +652,11 @@ public class BunkerComponents extends ProceduralComponents { placeBlockAtCurrentPosition(world, ModBlocks.reinforced_brick, 0, 6, 4, 8, box); //Decorations + int stairMetaW = getStairMeta(0); + int stairMetaE = getStairMeta(1); + int stairMetaN = getStairMeta(2); + int stairMetaS = getStairMeta(3); + //Bathroom placeDoor(world, box, ModBlocks.door_metal, 4, 4, 1, 8); placeBlockAtCurrentPosition(world, ModBlocks.concrete_slab, 9, 5, 1, 6, box); @@ -625,25 +665,99 @@ public class BunkerComponents extends ProceduralComponents { placeBlockAtCurrentPosition(world, Blocks.hopper, getDecoMeta(3), 6, 1, 8, box); placeBlockAtCurrentPosition(world, Blocks.trapdoor, getDecoModelMeta(0), 6, 2, 8, box); //Furnishing - placeBed(world, box, 2, 4, 1, 2); - placeBed(world, box, 2, 5, 1, 2); - fillWithMetadataBlocks(world, box, 6, 1, 1, 6, 1, 4, ModBlocks.concrete_slab, 9); - placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, getStairMeta(1), 5, 1, 4, box); - placeBlockAtCurrentPosition(world, ModBlocks.radiorec, getDecoMeta(5), 6, 2, 1, box); - placeRandomBobble(world, box, rand, 6, 2, 3); - placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, getDecoModelMeta(2), 6, 2, 4, box); - generateInvContents(world, box, rand, ModBlocks.filing_cabinet, getDecoModelMeta(0) | 4, 4, 1, 5, HbmChestContents.officeTrash, 4); //TODO: create more contents - placeBlockAtCurrentPosition(world, ModBlocks.filing_cabinet, getDecoModelMeta(0) | 4, 4, 1, 5, box); - // - placeBlockAtCurrentPosition(world, ModBlocks.concrete_stairs, getStairMeta(7), 1, 1, 2, box); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_stairs, getStairMeta(6), 1, 1, 3, box); - placeBlockAtCurrentPosition(world, ModBlocks.machine_electric_furnace_off, 5, 1, 1, 4, box); - fillWithMetadataBlocks(world, box, 1, 3, 2, 1, 3, 4, ModBlocks.reinforced_brick_stairs, getStairMeta(1)); - // - placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, getStairMeta(3), 1, 1, 6, box); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_stairs, getStairMeta(4), 2, 1, 7, box); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_slab, 9, 1, 1, 7, box); - placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, getStairMeta(2), 1, 1, 8, box); + switch(this.decorationType) { + case 0: + placeBed(world, box, 2, 4, 1, 2); + placeBed(world, box, 2, 5, 1, 2); + fillWithMetadataBlocks(world, box, 6, 1, 1, 6, 1, 4, ModBlocks.concrete_slab, 9); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaE, 5, 1, 4, box); + placeBlockAtCurrentPosition(world, ModBlocks.radiorec, getDecoMeta(5), 6, 2, 1, box); + if(rand.nextInt(2) == 0) placeRandomBobble(world, box, rand, 6, 2, 3); + placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, getDecoModelMeta(2), 6, 2, 4, box); + generateInvContents(world, box, rand, ModBlocks.filing_cabinet, getDecoModelMeta(4), 4, 1, 5, HbmChestContents.bedroom1, 8); + //Kitchen + placeBlockAtCurrentPosition(world, ModBlocks.concrete_stairs, stairMetaS | 4, 1, 1, 2, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_stairs, stairMetaN | 4, 1, 1, 3, box); + placeBlockAtCurrentPosition(world, ModBlocks.machine_electric_furnace_off, getDecoMeta(5), 1, 1, 4, box); + fillWithMetadataBlocks(world, box, 1, 3, 2, 1, 3, 4, ModBlocks.reinforced_brick_stairs, stairMetaE); + //Dining Table + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaS, 1, 1, 6, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_stairs, stairMetaW | 4, 2, 1, 7, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_slab, 9, 1, 1, 7, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaN, 1, 1, 8, box); + break; + case 1: + placeBed(world, box, 1, 2, 1, 3); + placeBed(world, box, 1, 2, 1, 4); + generateInvContents(world, box, rand, ModBlocks.filing_cabinet, getDecoModelMeta(7), 1, 1, 2, HbmChestContents.bedroom2, 8); + placeBlockAtCurrentPosition(world, ModBlocks.hev_battery, 0, 1, 2, 2, box); + //Desk + placeBlockAtCurrentPosition(world, ModBlocks.concrete_stairs, stairMetaS | 4, 1, 1, 5, box); + fillWithMetadataBlocks(world, box, 1, 1, 6, 1, 1, 7, ModBlocks.concrete_slab, 9); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_stairs, stairMetaN | 4, 1, 1, 8, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaW, 2, 1, 6, box); + placeBlockAtCurrentPosition(world, ModBlocks.tape_recorder, getDecoMeta(5), 1, 2, 6, box); + placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, getDecoModelMeta(3), 1, 2, 7, box); + //Kitchen + placeBlockAtCurrentPosition(world, ModBlocks.concrete_stairs, stairMetaE | 4, 4, 1, 1, box); + fillWithMetadataBlocks(world, box, 5, 1, 1, 6, 1, 1, ModBlocks.brick_slab, 9); + placeBlockAtCurrentPosition(world, ModBlocks.brick_slab, 9, 6, 1, 2, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_stairs, stairMetaN | 4, 6, 1, 3, box); + placeBlockAtCurrentPosition(world, ModBlocks.machine_electric_furnace_off, getDecoMeta(4), 6, 1, 4, box); + fillWithMetadataBlocks(world, box, 6, 3, 1, 6, 3, 4, ModBlocks.reinforced_brick_stairs, stairMetaW); + placeBlockAtCurrentPosition(world, ModBlocks.machine_microwave, getDecoMeta(3), 5, 2, 1, box); + if(rand.nextInt(2) == 0) placeRandomBobble(world, box, rand, 6, 2, 2); + break; + case 2: + placeBed(world, box, 2, 5, 1, 3); + placeBed(world, box, 2, 6, 1, 3); + //Desk + placeBlockAtCurrentPosition(world, ModBlocks.concrete_slab, 9, 4, 1, 1, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_stairs, stairMetaS | 4, 5, 1, 1, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_slab, 9, 6, 1, 1, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaN, 4, 1, 2, box); + placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, getDecoModelMeta(1), 4, 2, 1, box); + placeBlockAtCurrentPosition(world, Blocks.flower_pot, 3 + rand.nextInt(4), 5, 2, 1, box); + generateInvContents(world, box, rand, ModBlocks.filing_cabinet, getDecoModelMeta(5), 6, 2, 1, HbmChestContents.officeTrash, 4); + //Dining Table + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaS, 1, 1, 2, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaN, 1, 1, 4, box); + placeBlockAtCurrentPosition(world, Blocks.fence, 0, 1, 1, 3, box); + placeBlockAtCurrentPosition(world, Blocks.heavy_weighted_pressure_plate, 0, 1, 2, 3, box); + //Kitchen + placeBlockAtCurrentPosition(world, ModBlocks.machine_electric_furnace_off, getDecoMeta(5), 1, 1, 8, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_slab, 9, 1, 1, 7, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_stairs, stairMetaS | 4, 1, 1, 6, box); + fillWithMetadataBlocks(world, box, 1, 3, 6, 1, 3, 8, ModBlocks.reinforced_brick_stairs, stairMetaE); + // + generateInvContents(world, box, rand, ModBlocks.filing_cabinet, getDecoModelMeta(6), 3, 1, 6, HbmChestContents.bedroom3, 6); //TODO: add bedroom3 + if(rand.nextInt(2) == 0) placeRandomBobble(world, box, rand, 3, 2, 6); + break; + case 3: + placeBed(world, box, 1, 2, 1, 7); + placeBed(world, box, 1, 2, 1, 8); + //Kitchen & Nightstand + placeBlockAtCurrentPosition(world, ModBlocks.concrete_stairs, stairMetaE | 4, 1, 1, 6, box); + placeBlockAtCurrentPosition(world, ModBlocks.radiorec, getDecoMeta(4), 1, 2, 6, box); + placeBlockAtCurrentPosition(world, ModBlocks.machine_electric_furnace_off, getDecoMeta(5), 1, 1, 4, box); + fillWithMetadataBlocks(world, box, 1, 1, 2, 1, 1, 3, ModBlocks.concrete_slab, 9); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_stairs, stairMetaS | 4, 1, 1, 1, box); + fillWithMetadataBlocks(world, box, 1, 3, 1, 1, 3, 4, ModBlocks.reinforced_brick_stairs, stairMetaE); + //Workspace + placeBlockAtCurrentPosition(world, ModBlocks.concrete_stairs, stairMetaE | 4, 4, 1, 1, box); + fillWithMetadataBlocks(world, box, 5, 1, 1, 6, 1, 1, ModBlocks.concrete_slab, 9); + fillWithMetadataBlocks(world, box, 6, 1, 2, 6, 1, 3, ModBlocks.concrete_slab, 9); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_stairs, stairMetaN | 4, 6, 1, 4, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaN, 5, 1, 2, box); + placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, getDecoModelMeta(0), 5, 1, 4, box); + if(rand.nextInt(2) == 0) placeRandomBobble(world, box, rand, 4, 1, 4); + generateInvContents(world, box, rand, ModBlocks.filing_cabinet, getDecoModelMeta(6), 6, 2, 3, HbmChestContents.bedroom4, 6); + generateInvContents(world, box, rand, ModBlocks.filing_cabinet, getDecoModelMeta(6), 6, 2, 4, HbmChestContents.bedroom4, 6); + placeBlockAtCurrentPosition(world, ModBlocks.deco_loot, 0, 5, 2, 1, box); //TODO: change LootGenerator to use a proper 'registry' instead of cumbersome methods + LootGenerator.lootMakeshiftGun(world, getXWithOffset(5, 1), getYWithOffset(2), getZWithOffset(5, 1)); + break; + } + placeDoor(world, box, ModBlocks.door_metal, 1, 2, 1, 0); @@ -654,7 +768,7 @@ public class BunkerComponents extends ProceduralComponents { } return true; - } + //} } /** Finds valid placement, using input information. Should be passed as a method reference to its respective Weight. */ @@ -664,276 +778,6 @@ public class BunkerComponents extends ProceduralComponents { } } - public static class CenterCrossing extends Bunker { - - BlockSelector plantSelector = new BlockSelector() { - public void selectBlocks(Random rand, int posX, int posY, int posZ, boolean notInterior) { - int chance = rand.nextInt(10); - - switch(chance) { - case 0: - this.field_151562_a = Blocks.yellow_flower; - break; - case 1: - case 2: - case 3: - case 4: - this.field_151562_a = Blocks.red_flower; - this.selectedBlockMetaData = rand.nextInt(9); - break; - case 5: - case 6: - this.field_151562_a = Blocks.tallgrass; - this.selectedBlockMetaData = rand.nextInt(2) + 1; - break; - default: - this.field_151562_a = Blocks.air; - } - } - }; - - boolean expandsNX; - boolean expandsPX; - - int decorationType = 0; - - public CenterCrossing() { } - - public CenterCrossing(int componentType, Random rand, StructureBoundingBox box, int coordBaseMode) { - super(componentType); - this.coordBaseMode = coordBaseMode; - this.boundingBox = box; - this.decorationType = rand.nextInt(2); - } - - protected void func_143012_a(NBTTagCompound data) { - super.func_143012_a(data); - data.setBoolean("expandsNX", expandsNX); - data.setBoolean("expandsPX", expandsPX); - data.setInteger("decoration", decorationType); - } - - protected void func_143011_b(NBTTagCompound data) { - super.func_143011_b(data); - expandsNX = data.getBoolean("expandsNX"); - expandsPX = data.getBoolean("expandsPX"); - decorationType = data.getInteger("decoration"); - } - - @Override - public void buildComponent(ProceduralComponents instance, ControlComponent original, List components, Random rand) { - checkModifiers(original); - - StructureComponent componentN = getNextComponentNX(instance, original, components, rand, 3, 1); - expandsNX = componentN != null; - - StructureComponent componentP = getNextComponentPX(instance, original, components, rand, 7, 1); - expandsPX = componentP != null; - } - - @Override - public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { - - if(!underwater && isLiquidInStructureBoundingBox(world, boundingBox)) { - return false; - } else { - fillWithAir(world, box, 6, 1, 0, 8, 3, 0); - fillWithAir(world, box, 1, 1, 1, 13, 3, 11); - fillWithAir(world, box, 2, 4, 2, 12, 5, 10); - - //Floor - fillWithMetadataBlocks(world, box, 6, 0, 0, 8, 0, 0, ModBlocks.vinyl_tile, 1); - fillWithBlocks(world, box, 1, 0, 1, 4, 0, 1, ModBlocks.vinyl_tile); - fillWithMetadataBlocks(world, box, 1, 0, 2, 5, 0, 2, ModBlocks.vinyl_tile, 1); - placeBlockAtCurrentPosition(world, ModBlocks.vinyl_tile, 1, 5, 0, 1, box); - fillWithBlocks(world, box, 6, 0, 1, 8, 0, 2, ModBlocks.vinyl_tile); - fillWithMetadataBlocks(world, box, 9, 0, 2, 13, 0, 2, ModBlocks.vinyl_tile, 1); - fillWithBlocks(world, box, 10, 0, 1, 13, 0, 1, ModBlocks.vinyl_tile); - placeBlockAtCurrentPosition(world, ModBlocks.vinyl_tile, 1, 9, 0, 1, box); - fillWithBlocks(world, box, 1, 0, 3, 13, 0, 5, ModBlocks.vinyl_tile); - fillWithBlocks(world, box, 1, 0, 7, 3, 0, 11, ModBlocks.vinyl_tile); - fillWithMetadataBlocks(world, box, 1, 0, 6, 13, 0, 6, ModBlocks.vinyl_tile, 1); - fillWithMetadataBlocks(world, box, 4, 0, 7, 10, 0, 11, ModBlocks.vinyl_tile, 1); - fillWithBlocks(world, box, 11, 0, 7, 13, 0, 11, ModBlocks.vinyl_tile); - //Wall - fillWithBlocks(world, box, 1, 1, 0, 5, 1, 0, ModBlocks.reinforced_brick); - fillWithBlocks(world, box, 1, 2, 0, 5, 2, 0, ModBlocks.reinforced_stone); - fillWithBlocks(world, box, 1, 3, 0, 5, 3, 0, ModBlocks.reinforced_brick); - fillWithBlocks(world, box, 1, 4, 0, 13, 4, 0, ModBlocks.reinforced_brick); - fillWithBlocks(world, box, 9, 1, 0, 13, 1, 0, ModBlocks.reinforced_brick); - fillWithBlocks(world, box, 9, 2, 0, 13, 2, 0, ModBlocks.reinforced_stone); - fillWithBlocks(world, box, 9, 3, 0, 13, 3, 0, ModBlocks.reinforced_brick); - fillWithBlocks(world, box, 1, 1, 12, 13, 1, 12, ModBlocks.reinforced_brick); - fillWithBlocks(world, box, 1, 2, 12, 13, 2, 12, ModBlocks.reinforced_stone); - fillWithBlocks(world, box, 1, 3, 12, 13, 4, 12, ModBlocks.reinforced_brick); - //Upper lining - for(int i = 1; i <= 11; i += 10) { - fillWithMetadataBlocks(world, box, 1, 4, i, 13, 4, i, ModBlocks.brick_slab, 8); - fillWithBlocks(world, box, 8, 5, i, 13, 5, i, ModBlocks.reinforced_brick); - placeLamp(world, box, rand, 7, 5, i); - fillWithBlocks(world, box, 1, 5, i, 6, 5, i, ModBlocks.reinforced_brick); - } - - for(int i = 1; i <= 13; i += 12) { - fillWithMetadataBlocks(world, box, i, 4, 2, i, 4, 10, ModBlocks.brick_slab, 8); - fillWithBlocks(world, box, i, 5, 2, i, 5, 5, ModBlocks.reinforced_brick); - placeLamp(world, box, rand, i, 5, 6); - fillWithBlocks(world, box, i, 5, 7, i, 5, 10, ModBlocks.reinforced_brick); - } - //Ceiling - int pillarMeta = getPillarMeta(4); - - fillWithBlocks(world, box, 2, 6, 2, 12, 6, 5, ModBlocks.reinforced_brick); - fillWithBlocks(world, box, 2, 6, 7, 12, 6, 10, ModBlocks.reinforced_brick); - for(int i = 2; i <= 10; i += 2) { - placeBlockAtCurrentPosition(world, ModBlocks.concrete_pillar, pillarMeta, i, 6, 6, box); - placeLamp(world, box, rand, i + 1, 6, 6); - } - placeBlockAtCurrentPosition(world, ModBlocks.concrete_pillar, pillarMeta, 12, 6, 6, box); - - if(expandsNX) { - fillWithMetadataBlocks(world, box, 0, 0, 3, 0, 0, 5, ModBlocks.vinyl_tile, 1); //Floor - fillWithBlocks(world, box, 0, 1, 1, 0, 1, 2, ModBlocks.reinforced_brick); //Wall - fillWithBlocks(world, box, 0, 2, 1, 0, 2, 2, ModBlocks.reinforced_stone); - fillWithBlocks(world, box, 0, 3, 1, 0, 3, 2, ModBlocks.reinforced_brick); - fillWithBlocks(world, box, 0, 4, 1, 0, 4, 11, ModBlocks.reinforced_brick); - fillWithBlocks(world, box, 0, 1, 6, 0, 1, 11, ModBlocks.reinforced_brick); - fillWithBlocks(world, box, 0, 2, 6, 0, 2, 11, ModBlocks.reinforced_stone); - fillWithBlocks(world, box, 0, 3, 6, 0, 3, 11, ModBlocks.reinforced_brick); - fillWithAir(world, box, 0, 1, 3, 0, 3, 5); - } else { - fillWithBlocks(world, box, 0, 1, 1, 0, 1, 11, ModBlocks.reinforced_brick); - fillWithBlocks(world, box, 0, 2, 1, 0, 2, 11, ModBlocks.reinforced_stone); - fillWithBlocks(world, box, 0, 3, 1, 0, 4, 11, ModBlocks.reinforced_brick); - } - - if(expandsPX) { - fillWithMetadataBlocks(world, box, 14, 0, 3, 14, 0, 5, ModBlocks.vinyl_tile, 1); //Floor - fillWithBlocks(world, box, 14, 1, 1, 14, 1, 2, ModBlocks.reinforced_brick); //Wall - fillWithBlocks(world, box, 14, 2, 1, 14, 2, 2, ModBlocks.reinforced_stone); - fillWithBlocks(world, box, 14, 3, 1, 14, 3, 2, ModBlocks.reinforced_brick); - fillWithBlocks(world, box, 14, 4, 1, 14, 4, 11, ModBlocks.reinforced_brick); - fillWithBlocks(world, box, 14, 1, 6, 14, 1, 11, ModBlocks.reinforced_brick); - fillWithBlocks(world, box, 14, 2, 6, 14, 2, 11, ModBlocks.reinforced_stone); - fillWithBlocks(world, box, 14, 3, 6, 14, 3, 11, ModBlocks.reinforced_brick); - fillWithAir(world, box, 14, 1, 3, 14, 3, 5); - } else { - fillWithBlocks(world, box, 14, 1, 1, 14, 1, 11, ModBlocks.reinforced_brick); - fillWithBlocks(world, box, 14, 2, 1, 14, 2, 11, ModBlocks.reinforced_stone); - fillWithBlocks(world, box, 14, 3, 1, 14, 4, 11, ModBlocks.reinforced_brick); - } - - //Decorations - switch(decorationType) { - case 0: - placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, getStairMeta(3), 1, 1, 8, box); //Bench 1 - placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, getStairMeta(1), 1, 1, 9, box); - placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, getStairMeta(2), 1, 1, 10, box); - placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, getStairMeta(3), 4, 1, 8, box); //Bench 2 - placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, getStairMeta(0), 4, 1, 9, box); - placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, getStairMeta(2), 4, 1, 10, box); - placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, getStairMeta(3), 10, 1, 8, box); //Bench 3 - placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, getStairMeta(1), 10, 1, 9, box); - placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, getStairMeta(2), 10, 1, 10, box); - placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, getStairMeta(3), 13, 1, 8, box); //Bench 4 - placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, getStairMeta(0), 13, 1, 9, box); - placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, getStairMeta(2), 13, 1, 10, box); - //Fountain - fillWithBlocks(world, box, 5, 1, 8, 5, 1, 11, ModBlocks.reinforced_brick); - fillWithBlocks(world, box, 6, 1, 7, 8, 1, 7, ModBlocks.reinforced_brick); - fillWithBlocks(world, box, 9, 1, 8, 9, 1, 11, ModBlocks.reinforced_brick); - fillWithBlocks(world, box, 7, 1, 9, 7, 2, 9, ModBlocks.concrete_pillar); - placeBlockAtCurrentPosition(world, ModBlocks.reinforced_light, 0, 7, 3, 9, box); - placeBlockAtCurrentPosition(world, Blocks.flowing_water, 0, 7, 4, 9, box); //meh! regular stronghold does it too - fillWithMetadataBlocks(world, box, 5, 2, 9, 5, 2, 10, ModBlocks.brick_slab, 1); - placeBlockAtCurrentPosition(world, ModBlocks.reinforced_brick_stairs, getStairMeta(2), 5, 2, 11, box); - fillWithMetadataBlocks(world, box, 9, 2, 9, 9, 2, 10, ModBlocks.brick_slab, 1); - placeBlockAtCurrentPosition(world, ModBlocks.reinforced_brick_stairs, getStairMeta(2), 9, 2, 11, box); - break; - case 1: - int stairMetaW = getStairMeta(0); - int stairMetaE = getStairMeta(1); - int stairMetaN = getStairMeta(2); - int stairMetaS = getStairMeta(3); - - //Right Planter - fillWithBlocks(world, box, 1, 1, 1, 4, 1, 1, Blocks.grass); - fillWithMetadataBlocks(world, box, 5, 1, 1, 5, 1, 2, ModBlocks.reinforced_brick_stairs, stairMetaE); - placeBlockAtCurrentPosition(world, ModBlocks.reinforced_brick, 0, 4, 1, 2, box); - if(!expandsNX) { - fillWithMetadataBlocks(world, box, 2, 1, 2, 3, 1, 2, ModBlocks.reinforced_brick_stairs, stairMetaS); - fillWithMetadataBlocks(world, box, 2, 1, 3, 2, 1, 5, ModBlocks.reinforced_brick_stairs, stairMetaE); - fillWithBlocks(world, box, 1, 1, 2, 1, 1, 5, Blocks.grass); - } else - fillWithMetadataBlocks(world, box, 1, 1, 2, 3, 1, 2, ModBlocks.reinforced_brick_stairs, stairMetaS); - //Left Planter - fillWithBlocks(world, box, 10, 1, 1, 13, 1, 1, Blocks.grass); - fillWithMetadataBlocks(world, box, 9, 1, 1, 9, 1, 2, ModBlocks.reinforced_brick_stairs, stairMetaW); - placeBlockAtCurrentPosition(world, ModBlocks.reinforced_brick, 0, 10, 1, 2, box); - if(!expandsPX) { - fillWithMetadataBlocks(world, box, 11, 1, 2, 12, 1, 2, ModBlocks.reinforced_brick_stairs, stairMetaS); - fillWithMetadataBlocks(world, box, 12, 1, 3, 12, 1, 5, ModBlocks.reinforced_brick_stairs, stairMetaW); - fillWithBlocks(world, box, 13, 1, 2, 13, 1, 5, Blocks.grass); - } else - fillWithMetadataBlocks(world, box, 11, 1, 2, 13, 1, 2, ModBlocks.reinforced_brick_stairs, stairMetaS); - //Main planter with conversation pits - fillWithBlocks(world, box, 1, 1, 7, 2, 1, 11, Blocks.grass); //Planter - fillWithBlocks(world, box, 7, 1, 8, 7, 1, 10, Blocks.grass); - fillWithBlocks(world, box, 12, 1, 7, 13, 1, 10, Blocks.grass); - fillWithBlocks(world, box, 3, 1, 11, 13, 1, 11, Blocks.grass); - fillWithBlocks(world, box, 1, 1, 6, 2, 1, 6, ModBlocks.reinforced_brick); - fillWithBlocks(world, box, 3, 1, 6, 3, 1, 7, ModBlocks.reinforced_brick); - fillWithMetadataBlocks(world, box, 6, 1, 7, 8, 1, 7, ModBlocks.reinforced_brick_stairs, stairMetaN); - fillWithBlocks(world, box, 11, 1, 6, 11, 1, 7, ModBlocks.reinforced_brick); - fillWithBlocks(world, box, 12, 1, 6, 13, 1, 6, ModBlocks.reinforced_brick); - for(int i = 3; i <= 8; i += 5) { //Conversation pits - fillWithMetadataBlocks(world, box, i, 1, 10, i + 3, 1, 10, Blocks.spruce_stairs, stairMetaN); - placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaE, i, 1, 9, box); - placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaS, i, 1, 8, box); - placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaW, i + 3, 1, 9, box); - placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaS, i + 3, 1, 8, box); - } - //Hanging lights - for(int i = 4; i <= 10; i += 3) { - fillWithBlocks(world, box, i, 4, 9, i, 5, 9, ModBlocks.chain); - placeBlockAtCurrentPosition(world, ModBlocks.reinforced_light, 0, i, 3, 9, box); - } - for(int i = 3; i <= 11; i += 8) { - fillWithBlocks(world, box, i, 4, 2, i, 5, 2, ModBlocks.chain); - placeBlockAtCurrentPosition(world, ModBlocks.reinforced_light, 0, i, 3, 2, box); - } - //Plant life - fillWithRandomizedBlocks(world, box, 1, 2, 1, 4, 2, 1, rand, plantSelector); - fillWithRandomizedBlocks(world, box, 10, 2, 1, 13, 2, 1, rand, plantSelector); - fillWithRandomizedBlocks(world, box, 1, 2, 7, 2, 2, 11, rand, plantSelector); - fillWithRandomizedBlocks(world, box, 3, 2, 11, 11, 2, 11, rand, plantSelector); - fillWithRandomizedBlocks(world, box, 12, 2, 7, 13, 2, 11, rand, plantSelector); - fillWithRandomizedBlocks(world, box, 7, 2, 8, 7, 2, 10, rand, plantSelector); - if(!expandsNX) fillWithRandomizedBlocks(world, box, 1, 2, 2, 1, 2, 5, rand, plantSelector); - if(!expandsPX) fillWithRandomizedBlocks(world, box, 13, 2, 2, 13, 2, 5, rand, plantSelector); - break; - } - - if(!underwater) - fillWithCobwebs(world, box, rand, 0, 1, 0, 14, 5, 12); - else { - fillWithWater(world, box, rand, 6, 1, 0, 8, 3, 0, 1); - fillWithWater(world, box, rand, 0, 1, 3, 0, 3, 5, 1); - fillWithWater(world, box, rand, 14, 1, 3, 14, 3, 5, 1); - fillWithWater(world, box, rand, 1, 1, 1, 13, 5, 11, 1); - } - - return true; - } - } - - /** Finds valid placement, using input information. Should be passed as a method reference to its respective Weight. */ - public static ProceduralComponent findValidPlacement(List components, Random rand, int x, int y, int z, int mode, int type) { - StructureBoundingBox box = getComponentToAddBoundingBox(x, y, z, -6, -1, 0, 15, 8, 13, mode); - return box.minY > 10 && StructureComponent.findIntersecting(components, box) == null ? new CenterCrossing(type, rand, box, mode) : null; - } - } - //This one will be a doozy public static class Reactor extends Bunker { @@ -984,9 +828,9 @@ public class BunkerComponents extends ProceduralComponents { @Override public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { - if(!underwater && isLiquidInStructureBoundingBox(world, boundingBox)) { + /*if(!underwater && isLiquidInStructureBoundingBox(world, boundingBox)) { return false; - } else { + } else {*/ fillWithAir(world, box, 5, 2, 0, 7, 4, 0); fillWithAir(world, box, 3, 1, 3, 9, 1, 9); fillWithAir(world, box, 1, 2, 1, 11, 7, 11); @@ -1169,7 +1013,7 @@ public class BunkerComponents extends ProceduralComponents { } return true; - } + //} } protected void makeConnection(World world, int x1, int y1, int z1, int x2, int y2, int z2) { @@ -1211,9 +1055,9 @@ public class BunkerComponents extends ProceduralComponents { @Override public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { - if(!underwater && isLiquidInStructureBoundingBox(world, boundingBox)) { + /*if(!underwater && isLiquidInStructureBoundingBox(world, boundingBox)) { return false; - } else { + } else {*/ fillWithAir(world, box, 4, 1, 0, 6, 3, 0); fillWithAir(world, box, 1, 1, 1, 9, 3, 9); @@ -1307,7 +1151,7 @@ public class BunkerComponents extends ProceduralComponents { fillWithCobwebs(world, box, rand, 1, 1, 0, 9, 3, 9); return true; - } + //} } @@ -1390,12 +1234,12 @@ public class BunkerComponents extends ProceduralComponents { StructureComponent component = getNextComponentNormal(instance, original, components, rand, 1, 1); extendsPZ = component != null; - if(rand.nextInt(2) == 0) { + if(rand.nextInt(3) > 0) { StructureComponent componentN = getNextComponentNX(instance, original, components, rand, 6, 1); expandsNX = componentN != null; } - if(rand.nextInt(2) == 0) { + if(rand.nextInt(3) > 0) { StructureComponent componentP = getNextComponentPX(instance, original, components, rand, 6, 1); expandsPX = componentP != null; } @@ -1404,9 +1248,9 @@ public class BunkerComponents extends ProceduralComponents { @Override public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { - if(!underwater && isLiquidInStructureBoundingBox(world, boundingBox)) { + /*if(!underwater && isLiquidInStructureBoundingBox(world, boundingBox)) { return false; - } else { + } else {*/ int end = extendsPZ ? 14 : 13; fillWithAir(world, box, 1, 1, 0, 3, 3, end); @@ -1474,7 +1318,7 @@ public class BunkerComponents extends ProceduralComponents { fillWithCobwebs(world, box, rand, expandsNX ? 0 : 1, 1, 0, expandsPX ? 4 : 3, 3, end); return true; - } + //} } /** Finds valid placement, using input information. Should be passed as a method reference to its respective Weight. */ @@ -1535,12 +1379,12 @@ public class BunkerComponents extends ProceduralComponents { flipConstituentBulkhead(component, rand); } - if(rand.nextInt(2) == 0) { + if(rand.nextInt(3) > 0) { StructureComponent componentN = getNextComponentNX(instance, original, components, rand, 6, 1); expandsNX = componentN != null; } - if(rand.nextInt(2) == 0) { + if(rand.nextInt(3) > 0) { StructureComponent componentP = getNextComponentPX(instance, original, components, rand, 6, 1); expandsPX = componentP != null; } @@ -1549,9 +1393,9 @@ public class BunkerComponents extends ProceduralComponents { @Override public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { - if(!underwater && isLiquidInStructureBoundingBox(world, boundingBox)) { + /*if(!underwater && isLiquidInStructureBoundingBox(world, boundingBox)) { return false; - } else { + } else {*/ int begin = bulkheadNZ ? 1 : 0; int end = bulkheadPZ ? 13 : 14; //for the bulkhead int endExtend = !extendsPZ ? 13 : 14; //for parts that would be cut off if it doesn't extend further @@ -1657,7 +1501,7 @@ public class BunkerComponents extends ProceduralComponents { fillWithCobwebs(world, box, rand, expandsNX ? 0 : 1, 1, 0, expandsPX ? 8 : 7, 3, endExtend); return true; - } + //} } } @@ -1737,9 +1581,9 @@ public class BunkerComponents extends ProceduralComponents { @Override public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { - if(!underwater && isLiquidInStructureBoundingBox(world, boundingBox)) { + /*if(!underwater && isLiquidInStructureBoundingBox(world, boundingBox)) { return false; - } else { + } else {*/ fillWithAir(world, box, 1, 1, 0, 3, 3, 3); //Floor @@ -1834,7 +1678,7 @@ public class BunkerComponents extends ProceduralComponents { fillWithCobwebs(world, box, rand, opensNX ? 0 : 1, 1, 0, opensPX ? 4 : 3, 3, opensPZ ? 4 : 3); return true; - } + //} } /** Finds valid placement, using input information. Should be passed as a method reference to its respective Weight. */ @@ -1842,8 +1686,13 @@ public class BunkerComponents extends ProceduralComponents { StructureBoundingBox box = getComponentToAddBoundingBox(x, y, z, -3, -1, 0, 9, 6, 9, mode); if(box.minY > 10 && StructureComponent.findIntersecting(components, box) == null) return new WideIntersection(type, rand, box, mode); - box = getComponentToAddBoundingBox(x, y, z, -1, -1, 0, 5, 6, 5, mode); - return box.minY > 10 && StructureComponent.findIntersecting(components, box) == null ? new Intersection(type, rand, box, mode) : null; + if(rand.nextInt(2) == 0) { + box = getComponentToAddBoundingBox(x, y, z, -1, -1, 0, 5, 6, 5, mode); + return box.minY > 10 && StructureComponent.findIntersecting(components, box) == null ? new Intersection(type, rand, box, mode) : null; + } else { + box = getComponentToAddBoundingBox(x, y, z, -1, -1, 0, 5, 6, 4, mode); + return box.minY > 10 && StructureComponent.findIntersecting(components, box) == null ? new DeadEnd(type, rand, box, mode) : null; + } } } @@ -1909,9 +1758,9 @@ public class BunkerComponents extends ProceduralComponents { @Override public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { - if(!underwater && isLiquidInStructureBoundingBox(world, boundingBox)) { + /*if(!underwater && isLiquidInStructureBoundingBox(world, boundingBox)) { return false; - } else { + } else {*/ int start = bulkheadNZ ? 1 : 0; int end = bulkheadPZ ? 7 : 8; @@ -2097,7 +1946,401 @@ public class BunkerComponents extends ProceduralComponents { fillWithCobwebs(world, box, rand, opensNX ? 0 : 1, 1, 0, opensPX ? 8 : 7, 3, opensPZ ? 8 : 7); return true; - } + //} } } + + //fuck you intersection stop clogging my vaults + public static class DeadEnd extends Bunker { + + BlockSelector plantSelector = new BlockSelector() { + public void selectBlocks(Random rand, int posX, int posY, int posZ, boolean notInterior) { + int chance = rand.nextInt(10); + + switch(chance) { + case 0: + this.field_151562_a = Blocks.yellow_flower; + break; + case 1: + case 2: + case 3: + case 4: + this.field_151562_a = Blocks.red_flower; + this.selectedBlockMetaData = rand.nextInt(9); + break; + case 5: + case 6: + this.field_151562_a = Blocks.tallgrass; + this.selectedBlockMetaData = rand.nextInt(2) + 1; + break; + default: + this.field_151562_a = Blocks.air; + } + } + }; + + int decorationType = 0; + + public DeadEnd() { } + + public DeadEnd(int componentType, Random rand, StructureBoundingBox box, int coordBaseMode) { + super(componentType); + this.coordBaseMode = coordBaseMode; + this.boundingBox = box; + this.decorationType = rand.nextInt(4); + } + + protected void func_143012_a(NBTTagCompound data) { + super.func_143012_a(data); + data.setInteger("decoration", decorationType); + } + + protected void func_143011_b(NBTTagCompound data) { + super.func_143011_b(data); + decorationType = data.getInteger("decoration"); + } + + @Override + public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { + /*if(!underwater && isLiquidInStructureBoundingBox(world, boundingBox)) { + return false; + } else {*/ + fillWithAir(world, box, 1, 1, 0, 3, 3, 2); + + //Floor + fillWithBlocks(world, box, 1, 0, 0, 3, 0, 2, ModBlocks.vinyl_tile); + //Wall + fillWithBlocks(world, box, 0, 1, 0, 0, 1, 2, ModBlocks.reinforced_brick); + fillWithBlocks(world, box, 0, 2, 0, 0, 2, 2, ModBlocks.reinforced_stone); + fillWithBlocks(world, box, 0, 3, 0, 0, 3, 2, ModBlocks.reinforced_brick); + fillWithBlocks(world, box, 1, 1, 3, 3, 1, 3, ModBlocks.reinforced_brick); + fillWithBlocks(world, box, 1, 2, 3, 3, 2, 3, ModBlocks.reinforced_stone); + fillWithBlocks(world, box, 1, 3, 3, 3, 3, 3, ModBlocks.reinforced_brick); + fillWithBlocks(world, box, 4, 1, 0, 4, 1, 2, ModBlocks.reinforced_brick); + fillWithBlocks(world, box, 4, 2, 0, 4, 2, 2, ModBlocks.reinforced_stone); + fillWithBlocks(world, box, 4, 3, 0, 4, 3, 2, ModBlocks.reinforced_brick); + //Ceiling + fillWithBlocks(world, box, 1, 4, 0, 1, 4, 2, ModBlocks.reinforced_brick); + placeBlockAtCurrentPosition(world, ModBlocks.reinforced_brick, 0, 2, 4, 2, box); + fillWithBlocks(world, box, 3, 4, 0, 3, 4, 2, ModBlocks.reinforced_brick); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_pillar, getPillarMeta(8), 2, 4, 0, box); + placeLamp(world, box, rand, 2, 4, 1); + + //Decoration + switch(this.decorationType) { + case 0: break; + case 1: + fillWithBlocks(world, box, 1, 1, 2, 3, 1, 2, Blocks.grass); + fillWithBlocks(world, box, 1, 1, 1, 3, 1, 1, ModBlocks.reinforced_brick); + fillWithRandomizedBlocks(world, box, 1, 2, 2, 3, 2, 2, rand, plantSelector); + break; + case 2: + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, getStairMeta(1), 1, 1, 2, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, getStairMeta(2), 2, 1, 2, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, getStairMeta(0), 3, 1, 2, box); + break; + case 3: + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, getStairMeta(1), 1, 1, 2, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, getStairMeta(0), 3, 1, 2, box); + placeBlockAtCurrentPosition(world, Blocks.fence, 0, 2, 1, 2, box); + placeBlockAtCurrentPosition(world, Blocks.heavy_weighted_pressure_plate, 0, 2, 2, 2, box); + break; + } + + if(underwater) + fillWithWater(world, box, rand, 1, 1, 0, 3, 3, 2, 1); + else + fillWithCobwebs(world, box, rand, 1, 1, 0, 3, 3, 2); + + return true; + //} + } + } + + public static class CenterCrossing extends Bunker { + + BlockSelector plantSelector = new BlockSelector() { + public void selectBlocks(Random rand, int posX, int posY, int posZ, boolean notInterior) { + int chance = rand.nextInt(10); + + switch(chance) { + case 0: + this.field_151562_a = Blocks.yellow_flower; + break; + case 1: + case 2: + case 3: + case 4: + this.field_151562_a = Blocks.red_flower; + this.selectedBlockMetaData = rand.nextInt(9); + break; + case 5: + case 6: + this.field_151562_a = Blocks.tallgrass; + this.selectedBlockMetaData = rand.nextInt(2) + 1; + break; + default: + this.field_151562_a = Blocks.air; + } + } + }; + + boolean expandsNX; + boolean expandsPX; + + int decorationType = 0; + + public CenterCrossing() { } + + public CenterCrossing(int componentType, Random rand, StructureBoundingBox box, int coordBaseMode) { + super(componentType); + this.coordBaseMode = coordBaseMode; + this.boundingBox = box; + this.decorationType = rand.nextInt(2); + } + + protected void func_143012_a(NBTTagCompound data) { + super.func_143012_a(data); + data.setBoolean("expandsNX", expandsNX); + data.setBoolean("expandsPX", expandsPX); + data.setInteger("decoration", decorationType); + } + + protected void func_143011_b(NBTTagCompound data) { + super.func_143011_b(data); + expandsNX = data.getBoolean("expandsNX"); + expandsPX = data.getBoolean("expandsPX"); + decorationType = data.getInteger("decoration"); + } + + @Override + public void buildComponent(ProceduralComponents instance, ControlComponent original, List components, Random rand) { + checkModifiers(original); + + StructureComponent componentN = getNextComponentNX(instance, original, components, rand, 3, 1); + expandsNX = componentN != null; + + StructureComponent componentP = getNextComponentPX(instance, original, components, rand, 7, 1); + expandsPX = componentP != null; + } + + @Override + public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { + + /*if(!underwater && isLiquidInStructureBoundingBox(world, boundingBox)) { + return false; + } else {*/ + fillWithAir(world, box, 6, 1, 0, 8, 3, 0); + fillWithAir(world, box, 1, 1, 1, 13, 3, 11); + fillWithAir(world, box, 2, 4, 2, 12, 5, 10); + + //Floor + fillWithMetadataBlocks(world, box, 6, 0, 0, 8, 0, 0, ModBlocks.vinyl_tile, 1); + fillWithBlocks(world, box, 1, 0, 1, 4, 0, 1, ModBlocks.vinyl_tile); + fillWithMetadataBlocks(world, box, 1, 0, 2, 5, 0, 2, ModBlocks.vinyl_tile, 1); + placeBlockAtCurrentPosition(world, ModBlocks.vinyl_tile, 1, 5, 0, 1, box); + fillWithBlocks(world, box, 6, 0, 1, 8, 0, 2, ModBlocks.vinyl_tile); + fillWithMetadataBlocks(world, box, 9, 0, 2, 13, 0, 2, ModBlocks.vinyl_tile, 1); + fillWithBlocks(world, box, 10, 0, 1, 13, 0, 1, ModBlocks.vinyl_tile); + placeBlockAtCurrentPosition(world, ModBlocks.vinyl_tile, 1, 9, 0, 1, box); + fillWithBlocks(world, box, 1, 0, 3, 13, 0, 5, ModBlocks.vinyl_tile); + fillWithBlocks(world, box, 1, 0, 7, 3, 0, 11, ModBlocks.vinyl_tile); + fillWithMetadataBlocks(world, box, 1, 0, 6, 13, 0, 6, ModBlocks.vinyl_tile, 1); + fillWithMetadataBlocks(world, box, 4, 0, 7, 10, 0, 11, ModBlocks.vinyl_tile, 1); + fillWithBlocks(world, box, 11, 0, 7, 13, 0, 11, ModBlocks.vinyl_tile); + //Wall + fillWithBlocks(world, box, 1, 1, 0, 5, 1, 0, ModBlocks.reinforced_brick); + fillWithBlocks(world, box, 1, 2, 0, 5, 2, 0, ModBlocks.reinforced_stone); + fillWithBlocks(world, box, 1, 3, 0, 5, 3, 0, ModBlocks.reinforced_brick); + fillWithBlocks(world, box, 1, 4, 0, 13, 4, 0, ModBlocks.reinforced_brick); + fillWithBlocks(world, box, 9, 1, 0, 13, 1, 0, ModBlocks.reinforced_brick); + fillWithBlocks(world, box, 9, 2, 0, 13, 2, 0, ModBlocks.reinforced_stone); + fillWithBlocks(world, box, 9, 3, 0, 13, 3, 0, ModBlocks.reinforced_brick); + fillWithBlocks(world, box, 1, 1, 12, 13, 1, 12, ModBlocks.reinforced_brick); + fillWithBlocks(world, box, 1, 2, 12, 13, 2, 12, ModBlocks.reinforced_stone); + fillWithBlocks(world, box, 1, 3, 12, 13, 4, 12, ModBlocks.reinforced_brick); + //Upper lining + for(int i = 1; i <= 11; i += 10) { + fillWithMetadataBlocks(world, box, 1, 4, i, 13, 4, i, ModBlocks.brick_slab, 8); + fillWithBlocks(world, box, 8, 5, i, 13, 5, i, ModBlocks.reinforced_brick); + placeLamp(world, box, rand, 7, 5, i); + fillWithBlocks(world, box, 1, 5, i, 6, 5, i, ModBlocks.reinforced_brick); + } + + for(int i = 1; i <= 13; i += 12) { + fillWithMetadataBlocks(world, box, i, 4, 2, i, 4, 10, ModBlocks.brick_slab, 8); + fillWithBlocks(world, box, i, 5, 2, i, 5, 5, ModBlocks.reinforced_brick); + placeLamp(world, box, rand, i, 5, 6); + fillWithBlocks(world, box, i, 5, 7, i, 5, 10, ModBlocks.reinforced_brick); + } + //Ceiling + int pillarMeta = getPillarMeta(4); + + fillWithBlocks(world, box, 2, 6, 2, 12, 6, 5, ModBlocks.reinforced_brick); + fillWithBlocks(world, box, 2, 6, 7, 12, 6, 10, ModBlocks.reinforced_brick); + for(int i = 2; i <= 10; i += 2) { + placeBlockAtCurrentPosition(world, ModBlocks.concrete_pillar, pillarMeta, i, 6, 6, box); + placeLamp(world, box, rand, i + 1, 6, 6); + } + placeBlockAtCurrentPosition(world, ModBlocks.concrete_pillar, pillarMeta, 12, 6, 6, box); + + if(expandsNX) { + fillWithMetadataBlocks(world, box, 0, 0, 3, 0, 0, 5, ModBlocks.vinyl_tile, 1); //Floor + fillWithBlocks(world, box, 0, 1, 1, 0, 1, 2, ModBlocks.reinforced_brick); //Wall + fillWithBlocks(world, box, 0, 2, 1, 0, 2, 2, ModBlocks.reinforced_stone); + fillWithBlocks(world, box, 0, 3, 1, 0, 3, 2, ModBlocks.reinforced_brick); + fillWithBlocks(world, box, 0, 4, 1, 0, 4, 11, ModBlocks.reinforced_brick); + fillWithBlocks(world, box, 0, 1, 6, 0, 1, 11, ModBlocks.reinforced_brick); + fillWithBlocks(world, box, 0, 2, 6, 0, 2, 11, ModBlocks.reinforced_stone); + fillWithBlocks(world, box, 0, 3, 6, 0, 3, 11, ModBlocks.reinforced_brick); + fillWithAir(world, box, 0, 1, 3, 0, 3, 5); + } else { + fillWithBlocks(world, box, 0, 1, 1, 0, 1, 11, ModBlocks.reinforced_brick); + fillWithBlocks(world, box, 0, 2, 1, 0, 2, 11, ModBlocks.reinforced_stone); + fillWithBlocks(world, box, 0, 3, 1, 0, 4, 11, ModBlocks.reinforced_brick); + } + + if(expandsPX) { + fillWithMetadataBlocks(world, box, 14, 0, 3, 14, 0, 5, ModBlocks.vinyl_tile, 1); //Floor + fillWithBlocks(world, box, 14, 1, 1, 14, 1, 2, ModBlocks.reinforced_brick); //Wall + fillWithBlocks(world, box, 14, 2, 1, 14, 2, 2, ModBlocks.reinforced_stone); + fillWithBlocks(world, box, 14, 3, 1, 14, 3, 2, ModBlocks.reinforced_brick); + fillWithBlocks(world, box, 14, 4, 1, 14, 4, 11, ModBlocks.reinforced_brick); + fillWithBlocks(world, box, 14, 1, 6, 14, 1, 11, ModBlocks.reinforced_brick); + fillWithBlocks(world, box, 14, 2, 6, 14, 2, 11, ModBlocks.reinforced_stone); + fillWithBlocks(world, box, 14, 3, 6, 14, 3, 11, ModBlocks.reinforced_brick); + fillWithAir(world, box, 14, 1, 3, 14, 3, 5); + } else { + fillWithBlocks(world, box, 14, 1, 1, 14, 1, 11, ModBlocks.reinforced_brick); + fillWithBlocks(world, box, 14, 2, 1, 14, 2, 11, ModBlocks.reinforced_stone); + fillWithBlocks(world, box, 14, 3, 1, 14, 4, 11, ModBlocks.reinforced_brick); + } + + //Decorations + int stairMetaW = getStairMeta(0); + int stairMetaE = getStairMeta(1); + int stairMetaN = getStairMeta(2); + int stairMetaS = getStairMeta(3); + + switch(decorationType) { + case 0: + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaS, 1, 1, 8, box); //Bench 1 + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaE, 1, 1, 9, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaN, 1, 1, 10, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaS, 4, 1, 8, box); //Bench 2 + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaW, 4, 1, 9, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaN, 4, 1, 10, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaS, 10, 1, 8, box); //Bench 3 + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaE, 10, 1, 9, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaN, 10, 1, 10, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaS, 13, 1, 8, box); //Bench 4 + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaW, 13, 1, 9, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaN, 13, 1, 10, box); + if(!expandsNX) { + for(int i = 3; i <= 5; i += 2) { + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaE, 2, 1, i, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaW, 4, 1, i, box); + placeBlockAtCurrentPosition(world, Blocks.fence, 0, 3, 1, i, box); + placeBlockAtCurrentPosition(world, Blocks.heavy_weighted_pressure_plate, 0, 3, 2, i, box); + } + } + if(!expandsPX) { + for(int i = 3; i <= 5; i += 2) { + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaE, 10, 1, i, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaW, 12, 1, i, box); + placeBlockAtCurrentPosition(world, Blocks.fence, 0, 11, 1, i, box); + placeBlockAtCurrentPosition(world, Blocks.heavy_weighted_pressure_plate, 0, 11, 2, i, box); + } + } + //Fountain + fillWithBlocks(world, box, 5, 1, 8, 5, 1, 11, ModBlocks.reinforced_brick); + fillWithBlocks(world, box, 6, 1, 7, 8, 1, 7, ModBlocks.reinforced_brick); + fillWithBlocks(world, box, 9, 1, 8, 9, 1, 11, ModBlocks.reinforced_brick); + fillWithBlocks(world, box, 7, 1, 9, 7, 2, 9, ModBlocks.concrete_pillar); + placeBlockAtCurrentPosition(world, ModBlocks.reinforced_light, 0, 7, 3, 9, box); + placeBlockAtCurrentPosition(world, Blocks.flowing_water, 0, 7, 4, 9, box); //meh! regular stronghold does it too + fillWithMetadataBlocks(world, box, 5, 2, 9, 5, 2, 10, ModBlocks.brick_slab, 1); + placeBlockAtCurrentPosition(world, ModBlocks.reinforced_brick_stairs, getStairMeta(2), 5, 2, 11, box); + fillWithMetadataBlocks(world, box, 9, 2, 9, 9, 2, 10, ModBlocks.brick_slab, 1); + placeBlockAtCurrentPosition(world, ModBlocks.reinforced_brick_stairs, getStairMeta(2), 9, 2, 11, box); + break; + case 1: + //Right Planter + fillWithBlocks(world, box, 1, 1, 1, 4, 1, 1, Blocks.grass); + fillWithMetadataBlocks(world, box, 5, 1, 1, 5, 1, 2, ModBlocks.reinforced_brick_stairs, stairMetaE); + placeBlockAtCurrentPosition(world, ModBlocks.reinforced_brick, 0, 4, 1, 2, box); + if(!expandsNX) { + fillWithMetadataBlocks(world, box, 2, 1, 2, 3, 1, 2, ModBlocks.reinforced_brick_stairs, stairMetaS); + fillWithMetadataBlocks(world, box, 2, 1, 3, 2, 1, 5, ModBlocks.reinforced_brick_stairs, stairMetaE); + fillWithBlocks(world, box, 1, 1, 2, 1, 1, 5, Blocks.grass); + } else + fillWithMetadataBlocks(world, box, 1, 1, 2, 3, 1, 2, ModBlocks.reinforced_brick_stairs, stairMetaS); + //Left Planter + fillWithBlocks(world, box, 10, 1, 1, 13, 1, 1, Blocks.grass); + fillWithMetadataBlocks(world, box, 9, 1, 1, 9, 1, 2, ModBlocks.reinforced_brick_stairs, stairMetaW); + placeBlockAtCurrentPosition(world, ModBlocks.reinforced_brick, 0, 10, 1, 2, box); + if(!expandsPX) { + fillWithMetadataBlocks(world, box, 11, 1, 2, 12, 1, 2, ModBlocks.reinforced_brick_stairs, stairMetaS); + fillWithMetadataBlocks(world, box, 12, 1, 3, 12, 1, 5, ModBlocks.reinforced_brick_stairs, stairMetaW); + fillWithBlocks(world, box, 13, 1, 2, 13, 1, 5, Blocks.grass); + } else + fillWithMetadataBlocks(world, box, 11, 1, 2, 13, 1, 2, ModBlocks.reinforced_brick_stairs, stairMetaS); + //Main planter with conversation pits + fillWithBlocks(world, box, 1, 1, 7, 2, 1, 11, Blocks.grass); //Planter + fillWithBlocks(world, box, 7, 1, 8, 7, 1, 10, Blocks.grass); + fillWithBlocks(world, box, 12, 1, 7, 13, 1, 10, Blocks.grass); + fillWithBlocks(world, box, 3, 1, 11, 13, 1, 11, Blocks.grass); + fillWithBlocks(world, box, 1, 1, 6, 2, 1, 6, ModBlocks.reinforced_brick); + fillWithBlocks(world, box, 3, 1, 6, 3, 1, 7, ModBlocks.reinforced_brick); + fillWithMetadataBlocks(world, box, 6, 1, 7, 8, 1, 7, ModBlocks.reinforced_brick_stairs, stairMetaN); + fillWithBlocks(world, box, 11, 1, 6, 11, 1, 7, ModBlocks.reinforced_brick); + fillWithBlocks(world, box, 12, 1, 6, 13, 1, 6, ModBlocks.reinforced_brick); + for(int i = 3; i <= 8; i += 5) { //Conversation pits + fillWithMetadataBlocks(world, box, i, 1, 10, i + 3, 1, 10, Blocks.spruce_stairs, stairMetaN); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaE, i, 1, 9, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaS, i, 1, 8, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaW, i + 3, 1, 9, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaS, i + 3, 1, 8, box); + } + //Hanging lights + for(int i = 4; i <= 10; i += 3) { + fillWithBlocks(world, box, i, 4, 9, i, 5, 9, ModBlocks.chain); + placeBlockAtCurrentPosition(world, ModBlocks.reinforced_light, 0, i, 3, 9, box); + } + for(int i = 3; i <= 11; i += 8) { + fillWithBlocks(world, box, i, 4, 2, i, 5, 2, ModBlocks.chain); + placeBlockAtCurrentPosition(world, ModBlocks.reinforced_light, 0, i, 3, 2, box); + } + //Plant life + fillWithRandomizedBlocks(world, box, 1, 2, 1, 4, 2, 1, rand, plantSelector); + fillWithRandomizedBlocks(world, box, 10, 2, 1, 13, 2, 1, rand, plantSelector); + fillWithRandomizedBlocks(world, box, 1, 2, 7, 2, 2, 11, rand, plantSelector); + fillWithRandomizedBlocks(world, box, 3, 2, 11, 11, 2, 11, rand, plantSelector); + fillWithRandomizedBlocks(world, box, 12, 2, 7, 13, 2, 11, rand, plantSelector); + fillWithRandomizedBlocks(world, box, 7, 2, 8, 7, 2, 10, rand, plantSelector); + if(!expandsNX) fillWithRandomizedBlocks(world, box, 1, 2, 2, 1, 2, 5, rand, plantSelector); + if(!expandsPX) fillWithRandomizedBlocks(world, box, 13, 2, 2, 13, 2, 5, rand, plantSelector); + break; + } + + if(!underwater) + fillWithCobwebs(world, box, rand, 0, 1, 0, 14, 5, 12); + else { + fillWithWater(world, box, rand, 6, 1, 0, 8, 3, 0, 1); + fillWithWater(world, box, rand, 0, 1, 3, 0, 3, 5, 1); + fillWithWater(world, box, rand, 14, 1, 3, 14, 3, 5, 1); + fillWithWater(world, box, rand, 1, 1, 1, 13, 5, 11, 1); + } + + return true; + //} + } + + /** Finds valid placement, using input information. Should be passed as a method reference to its respective Weight. */ + public static ProceduralComponent findValidPlacement(List components, Random rand, int x, int y, int z, int mode, int type) { + StructureBoundingBox box = getComponentToAddBoundingBox(x, y, z, -6, -1, 0, 15, 8, 13, mode); + return box.minY > 10 && StructureComponent.findIntersecting(components, box) == null ? new CenterCrossing(type, rand, box, mode) : null; + } + } + } \ No newline at end of file diff --git a/src/main/java/com/hbm/world/worldgen/components/CivilianFeatures.java b/src/main/java/com/hbm/world/worldgen/components/CivilianFeatures.java index 4110a1294..bbd9bab87 100644 --- a/src/main/java/com/hbm/world/worldgen/components/CivilianFeatures.java +++ b/src/main/java/com/hbm/world/worldgen/components/CivilianFeatures.java @@ -14,6 +14,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntityChest; import net.minecraft.util.WeightedRandomChestContent; import net.minecraft.world.World; +import net.minecraft.world.gen.structure.MapGenStructureIO; import net.minecraft.world.gen.structure.StructureBoundingBox; /* Described as "Civilian", as that's the overarching connection between all of these structures. Unlike the ruins, there's not enough to @@ -21,6 +22,14 @@ import net.minecraft.world.gen.structure.StructureBoundingBox; */ public class CivilianFeatures { + public static void registerComponents() { + MapGenStructureIO.func_143031_a(NTMHouse1.class, "NTMHouse1"); + MapGenStructureIO.func_143031_a(NTMHouse2.class, "NTMHouse2"); + MapGenStructureIO.func_143031_a(NTMLab1.class, "NTMLab1"); + MapGenStructureIO.func_143031_a(NTMLab2.class, "NTMLab2"); + MapGenStructureIO.func_143031_a(NTMWorkshop1.class, "NTMWorkshop1"); + } + /** Sandstone Ruin 1 */ public static class NTMHouse1 extends Component { diff --git a/src/main/java/com/hbm/world/worldgen/components/Component.java b/src/main/java/com/hbm/world/worldgen/components/Component.java index 858503387..88b8dd3bf 100644 --- a/src/main/java/com/hbm/world/worldgen/components/Component.java +++ b/src/main/java/com/hbm/world/worldgen/components/Component.java @@ -256,7 +256,7 @@ abstract public class Component extends StructureComponent { ItemDoor.placeDoorBlock(world, posX, posY, posZ, meta, door); } - //N:0 W:1 S:2 E:3 + /**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; int zOffset = 0; @@ -377,9 +377,9 @@ abstract public class Component extends StructureComponent { IInventory inventory = (IInventory) world.getTileEntity(posX, posY, posZ); if(inventory != null) { - ItemStack book = HbmChestContents.genetateBook(key); - - inventory.setInventorySlotContents(slot, book); + //ItemStack book = HbmChestContents.genetateBook(key); + //TODO: replace this with ItemBookLore version + //inventory.setInventorySlotContents(slot, book); } } diff --git a/src/main/java/com/hbm/world/worldgen/components/MilitaryBaseFeatures.java b/src/main/java/com/hbm/world/worldgen/components/MilitaryBaseFeatures.java deleted file mode 100644 index d24d2975b..000000000 --- a/src/main/java/com/hbm/world/worldgen/components/MilitaryBaseFeatures.java +++ /dev/null @@ -1,182 +0,0 @@ -package com.hbm.world.worldgen.components; - -import java.util.LinkedList; -import java.util.Random; - -import com.hbm.blocks.ModBlocks; - -import net.minecraft.init.Blocks; -import net.minecraft.world.World; -import net.minecraft.world.gen.structure.StructureBoundingBox; - -//These structures are... kind of? low quality, but they test out new methods so whatev. -//TODO: smite -public class MilitaryBaseFeatures { - - //stop-gap methods until this entire mess can be organized into proper classes/structure groups - public static void smallHelipad(LinkedList components, int chunkX, int posY, int chunkZ, Random rand) { - BasicHelipad helipad = new BasicHelipad(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); - int[] chunkPos = getAdjacentChunk(chunkX, chunkZ, rand); - - RadioShack radio = new RadioShack(rand, chunkPos[0] * 16 + 8, posY, chunkPos[1] * 16 + 8); - components.add(helipad); - components.add(radio); - } - - //ugh - public static int[] getAdjacentChunk(int chunkX, int chunkZ, Random rand) { - int[] chunkPos = new int[2]; - - switch(rand.nextInt(4)) { - case 0: - chunkPos[0] = chunkX; - chunkPos[1] = chunkZ + 1; - break; - case 1: - chunkPos[0] = chunkX - 1; - chunkPos[1] = chunkZ; - break; - case 2: - chunkPos[0] = chunkX; - chunkPos[1] = chunkZ - 1; - break; - case 3: - chunkPos[0] = chunkX + 1; - chunkPos[1] = chunkZ; - break; - } - - return chunkPos; - } - - public static class BasicHelipad extends Component { - - public BasicHelipad() { super(); } - - protected BasicHelipad(Random rand, int minX, int minY, int minZ) { - super(rand, minX, minY, minZ, 12, 0, 12); - } - - @Override - public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { - - if(!this.setAverageHeight(world, box, this.boundingBox.minY)) { - return true; - } - - this.boundingBox.offset(0, -1, 0); - - for(int i = 1; i < sizeX; i++) { - for(int j = 1; j < sizeZ; j++) { - clearCurrentPositionBlocksUpwards(world, i, 1, j, box); - } - } - - placeFoundationUnderneath(world, Blocks.stonebrick, 0, 1, 1, sizeX - 1, sizeZ - 1, -1, box); - - placeFoundationUnderneath(world, Blocks.stonebrick, 0, 0, 0, sizeX, 0, -1, box); - placeFoundationUnderneath(world, Blocks.stonebrick, 0, 0, 1, 0, sizeZ, -1, box); - placeFoundationUnderneath(world, Blocks.stonebrick, 0, sizeX, 1, sizeX, sizeZ, -1, box); - placeFoundationUnderneath(world, Blocks.stonebrick, 0, 1, sizeZ, sizeX - 1, sizeZ, -1, box); - - //Helipad - fillWithBlocks(world, box, 1, 0, 1, 11, 0, 1, ModBlocks.concrete, Blocks.air, false); //this entire time, the second block was actually for anything not at min/max x's, y's, and z's. useful! - fillWithBlocks(world, box, 11, 0, 2, 11, 0, 11, ModBlocks.concrete, Blocks.air, false); - fillWithBlocks(world, box, 1, 0, 11, 10, 0, 11, ModBlocks.concrete, Blocks.air, false); - fillWithBlocks(world, box, 1, 0, 2, 1, 0, 10, ModBlocks.concrete, Blocks.air, false); - - fillWithBlocks(world, box, 2, 0, 2, 10, 0, 10, ModBlocks.concrete_smooth, Blocks.air, false); //i'm not carefully carving out the white H lmao fuck that - fillWithBlocks(world, box, 4, 0, 4, 4, 0, 8, ModBlocks.concrete_colored, Blocks.air, false); //white is 0 - fillWithBlocks(world, box, 8, 0, 4, 8, 0, 8, ModBlocks.concrete_colored, Blocks.air, false); - fillWithBlocks(world, box, 5, 0, 6, 7, 0, 6, ModBlocks.concrete_colored, Blocks.air, false); - - //Surrounding Fences - placeBlocksOnTop(world, box, ModBlocks.fence_metal, 0, 0, sizeX, 0, 1); - placeBlocksOnTop(world, box, ModBlocks.fence_metal, sizeX, 1, sizeX, sizeZ, 1); - placeBlocksOnTop(world, box, ModBlocks.fence_metal, 0, sizeZ, sizeX - 1, sizeZ, 1); - placeBlocksOnTop(world, box, ModBlocks.fence_metal, 0, 1, 0, sizeZ - 1, 1); - - return false; - } - - } - - public static class RadioShack extends Component { - - private static LabTiles RandomLabTiles = new LabTiles(); - private static ConcreteBricks ConcreteBricks = new ConcreteBricks(); - - public RadioShack() { super(); } - - protected RadioShack(Random rand, int minX, int minY, int minZ) { - super(rand, minX, minY, minZ, 6, 4, 5); - } - - @Override - public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { - - if(!this.setAverageHeight(world, box, this.boundingBox.minY)) { - return true; - } - - this.boundingBox.offset(0, -1, 0); - - placeFoundationUnderneath(world, Blocks.stonebrick, 0, 1, 1, sizeX, sizeZ, -1, box); - placeFoundationUnderneath(world, Blocks.stonebrick, 0, 0, 2, 0, 2, 0, box); - - //Floor & Foundation - fillWithRandomizedBlocks(world, box, 2, 0, 1, 5, 0, 4, false, rand, RandomLabTiles); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_pillar, 0, 1, 0, 1, box); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_pillar, 0, sizeX, 0, 1, box); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_pillar, 0, 1, 0, sizeZ, box); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_pillar, 0, sizeX, 0, sizeZ, box); - fillWithBlocks(world, box, 2, 0, 1, sizeX - 1, 0, 1, ModBlocks.concrete_smooth, Blocks.air, false); - fillWithBlocks(world, box, 2, 0, 0, sizeX - 1, 0, 0, ModBlocks.concrete_smooth, Blocks.air, false); - fillWithBlocks(world, box, sizeX, 0, 2, sizeX, 0, sizeZ - 1, ModBlocks.concrete_smooth, Blocks.air, false); - fillWithBlocks(world, box, 2, 0, sizeZ, sizeX - 1, 0, sizeZ, ModBlocks.concrete_smooth, Blocks.air, false); - fillWithBlocks(world, box, 1, 0, 2, 1, 0, sizeZ - 1, ModBlocks.concrete_smooth, Blocks.air, false); - - //Back Wall - fillWithRandomizedBlocks(world, box, 1, 1, 1, 2, sizeY - 1, 1, false, rand, ConcreteBricks); - fillWithRandomizedBlocks(world, box, 2, 1, 0, 5, sizeY - 1, 0, false, rand, ConcreteBricks); - fillWithRandomizedBlocks(world, box, 5, 1, 1, sizeX, sizeY - 1, 1, false, rand, ConcreteBricks); - //Front Wall - fillWithRandomizedBlocks(world, box, 1, 1, sizeZ, 2, sizeY - 1, sizeZ, false, rand, ConcreteBricks); - placeBlockAtCurrentPosition(world, ModBlocks.brick_concrete, 0, 3, sizeY - 1, sizeZ, box); - fillWithRandomizedBlocks(world, box, 4, 1, sizeZ, sizeX, sizeY - 1, sizeZ, false, rand, ConcreteBricks); - placeDoor(world, box, ModBlocks.door_metal, 3, 3, 1, sizeZ); - //Left & Right Wall - fillWithRandomizedBlocks(world, box, 1, 1, 2, 1, sizeY - 1, sizeZ - 1, false, rand, ConcreteBricks); - fillWithRandomizedBlocks(world, box, sizeX, 1, 2, sizeX, sizeY - 1, sizeZ - 1, false, rand, ConcreteBricks); - placeBlockAtCurrentPosition(world, ModBlocks.reinforced_glass, 0, 1, 2, 3, box); - placeBlockAtCurrentPosition(world, ModBlocks.reinforced_glass, 0, sizeX, 2, 2, box); - placeBlockAtCurrentPosition(world, ModBlocks.reinforced_glass, 0, sizeX, 2, 4, box); - //Ceiling - fillWithBlocks(world, box, 3, sizeY - 1, 1, 4, sizeY - 1, 1, ModBlocks.concrete_smooth, Blocks.air, false); - fillWithBlocks(world, box, 2, sizeY - 1, 2, sizeX - 1, sizeY - 1, sizeZ - 1, ModBlocks.concrete_smooth, Blocks.air, false); - - fillWithAir(world, box, 2, 1, 2, sizeX - 1, 2, sizeZ - 1); - - //Decoration - int southMeta = getDecoMeta(2); - int northMeta = getDecoMeta(3); //all of these deco blocks are so inconsistent about what their directions actually are - int eastMeta = getDecoMeta(4); - fillWithMetadataBlocks(world, box, 2, 1, 2, 5, 1, 2, ModBlocks.steel_grate, 7, null, 0, false); //null should be okay here - fillWithBlocks(world, box, 3, 1, 1, 4, 1, 1, ModBlocks.deco_tungsten, null, false); - fillWithMetadataBlocks(world, box, 3, 2, 1, 4, 2, 1, ModBlocks.tape_recorder, northMeta, null, 0, false); - placeBlockAtCurrentPosition(world, ModBlocks.radiorec, southMeta, 2, 2, 2, box); - placeRandomBobble(world, box, rand, sizeX - 1, 2, 2); - fillWithMetadataBlocks(world, box, sizeX - 1, 1, 3, sizeX - 1, 2, 3, ModBlocks.tape_recorder, eastMeta, null, 0, false); - //OutsideDeco - fillWithMetadataBlocks(world, box, 0, 1, 2, 0, 2, 2, ModBlocks.steel_poles, eastMeta, null, 0, false); - placeBlockAtCurrentPosition(world, ModBlocks.pole_satellite_receiver, eastMeta, 0, sizeY - 1, 2, box); - fillWithBlocks(world, box, 0, sizeY, 2, sizeX - 1, sizeY, 2, ModBlocks.steel_roof, null, false); - placeBlockAtCurrentPosition(world, ModBlocks.steel_roof, 0, sizeX - 1, sizeY, 3, box); - - return false; - } - - } - - -} diff --git a/src/main/java/com/hbm/world/worldgen/components/OfficeFeatures.java b/src/main/java/com/hbm/world/worldgen/components/OfficeFeatures.java index 32c5bf866..ee632225a 100644 --- a/src/main/java/com/hbm/world/worldgen/components/OfficeFeatures.java +++ b/src/main/java/com/hbm/world/worldgen/components/OfficeFeatures.java @@ -10,11 +10,17 @@ import com.hbm.world.worldgen.components.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; //Oh my fucking god TM public class OfficeFeatures { + public static void registerComponents() { + MapGenStructureIO.func_143031_a(LargeOffice.class, "NTMLargeOffice"); + MapGenStructureIO.func_143031_a(LargeOfficeCorner.class, "NTMLargeOfficeCorner"); + } + public static class LargeOffice extends Component { private static ConcreteBricks ConcreteBricks = new ConcreteBricks(); @@ -50,7 +56,7 @@ public class OfficeFeatures { public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { if(!this.setAverageHeight(world, box, this.boundingBox.minY)) { - return true; + return false; } this.boundingBox.offset(0, -1, 0); @@ -210,7 +216,7 @@ public class OfficeFeatures { //TODO: add book with funny lore to safe, add cobwebs too //0b00/0 West, 0b01/1 East, 0b10/2 North, 0b11/3 South, 0b100/4 West UD, 0b101 East UD, 0b110 North UD, 0b111 South UD - return false; + return true; } } @@ -234,7 +240,7 @@ public class OfficeFeatures { public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { if(!this.setAverageHeight(world, box, this.boundingBox.minY)) { - return true; + return false; } this.boundingBox.offset(0, -1, 0); @@ -539,7 +545,7 @@ public class OfficeFeatures { //this hurt my soul - return false; //TODO: whoopsy! this should probably be true, with the failed ones being false! not necessary here since the structures always generate in one chunk + return true; } } diff --git a/src/main/java/com/hbm/world/worldgen/components/RuinFeatures.java b/src/main/java/com/hbm/world/worldgen/components/RuinFeatures.java index 6ba87e6fc..a04e2ca2c 100644 --- a/src/main/java/com/hbm/world/worldgen/components/RuinFeatures.java +++ b/src/main/java/com/hbm/world/worldgen/components/RuinFeatures.java @@ -6,10 +6,18 @@ import com.hbm.blocks.ModBlocks; import net.minecraft.init.Blocks; import net.minecraft.world.World; +import net.minecraft.world.gen.structure.MapGenStructureIO; import net.minecraft.world.gen.structure.StructureBoundingBox; public class RuinFeatures { + public static void registerComponents() { + MapGenStructureIO.func_143031_a(NTMRuin1.class, "NTMRuin1"); + MapGenStructureIO.func_143031_a(NTMRuin2.class, "NTMRuin2"); + MapGenStructureIO.func_143031_a(NTMRuin3.class, "NTMRuin3"); + MapGenStructureIO.func_143031_a(NTMRuin4.class, "NTMRuin4"); + } + public static class NTMRuin1 extends Component { private static ConcreteBricks RandomConcreteBricks = new ConcreteBricks();