diff --git a/leaf-server/minecraft-patches/features/0321-Leaves-Fork-cache-item-max-stack-size.patch b/leaf-server/minecraft-patches/features/0321-Leaves-Fork-cache-item-max-stack-size.patch index 7a1d27cbf..e5f98e9ed 100644 --- a/leaf-server/minecraft-patches/features/0321-Leaves-Fork-cache-item-max-stack-size.patch +++ b/leaf-server/minecraft-patches/features/0321-Leaves-Fork-cache-item-max-stack-size.patch @@ -9,7 +9,7 @@ Original license: GPL-3.0-only Original project: https://github.com/Lumine1909/Leaves_Fork diff --git a/net/minecraft/core/component/PatchedDataComponentMap.java b/net/minecraft/core/component/PatchedDataComponentMap.java -index b0967af2a3f85dad242ec7475ec9d4f7d7badfc7..a41e358035655236f4539a9fb2e5e1aff99cecb8 100644 +index b0967af2a3f85dad242ec7475ec9d4f7d7badfc7..d685efdb9241e2d82b5a270444d140646d2f4f3b 100644 --- a/net/minecraft/core/component/PatchedDataComponentMap.java +++ b/net/minecraft/core/component/PatchedDataComponentMap.java @@ -18,6 +18,7 @@ public final class PatchedDataComponentMap implements DataComponentMap, net.caff @@ -20,15 +20,21 @@ index b0967af2a3f85dad242ec7475ec9d4f7d7badfc7..a41e358035655236f4539a9fb2e5e1af private net.caffeinemc.mods.lithium.common.util.change_tracking.ChangeSubscriber subscriber; // Leaf - Lithium - equipment tracking public PatchedDataComponentMap(final DataComponentMap prototype) { -@@ -30,6 +31,7 @@ public final class PatchedDataComponentMap implements DataComponentMap, net.caff +@@ -30,6 +31,13 @@ public final class PatchedDataComponentMap implements DataComponentMap, net.caff this.prototype = prototype; this.patch = patch; this.copyOnWrite = copyOnWrite; -+ this.detectMaxStackSizeChange(null); // Leaves - cache item max stack size ++ // Leaves start - cache item max stack size ++ if (!prototype.isEmpty() || !patch.isEmpty()) { ++ detectMaxStackSizeChange(null); ++ } else { ++ this.maxStackSize = 1; ++ } ++ // Leaves end - cache item max stack size } public static PatchedDataComponentMap fromPatch(final DataComponentMap prototype, final DataComponentPatch patch) { -@@ -77,6 +79,7 @@ public final class PatchedDataComponentMap implements DataComponentMap, net.caff +@@ -77,6 +85,7 @@ public final class PatchedDataComponentMap implements DataComponentMap, net.caff lastValue = (Optional)this.patch.put(type, Optional.ofNullable(value)); } @@ -36,7 +42,7 @@ index b0967af2a3f85dad242ec7475ec9d4f7d7badfc7..a41e358035655236f4539a9fb2e5e1af return lastValue != null ? lastValue.orElse(defaultValue) : defaultValue; } -@@ -94,6 +97,7 @@ public final class PatchedDataComponentMap implements DataComponentMap, net.caff +@@ -94,6 +103,7 @@ public final class PatchedDataComponentMap implements DataComponentMap, net.caff lastValue = (Optional)this.patch.remove(type); } @@ -44,7 +50,7 @@ index b0967af2a3f85dad242ec7475ec9d4f7d7badfc7..a41e358035655236f4539a9fb2e5e1af return (T)(lastValue != null ? lastValue.orElse(null) : defaultValue); } -@@ -118,17 +122,20 @@ public final class PatchedDataComponentMap implements DataComponentMap, net.caff +@@ -118,17 +128,20 @@ public final class PatchedDataComponentMap implements DataComponentMap, net.caff } else { this.patch.remove(type); } @@ -65,7 +71,7 @@ index b0967af2a3f85dad242ec7475ec9d4f7d7badfc7..a41e358035655236f4539a9fb2e5e1af } public void setAll(final DataComponentMap components) { -@@ -266,4 +273,16 @@ public final class PatchedDataComponentMap implements DataComponentMap, net.caff +@@ -266,4 +279,16 @@ public final class PatchedDataComponentMap implements DataComponentMap, net.caff public String toString() { return "{" + this.stream().map(TypedDataComponent::toString).collect(Collectors.joining(", ")) + "}"; } diff --git a/leaf-server/minecraft-patches/features/0327-Lithium-Cache-retracting-piston-collision-shapes.patch b/leaf-server/minecraft-patches/features/0326-Lithium-Cache-retracting-piston-collision-shapes.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0327-Lithium-Cache-retracting-piston-collision-shapes.patch rename to leaf-server/minecraft-patches/features/0326-Lithium-Cache-retracting-piston-collision-shapes.patch diff --git a/leaf-server/minecraft-patches/features/0327-Configurable-locator-bar-max-distance.patch b/leaf-server/minecraft-patches/features/0328-Configurable-locator-bar-max-distance.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0327-Configurable-locator-bar-max-distance.patch rename to leaf-server/minecraft-patches/features/0328-Configurable-locator-bar-max-distance.patch