Made it so Silver and Gold Dungeons can spawn at varying y-levels.

This commit is contained in:
bconlon 2020-07-15 00:46:30 -07:00
parent 742edf0138
commit b6d3027a53
6 changed files with 19 additions and 4 deletions

View file

@ -6,6 +6,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraft.world.gen.structure.MapGenStructure;
import net.minecraft.world.gen.structure.StructureComponent;
import net.minecraft.world.gen.structure.StructureStart;
import com.legacy.aether.world.gen.components.ComponentGoldenDungeon;
@ -82,9 +83,22 @@ public class MapGenGoldenDungeon extends MapGenStructure {
this.components.add(new ComponentGoldenDungeon((chunkX << 4) + 2, (chunkZ << 4) + 2, this.dungeonDirection));
this.customOffset(random);
this.updateBoundingBox();
}
private void customOffset(Random random)
{
int offset = random.nextInt(64);
for (Object object : this.components)
{
AetherStructure component = (AetherStructure) object;
component.getBoundingBox().offset(0, offset, 0);
}
}
@Override
public void func_143022_a(NBTTagCompound tagCompound) {
super.func_143022_a(tagCompound);

View file

@ -71,6 +71,7 @@ public class MapGenSilverDungeon extends MapGenStructure {
dungeon.setStaircasePosition(this.firstStaircaseZ, this.secondStaircaseZ, this.finalStaircaseZ);
dungeon.setCloudTendencies(this.xTendency, this.zTendency);
dungeon.getBoundingBox().offset(0, random.nextInt(64), 0);
this.components.add(dungeon);
this.updateBoundingBox();
}

View file

@ -22,7 +22,7 @@ public class ComponentGoldenDungeon extends AetherStructure {
public ComponentGoldenDungeon(int chunkX, int chunkZ, int direction) {
this.coordBaseMode = 0;
this.direction = direction;
this.boundingBox = new StructureBoundingBox(chunkX, 110, chunkZ, chunkX + 100, 146, chunkZ + 100);
this.boundingBox = new StructureBoundingBox(chunkX, 80, chunkZ, chunkX + 100, 220, chunkZ + 100);
}
@Override

View file

@ -17,7 +17,7 @@ public class ComponentGoldenIsland extends AetherStructure {
public ComponentGoldenIsland(int chunkX, int chunkZ) {
this.coordBaseMode = 0;
this.boundingBox = new StructureBoundingBox(chunkX, 110, chunkZ, chunkX + 100, 146, chunkZ + 100);
this.boundingBox = new StructureBoundingBox(chunkX, 80, chunkZ, chunkX + 100, 220, chunkZ + 100);
}
@Override

View file

@ -23,7 +23,7 @@ public class ComponentGoldenIslandStub extends AetherStructure {
this.z = z;
this.l = l;
this.coordBaseMode = 0;
this.boundingBox = new StructureBoundingBox(chunkX, 110, chunkZ, chunkX + 100, 146, chunkZ + 100);
this.boundingBox = new StructureBoundingBox(chunkX, 80, chunkZ, chunkX + 100, 220, chunkZ + 100);
}
@Override

View file

@ -37,7 +37,7 @@ public class ComponentSilverDungeon extends AetherStructure {
public ComponentSilverDungeon(int chunkX, int chunkZ) {
this.coordBaseMode = 0;
this.boundingBox = new StructureBoundingBox(chunkX, 100, chunkZ, chunkX + 100, 190, chunkZ + 100);
this.boundingBox = new StructureBoundingBox(chunkX, 80, chunkZ, chunkX + 100, 220, chunkZ + 100);
}
public void setStaircasePosition(int first, int second, int third) {