MapGenBunker

This commit is contained in:
Vaern 2022-09-30 22:48:48 -07:00
parent 653ea24d86
commit d36626b813
5 changed files with 85 additions and 4 deletions

View File

@ -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);
}
}
}

View File

@ -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;*/
}
}

View File

@ -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.<br>'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;
}
}
}
}

View File

@ -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;

View File

@ -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
}
}