9
0
mirror of https://github.com/Dreeam-qwq/Gale.git synced 2025-12-19 14:59:29 +00:00
Files
Gale/patches/server/0033-Inline-level-height.patch
2024-06-16 07:45:50 +08:00

67 lines
4.1 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Martijn Muijsers <martijnmuijsers@live.nl>
Date: Wed, 23 Nov 2022 22:41:54 +0100
Subject: [PATCH] Inline level height
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org
This patch is based on the following patch:
"Ensure level height is inlined"
By: Paul Sauve <paul@technove.co>
As part of: Airplane (https://github.com/TECHNOVE/Airplane)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
* Airplane copyright *
Airplane
Copyright (C) 2020 Technove LLC
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index d7a638680fa349caba43f07ab9e6e4fa7303fb48..13b38b21d0425527e1a83e655e6be4bd6c5c2a02 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -259,6 +259,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
}
// Paper end - rewrite chunk system
+ // 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; }
+ // Gale end - Airplane - inline level height
+
protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> 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<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.function.Function<org.spigotmc.SpigotWorldConfig, GaleWorldConfiguration> 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
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config
@@ -278,6 +287,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
this.dimension = resourcekey;
this.isClientSide = flag;
if (dimensionmanager.coordinateScale() != 1.0D) {