mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
MapGenBunker
This commit is contained in:
parent
653ea24d86
commit
d36626b813
40
src/main/java/com/hbm/world/worldgen/MapGenBunker.java
Normal file
40
src/main/java/com/hbm/world/worldgen/MapGenBunker.java
Normal 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -145,7 +145,7 @@ public class MapGenNTMFeatures extends MapGenStructure {
|
|||||||
MilitaryBaseFeatures.smallHelipad(components, chunkX, posY, chunkZ, rand); //agggggggg
|
MilitaryBaseFeatures.smallHelipad(components, chunkX, posY, chunkZ, rand); //agggggggg
|
||||||
|
|
||||||
} else { //Everything else
|
} else { //Everything else
|
||||||
switch(rand.nextInt(4)) {
|
switch(rand.nextInt(3)) {
|
||||||
case 0:
|
case 0:
|
||||||
NTMLab2 lab2 = new NTMLab2(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8);
|
NTMLab2 lab2 = new NTMLab2(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8);
|
||||||
this.components.add(lab2); break;
|
this.components.add(lab2); break;
|
||||||
@ -155,9 +155,9 @@ public class MapGenNTMFeatures extends MapGenStructure {
|
|||||||
case 2:
|
case 2:
|
||||||
LargeOffice office = new LargeOffice(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8);
|
LargeOffice office = new LargeOffice(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8);
|
||||||
this.components.add(office); break;
|
this.components.add(office); break;
|
||||||
case 3:
|
/*case 3:
|
||||||
LargeOfficeCorner officeCorner = new LargeOfficeCorner(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8);
|
LargeOfficeCorner officeCorner = new LargeOfficeCorner(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8);
|
||||||
this.components.add(officeCorner); break;
|
this.components.add(officeCorner); break;*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -37,6 +37,10 @@ abstract public class Feature extends StructureComponent {
|
|||||||
super(0);
|
super(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected Feature(int componentType) {
|
||||||
|
super(componentType);
|
||||||
|
}
|
||||||
|
|
||||||
protected Feature(Random rand, int minX, int minY, int minZ, int maxX, int maxY, int maxZ ) {
|
protected Feature(Random rand, int minX, int minY, int minZ, int maxX, int maxY, int maxZ ) {
|
||||||
super(0);
|
super(0);
|
||||||
this.sizeX = maxX;
|
this.sizeX = maxX;
|
||||||
|
|||||||
@ -539,7 +539,7 @@ public class OfficeFeatures {
|
|||||||
|
|
||||||
//this hurt my soul
|
//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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user