9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2026-01-06 15:51:31 +00:00
Files
Leaf/leaf-server/minecraft-patches/features/0279-Lithium-combined-heightmap-update.patch
Dreeam f5b95a6716 Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@b0da38c2 Repository details in RuntimeException for MavenLibraryResolver#addRepository (#12939)
PaperMC/Paper@1922be90 Update custom tags (#12183)
PaperMC/Paper@79cf1353 Ignore HopperInventorySearchEvent when it has no listeners (#13009)
PaperMC/Paper@ea014f7a feat: add stuckEntityPoiRetryDelay config (#12949)
PaperMC/Paper@a9e76749 Support for showNotification in PlayerRecipeDiscoverEvent (#12992)
PaperMC/Paper@5622c9dd Expose attribute sentiment (#12974)
PaperMC/Paper@42b653b1 Expose more argument types (#12665)
PaperMC/Paper@52d9a221 [ci/skip] Fix typo in Display javadoc (#13010)
PaperMC/Paper@614e9acf Improve APIs around riptide tridents (#12996)
PaperMC/Paper@51706e5a Fixed DyeItem sheep dye hunk
2025-08-25 15:52:00 -04:00

61 lines
3.4 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Taiyou06 <kaandindar21@gmail.com>
Date: Wed, 30 Jul 2025 23:18:41 +0200
Subject: [PATCH] Lithium: combined heightmap update
This patch is based on the following mixins:
* "net/caffeinemc/mods/lithium/mixin/world/combined_heightmap_update/LevelChunkMixin"
By: 2No2Name <2No2Name@web.de>
As part of: Lithium (https://github.com/CaffeineMC/lithium)
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
diff --git a/net/minecraft/world/level/chunk/LevelChunk.java b/net/minecraft/world/level/chunk/LevelChunk.java
index c3ecdd80efad340c9fa0ea6913db9a3362b53ad4..e429932a044647f931443c6761d1b39e4eb7665c 100644
--- a/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/net/minecraft/world/level/chunk/LevelChunk.java
@@ -426,10 +426,13 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
}
// Leaf end - optimize random tick
Block block = state.getBlock();
- this.heightmaps.get(Heightmap.Types.MOTION_BLOCKING).update(i, y, i2, state);
- this.heightmaps.get(Heightmap.Types.MOTION_BLOCKING_NO_LEAVES).update(i, y, i2, state);
- this.heightmaps.get(Heightmap.Types.OCEAN_FLOOR).update(i, y, i2, state);
- this.heightmaps.get(Heightmap.Types.WORLD_SURFACE).update(i, y, i2, state);
+ // Leaf start - Lithium - combined heightmap update
+ Heightmap heightmap0 = this.heightmaps.get(Heightmap.Types.MOTION_BLOCKING);
+ Heightmap heightmap1 = this.heightmaps.get(Heightmap.Types.MOTION_BLOCKING_NO_LEAVES);
+ Heightmap heightmap2 = this.heightmaps.get(Heightmap.Types.OCEAN_FLOOR);
+ Heightmap heightmap3 = this.heightmaps.get(Heightmap.Types.WORLD_SURFACE);
+ net.caffeinemc.mods.lithium.common.world.chunk.heightmap.CombinedHeightmapUpdate.updateHeightmaps(heightmap0, heightmap1, heightmap2, heightmap3, this, i, y, i2, state);
+ // Leaf end - Lithium - combined heightmap update
boolean hasOnlyAir1 = section.hasOnlyAir();
if (hasOnlyAir != hasOnlyAir1) {
this.level.getChunkSource().getLightEngine().updateSectionStatus(pos, hasOnlyAir1);
diff --git a/net/minecraft/world/level/levelgen/Heightmap.java b/net/minecraft/world/level/levelgen/Heightmap.java
index f7b8637680e654dc0b3e8850d65081a1c565bb69..0d577548e4019d5914885415d903411b7f3d6ecb 100644
--- a/net/minecraft/world/level/levelgen/Heightmap.java
+++ b/net/minecraft/world/level/levelgen/Heightmap.java
@@ -40,6 +40,12 @@ public class Heightmap {
this.data = new SimpleBitStorage(i, 256);
}
+ // Leaf start - Lithium - combined heightmap update
+ public final Predicate<BlockState> isOpaque() {
+ return this.isOpaque;
+ }
+ // Leaf end - Lithium - combined heightmap update
+
public static void primeHeightmaps(ChunkAccess chunk, Set<Heightmap.Types> types) {
if (!types.isEmpty()) {
int size = types.size();
@@ -119,7 +125,7 @@ public class Heightmap {
return this.data.get(index) + this.chunk.getMinY();
}
- private void setHeight(int x, int z, int value) {
+ public void setHeight(int x, int z, int value) { // Leaf - Lithium - combined heightmap update - private -> public
this.data.set(getIndex(x, z), value - this.chunk.getMinY());
}