mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Merge pull request #2537 from Lazzzycatwastaken/master
Fix for floating superflat structures
This commit is contained in:
commit
f28ebbea5c
@ -473,6 +473,10 @@ public class NBTStructure {
|
||||
Block block = transformBlock(state.definition, null, world.rand);
|
||||
int meta = transformMeta(state.definition, null, coordBaseMode);
|
||||
|
||||
if(ry < 0 || ry >= world.getHeight()) continue;
|
||||
Block existing = world.getBlock(rx, ry, rz);
|
||||
if(existing == Blocks.bedrock) continue;
|
||||
|
||||
world.setBlock(rx, ry, rz, block, meta, 2);
|
||||
|
||||
if(state.nbt != null) {
|
||||
@ -546,6 +550,10 @@ public class NBTStructure {
|
||||
Block block = transformBlock(state.definition, piece.blockTable, world.rand);
|
||||
int meta = transformMeta(state.definition, piece.blockTable, coordBaseMode);
|
||||
|
||||
if(ry < 0 || ry >= world.getHeight()) continue;
|
||||
Block existing = world.getBlock(rx, ry, rz);
|
||||
if(existing == Blocks.bedrock) continue;
|
||||
|
||||
world.setBlock(rx, ry, rz, block, meta, 2);
|
||||
|
||||
if(state.nbt != null) {
|
||||
@ -801,7 +809,9 @@ public class NBTStructure {
|
||||
|
||||
// now we're in the world, update minY/maxY
|
||||
if(!piece.conformToTerrain && !heightUpdated) {
|
||||
int y = MathHelper.clamp_int(getAverageHeight(world, box) + piece.heightOffset, minHeight, maxHeight);
|
||||
int averageHeight = getAverageHeight(world, box) + piece.heightOffset;
|
||||
boolean isFlatWorld = world.getWorldInfo().getTerrainType() == net.minecraft.world.WorldType.FLAT;
|
||||
int y = isFlatWorld ? averageHeight : MathHelper.clamp_int(averageHeight, minHeight, maxHeight);
|
||||
|
||||
if(!piece.alignToTerrain) {
|
||||
parent.offsetYHeight(y);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user