diff --git a/gradle.properties b/gradle.properties index 13858fd..9fde226 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,6 +9,6 @@ loader_version=0.11.6 fabric_version=0.36.1+1.17 # Mod Properties -mod_version=0.1.0 +mod_version=0.1.1 maven_group=xyz.nucleoid archives_base_name=map-templates diff --git a/src/main/java/xyz/nucleoid/map_templates/MapTemplate.java b/src/main/java/xyz/nucleoid/map_templates/MapTemplate.java index db615a4..dbc00d5 100644 --- a/src/main/java/xyz/nucleoid/map_templates/MapTemplate.java +++ b/src/main/java/xyz/nucleoid/map_templates/MapTemplate.java @@ -17,7 +17,6 @@ import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; import net.minecraft.util.registry.RegistryKey; -import net.minecraft.world.HeightLimitView; import net.minecraft.world.Heightmap; import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.BiomeKeys; @@ -173,17 +172,12 @@ public Stream getEntitiesInChunk(int chunkX, int chunkY, int chunkZ) } // TODO: store / lookup more efficiently? - public int getTopY(int x, int z, Heightmap.Type heightmap, HeightLimitView heightLimit) { + public int getTopY(int x, int z, Heightmap.Type heightmap) { var predicate = heightmap.getBlockPredicate(); - int maxY = heightLimit.getTopY(); - int minY = heightLimit.getBottomY(); - - var bounds = this.getBoundsOrNull(); - if (bounds != null) { - maxY = bounds.max().getY(); - minY = bounds.min().getY(); - } + var bounds = this.getBounds(); + int minY = bounds.min().getY(); + int maxY = bounds.max().getY(); var mutablePos = new BlockPos.Mutable(x, 0, z); for (int y = maxY; y >= minY; y--) { @@ -198,8 +192,8 @@ public int getTopY(int x, int z, Heightmap.Type heightmap, HeightLimitView heigh return 0; } - public BlockPos getTopPos(int x, int z, Heightmap.Type heightmap, HeightLimitView heightLimit) { - int y = this.getTopY(x, z, heightmap, heightLimit); + public BlockPos getTopPos(int x, int z, Heightmap.Type heightmap) { + int y = this.getTopY(x, z, heightmap); return new BlockPos(x, y, z); }