From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Taiyou06 Date: Fri, 8 Nov 2024 04:07:25 +0100 Subject: [PATCH] Better inline world height diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java index 3d6d0524784a2658b8f61b4797ca4bbee894885a..bb9cf7648826e512159549b6cc44521f3b7cc943 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -733,11 +733,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl // Gale start - Airplane - inline level height private final int minBuildHeight, levelHeightAccessorMinSection, height, maxBuildHeight, levelHeightAccessorMaxSection; - @Override public final int getMaxBuildHeight() { return this.maxBuildHeight; } - @Override public final int getMinSection() { return this.levelHeightAccessorMinSection; } - @Override public final int getMaxSection() { return this.levelHeightAccessorMaxSection; } - @Override public final int getMinBuildHeight() { return this.minBuildHeight; } - @Override public final int getHeight() { return this.height; } + @Override public final int getMaxBuildHeight() { return maxBuildHeight; } + @Override public final int getMinSection() { return levelHeightAccessorMinSection; } + @Override public final int getMaxSection() { return levelHeightAccessorMaxSection; } + @Override public final int getMinBuildHeight() { return minBuildHeight; } + @Override public final int getHeight() { return height; } // Gale end - Airplane - inline level height protected Level(WritableLevelData worlddatamutable, ResourceKey resourcekey, RegistryAccess iregistrycustom, Holder holder, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function paperWorldConfigCreator, java.util.function.Function galeWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - create paper world config & Anti-Xray // Gale - Gale configuration // Gale - Purpur - remove vanilla profiler this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot @@ -760,13 +760,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl this.dimensionTypeRegistration = holder; final DimensionType dimensionmanager = (DimensionType) holder.value(); - // Gale start - Airplane - inline level height - this.minBuildHeight = LevelAccessor.super.getMinBuildHeight(); - this.levelHeightAccessorMinSection = LevelAccessor.super.getMinSection(); - this.height = LevelAccessor.super.getHeight(); - this.maxBuildHeight = LevelAccessor.super.getMaxBuildHeight(); - this.levelHeightAccessorMaxSection = LevelAccessor.super.getMaxSection(); - // Gale end - Airplane - inline level height + // Gale start - Airplane - Pluto - inline level height + this.minBuildHeight = dimensionmanager.minY(); + this.levelHeightAccessorMinSection = SectionPos.blockToSectionCoord(dimensionmanager.minY()); + this.height = dimensionmanager.height(); + this.maxBuildHeight = dimensionmanager.minY() + dimensionmanager.height(); + this.levelHeightAccessorMaxSection = SectionPos.blockToSectionCoord((dimensionmanager.minY() + dimensionmanager.height()) - 1) + 1; + // Gale end - Airplane - Pluto - inline level height this.dimension = resourcekey; this.isClientSide = flag; if (dimensionmanager.coordinateScale() != 1.0D) {