diff --git a/src/main/java/com/hbm/world/worldgen/MapGenBunker.java b/src/main/java/com/hbm/world/worldgen/MapGenBunker.java new file mode 100644 index 000000000..e72ef51ea --- /dev/null +++ b/src/main/java/com/hbm/world/worldgen/MapGenBunker.java @@ -0,0 +1,40 @@ +package com.hbm.world.worldgen; + +import java.util.Random; + +import net.minecraft.world.World; +import net.minecraft.world.gen.structure.MapGenStructure; +import net.minecraft.world.gen.structure.StructureStart; + +public class MapGenBunker extends MapGenStructure { + + /** String ID for this MapGen */ + @Override + public String func_143025_a() { + return "NTMBunker"; + } + + @Override + protected boolean canSpawnStructureAtCoords(int chunkX, int chunkZ) { + return false; + } + + @Override + protected StructureStart getStructureStart(int chunkX, int chunkZ) { + return new Start(this.worldObj, this.rand, chunkX, chunkZ); + } + + public static class Start extends StructureStart { + + public Start() { } + + public Start(World world, Random rand, int chunkX, int chunkZ) { + super(chunkX, chunkZ); + + + this.updateBoundingBox(); + this.markAvailableHeight(world, rand, 10); + } + + } +} diff --git a/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java b/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java index 5e6b70789..e23fed89e 100644 --- a/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java +++ b/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java @@ -145,7 +145,7 @@ public class MapGenNTMFeatures extends MapGenStructure { MilitaryBaseFeatures.smallHelipad(components, chunkX, posY, chunkZ, rand); //agggggggg } else { //Everything else - switch(rand.nextInt(4)) { + switch(rand.nextInt(3)) { case 0: NTMLab2 lab2 = new NTMLab2(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); this.components.add(lab2); break; @@ -155,9 +155,9 @@ public class MapGenNTMFeatures extends MapGenStructure { case 2: LargeOffice office = new LargeOffice(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); this.components.add(office); break; - case 3: + /*case 3: LargeOfficeCorner officeCorner = new LargeOfficeCorner(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); - this.components.add(officeCorner); break; + this.components.add(officeCorner); break;*/ } } diff --git a/src/main/java/com/hbm/world/worldgen/components/BunkerComponents.java b/src/main/java/com/hbm/world/worldgen/components/BunkerComponents.java new file mode 100644 index 000000000..91b2a93d2 --- /dev/null +++ b/src/main/java/com/hbm/world/worldgen/components/BunkerComponents.java @@ -0,0 +1,37 @@ +package com.hbm.world.worldgen.components; + +import java.util.List; +import java.util.Random; + +import net.minecraft.world.gen.structure.StructureComponent; + +public class BunkerComponents { + + + + public abstract static class Bunker extends Feature { + + public Bunker() { } + + public Bunker(int componentType) { + super(componentType); //important to carry over, as it allows for hard limits on the amount of components. increment once for each new component. + } + + /** Gets next component in any direction.
'component' refers to the initial starting component (hard distance limits), 'components' refers to the StructureStart list. */ + protected StructureComponent getNextComponentNormal(StructureComponent component, List components, Random rand, int offset, int offsetY) { + switch(this.coordBaseMode) { + case 0: + //TODO: getNextValidComponent() + case 1: + + case 2: + + case 3: + + default: + return null; + } + } + + } +} 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 2042d2430..a9acc6d21 100644 --- a/src/main/java/com/hbm/world/worldgen/components/Feature.java +++ b/src/main/java/com/hbm/world/worldgen/components/Feature.java @@ -37,6 +37,10 @@ abstract public class Feature extends StructureComponent { super(0); } + protected Feature(int componentType) { + super(componentType); + } + protected Feature(Random rand, int minX, int minY, int minZ, int maxX, int maxY, int maxZ ) { super(0); this.sizeX = maxX; 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 36b72aa33..fddcd5037 100644 --- a/src/main/java/com/hbm/world/worldgen/components/OfficeFeatures.java +++ b/src/main/java/com/hbm/world/worldgen/components/OfficeFeatures.java @@ -539,7 +539,7 @@ public class OfficeFeatures { //this hurt my soul - return false; + 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 } }