diff --git a/src/main/java/com/hbm/lib/HbmWorld.java b/src/main/java/com/hbm/lib/HbmWorld.java index 69294f45c..4f2c9444f 100644 --- a/src/main/java/com/hbm/lib/HbmWorld.java +++ b/src/main/java/com/hbm/lib/HbmWorld.java @@ -4,6 +4,7 @@ import com.hbm.world.worldgen.MapGenNTMFeatures; import com.hbm.world.worldgen.NTMWorldGenerator; import com.hbm.world.worldgen.components.CivilianFeatures.*; import com.hbm.world.worldgen.components.MilitaryBaseFeatures.*; +import com.hbm.world.worldgen.components.OfficeFeatures.*; import com.hbm.world.worldgen.components.RuinFeatures.*; import cpw.mods.fml.common.IWorldGenerator; @@ -46,5 +47,6 @@ public class HbmWorld { //aggggggggggg MapGenStructureIO.func_143031_a(BasicHelipad.class, "NTMBasicHelipad"); MapGenStructureIO.func_143031_a(RadioShack.class, "NTMRadioShack"); + MapGenStructureIO.func_143031_a(LargeOffice.class, "NTMLargeOffice"); } } diff --git a/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java b/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java index 59fe2c35c..02665da95 100644 --- a/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java +++ b/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java @@ -11,6 +11,7 @@ import com.hbm.config.StructureConfig; import com.hbm.world.worldgen.components.CivilianFeatures.*; import com.hbm.world.worldgen.components.MilitaryBaseFeatures; import com.hbm.world.worldgen.components.MilitaryBaseFeatures.*; +import com.hbm.world.worldgen.components.OfficeFeatures.*; import com.hbm.world.worldgen.components.RuinFeatures.*; import net.minecraft.world.World; @@ -107,7 +108,7 @@ public class MapGenNTMFeatures extends MapGenStructure { * chance/location fails for all other structures. Might not even be necessary, but whatever. * Rainfall & Temperature Check */ - + //TODO: Do something about this so it's nice-looking and easily readable. Plus, test compatibility against mods like BoP if(rand.nextBoolean()) { //Empty Ruin Structures switch(rand.nextInt(4)) { case 0: @@ -135,13 +136,21 @@ public class MapGenNTMFeatures extends MapGenStructure { NTMHouse2 house2 = new NTMHouse2(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); this.components.add(house2); } + } else if(biome.temperature >= 0.25 && biome.temperature <= 0.3 && biome.rainfall >= 0.6 && biome.rainfall <= 0.9) { //Taiga & Mega Taiga if(rand.nextBoolean()) { NTMWorkshop1 workshop1 = new NTMWorkshop1(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); this.components.add(workshop1); } - } else if(biome.heightVariation <= 0.2 && biome.rainfall <= 0.5 && !(biome instanceof BiomeGenBeach) && rand.nextBoolean()) { - MilitaryBaseFeatures.smallHelipad(components, chunkX, posY, chunkZ, rand); //agggggggg + + } else if(biome.heightVariation <= 0.2 && biome.rainfall <= 0.5 && !(biome instanceof BiomeGenBeach) && rand.nextBoolean()) { //Everything except jungles, extra-hilly areas, and beaches + //if(rand.nextBoolean()) + // MilitaryBaseFeatures.smallHelipad(components, chunkX, posY, chunkZ, rand); //agggggggg + //else { + LargeOffice office = new LargeOffice(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); + this.components.add(office); + //} + } else { //Everything else if(rand.nextBoolean()) { NTMLab2 lab2 = new NTMLab2(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); @@ -150,6 +159,7 @@ public class MapGenNTMFeatures extends MapGenStructure { NTMLab1 lab1 = new NTMLab1(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); this.components.add(lab1); } + } if(GeneralConfig.enableDebugMode) { diff --git a/src/main/java/com/hbm/world/worldgen/components/Feature.java b/src/main/java/com/hbm/world/worldgen/components/Feature.java index 54333f173..164526226 100644 --- a/src/main/java/com/hbm/world/worldgen/components/Feature.java +++ b/src/main/java/com/hbm/world/worldgen/components/Feature.java @@ -305,7 +305,7 @@ abstract public class Feature extends StructureComponent { } protected void randomlyFillWithBlocks(World world, StructureBoundingBox box, Random rand, float randLimit, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, Block block) { - this.randomlyFillWithBlocks(world, box, rand, randLimit, minX, minY, minZ, maxX, maxY, maxZ, block); + this.randomlyFillWithBlocks(world, box, rand, randLimit, minX, minY, minZ, maxX, maxY, maxZ, block, block, false); } protected void fillWithRandomizedBlocks(World world, StructureBoundingBox box, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, Random rand, BlockSelector selector) { diff --git a/src/main/java/com/hbm/world/worldgen/components/OfficeFeatures.java b/src/main/java/com/hbm/world/worldgen/components/OfficeFeatures.java index 46169e4d9..4faa80eae 100644 --- a/src/main/java/com/hbm/world/worldgen/components/OfficeFeatures.java +++ b/src/main/java/com/hbm/world/worldgen/components/OfficeFeatures.java @@ -58,11 +58,12 @@ public class OfficeFeatures { this.boundingBox.offset(0, -1, 0); //Pillars + //Back fillWithBlocks(world, box, 0, 0, 2, 0, 4, 2, ModBlocks.concrete_pillar); fillWithBlocks(world, box, 5, 0, 0, 5, 4, 0, ModBlocks.concrete_pillar); fillWithBlocks(world, box, sizeX, 0, 0, sizeX, 4, 0, ModBlocks.concrete_pillar); - - fillWithBlocks(world, box, 0, 0, 5, 0, 3, 5, ModBlocks.concrete_pillar); + //Front + fillWithBlocks(world, box, 0, 0, 7, 0, 3, 7, ModBlocks.concrete_pillar); fillWithBlocks(world, box, 0, 0, sizeZ, 0, 3, sizeZ, ModBlocks.concrete_pillar); fillWithBlocks(world, box, 3, 0, sizeZ, 3, 3, sizeZ, ModBlocks.concrete_pillar); fillWithBlocks(world, box, 6, 0, sizeZ, 6, 3, sizeZ, ModBlocks.concrete_pillar); @@ -97,8 +98,8 @@ public class OfficeFeatures { fillWithRandomizedBlocks(world, box, 1, 0, 7, 8, 0, 7, rand, ConcreteBricks); fillWithRandomizedBlocks(world, box, 1, 1, 7, 1, 2, 7, rand, ConcreteBricks); - fillWithRandomizedBlocks(world, box, 4, 1, 7, 8, 4, 7, rand, ConcreteBricks); - fillWithRandomizedBlocks(world, box, 1, 4, 7, 3, 4, 7, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 4, 1, 7, 8, 3, 7, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 1, 3, 7, 3, 3, 7, rand, ConcreteBricks); //Left fillWithRandomizedBlocks(world, box, 0, 4, 3, 0, 4, sizeZ - 1, rand, ConcreteBricks); fillWithRandomizedBlocks(world, box, 0, 0, 3, 0, 1, 6, rand, ConcreteBricks); @@ -109,17 +110,17 @@ public class OfficeFeatures { fillWithRandomizedBlocks(world, box, 5, 3, 6, 5, 3, 6, rand, ConcreteBricks); //Trim - randomlyFillWithBlocks(world, box, rand, 0.75F, 0, sizeY, 2, 5, sizeY, 2, Blocks.stone_slab); - randomlyFillWithBlocks(world, box, rand, 0.75F, 5, sizeY, 1, 5, sizeY, 1, Blocks.stone_slab); - randomlyFillWithBlocks(world, box, rand, 0.75F, 5, sizeY, 0, sizeX, sizeY, 0, Blocks.stone_slab); - randomlyFillWithBlocks(world, box, rand, 0.75F, sizeX, sizeY, 1, sizeX, sizeY, sizeZ, Blocks.stone_slab); - randomlyFillWithBlocks(world, box, rand, 0.75F, 0, sizeY, sizeZ, sizeX - 1, sizeY, sizeZ, Blocks.stone_slab); - randomlyFillWithBlocks(world, box, rand, 0.75F, 0, sizeY, 3, 0, sizeY, sizeZ - 1, Blocks.stone_slab); + randomlyFillWithBlocks(world, box, rand, 0.85F, 0, sizeY, 2, 5, sizeY, 2, Blocks.stone_slab); + randomlyFillWithBlocks(world, box, rand, 0.85F, 5, sizeY, 1, 5, sizeY, 1, Blocks.stone_slab); + randomlyFillWithBlocks(world, box, rand, 0.85F, 5, sizeY, 0, sizeX, sizeY, 0, Blocks.stone_slab); + randomlyFillWithBlocks(world, box, rand, 0.85F, sizeX, sizeY, 1, sizeX, sizeY, sizeZ, Blocks.stone_slab); + randomlyFillWithBlocks(world, box, rand, 0.85F, 0, sizeY, sizeZ, sizeX - 1, sizeY, sizeZ, Blocks.stone_slab); + randomlyFillWithBlocks(world, box, rand, 0.85F, 0, sizeY, 3, 0, sizeY, sizeZ - 1, Blocks.stone_slab); //Floor - fillWithMetadataBlocks(world, box, 1, 0, 3, 4, 6, hpos, Blocks.wool, 13); //Green Wool + fillWithMetadataBlocks(world, box, 1, 0, 3, 4, 0, 6, Blocks.wool, 13); //Green Wool fillWithBlocks(world, box, 5, 0, 3, 5, 0, 6, ModBlocks.brick_light); - fillWithBlocks(world, box, 1, 0, 1, sizeX - 1, 0, 6, ModBlocks.brick_light); + fillWithBlocks(world, box, 6, 0, 1, sizeX - 1, 0, 6, ModBlocks.brick_light); fillWithBlocks(world, box, 10, 0, 7, sizeX - 1, 0, sizeZ - 1, ModBlocks.brick_light); //Ceiling fillWithBlocks(world, box, 6, 4, 1, sizeX - 1, 4, 2, ModBlocks.brick_light); @@ -137,17 +138,17 @@ public class OfficeFeatures { randomlyFillWithBlocks(world, box, rand, 0.75F, sizeX - 3, 2, sizeZ, sizeX - 2, 2, sizeZ, Blocks.glass_pane); //Fuwnituwe >w< int stairMetaE = this.getMetadataWithOffset(Blocks.oak_stairs, 1); //East - int stairMetaN = this.getMetadataWithOffset(Blocks.oak_stairs, 2); //Nowth :3 - int stairMetaS = this.getMetadataWithOffset(Blocks.oak_stairs, 3); //South - int stairMetaWU = this.getMetadataWithOffset(Blocks.oak_stairs, 5); //West, Upside-down + int stairMetaS = this.getMetadataWithOffset(Blocks.oak_stairs, 2); //South + int stairMetaN = this.getMetadataWithOffset(Blocks.oak_stairs, 3); //Nowth :3 + int stairMetaWU = this.getMetadataWithOffset(Blocks.oak_stairs, 4); //West, Upside-down int stairMetaEU = this.getMetadataWithOffset(Blocks.oak_stairs, 5); //East, Upside-down int stairMetaNU = this.getMetadataWithOffset(Blocks.oak_stairs, 6); //Nowth, Upside-down uwu - int stairMetaSU = this.getMetadataWithOffset(Blocks.oak_stairs, 7); //South, Upside-down + int stairMetaSU = this.getMetadataWithOffset(Blocks.oak_stairs, 7); //South, Upside-down //Desk 1 :3 placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaEU, 1, 1, 4, box); - placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaEU, 2, 1, 4, box); - placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaNU, 3, 1, 4, box); - placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaS, 3, 1, 2, box); //Chaiw :3 + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaNU, 2, 1, 4, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaWU, 3, 1, 4, box); + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaS, 2, 1, 3, box); //Chaiw :3 placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, getDecoModelMeta(0), 1, 2, 4, box); //Nowth-facing Computer :33 //Desk 2 :3 placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaS, 7, 1, 3, box); //Chaiw :3 @@ -172,7 +173,7 @@ public class OfficeFeatures { //Desk 4 DX placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaEU, 10, 1, 8, box); placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaWU, 11, 1, 8, box); - placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaN, 10, 1, 9, box); //Chaiw ;3 + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaN, 10, 1, 9, box); //Chaiw ;3 placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, getDecoModelMeta(1), 10, 2, 8, box); //South-facing Computer :33 //Desk 5 :333 placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaSU, sizeX - 1, 1, sizeZ - 3, box); @@ -181,14 +182,21 @@ public class OfficeFeatures { placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaE, sizeX - 3, 1, sizeZ - 1, box); //UwU... Chaiw!!!! :333 I wove chaiws XD :333 OwO what's this?? chaiw???? :333333333333333333 placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, getDecoModelMeta(2), sizeX - 1, 2, sizeZ - 1, box); //West-facing Computer >w< //Cobwebs pwobabwy + //Maybe make a method for this eventually? + //Something where the tops of ceilings + empty corners along walls get most cobwebs, + //with no cobwebs hanging midair + it not being performance intensive + randomlyFillWithBlocks(world, box, rand, 0.25F, 1, 3, 3, 4, 3, 6, Blocks.web); + randomlyFillWithBlocks(world, box, rand, 0.25F, 6, 3, 1, sizeX - 1, 3, 6, Blocks.web); + randomlyFillWithBlocks(world, box, rand, 0.25F, 10, 3, 7, sizeX - 1, 3, sizeZ - 1, Blocks.web); //Woot if(!this.hasPlacedLoot[0]) this.hasPlacedLoot[0] = generateInvContents(world, box, rand, Blocks.chest, sizeX - 4, 1, sizeZ - 1, HbmChestContents.officeTrash, 10); if(!this.hasPlacedLoot[1]) - this.hasPlacedLoot[1] = generateLockableContents(world, box, rand, ModBlocks.safe, 6, 1, 1, null, 10, 0.2D); + this.hasPlacedLoot[1] = generateLockableContents(world, box, rand, ModBlocks.safe, 6, 1, 1, HbmChestContents.machineParts, 10, 0.5D); //TODO: add book with funny lore to safe, add cobwebs too + //0b00/0 West, 0b01/1 East, 0b10/2 North, 0b11/3 South, 0b100/4 West UD, 0b101 East UD, 0b110 North UD, 0b111 South UD return false; }