From f1b921c86dc98b4fc3f8c71365479ddcf38f4c63 Mon Sep 17 00:00:00 2001 From: Lumine1909 <133463833+Lumine1909@users.noreply.github.com> Date: Wed, 2 Jul 2025 22:49:43 -0700 Subject: [PATCH] 0003/0132 --- .../features}/0003-Leaves-Utils.patch | 36 +++++++++---------- 1 file changed, 16 insertions(+), 20 deletions(-) rename leaves-server/{unapplied => minecraft-patches/features}/0003-Leaves-Utils.patch (70%) diff --git a/leaves-server/unapplied/0003-Leaves-Utils.patch b/leaves-server/minecraft-patches/features/0003-Leaves-Utils.patch similarity index 70% rename from leaves-server/unapplied/0003-Leaves-Utils.patch rename to leaves-server/minecraft-patches/features/0003-Leaves-Utils.patch index 62959243..a1e02a6e 100644 --- a/leaves-server/unapplied/0003-Leaves-Utils.patch +++ b/leaves-server/minecraft-patches/features/0003-Leaves-Utils.patch @@ -5,39 +5,35 @@ Subject: [PATCH] Leaves Utils diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java -index 81a18b8e605bd4c28b48a32c80be231609182970..f8d45c1076852a0553c3dd7c5512f76a6891e2cb 100644 +index 3d2c0a4d3a1f9d3e5cc6cd0cdb988ae1205de821..910bec7cbb2ef140ab16d99f93859326b5475a25 100644 --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java -@@ -351,6 +351,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -372,6 +372,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess public boolean isTemporarilyActive; public long activatedImmunityTick = Integer.MIN_VALUE; -+ private CompoundTag leavesData = new CompoundTag(); // Leaves - Leaves ex data ++ private net.minecraft.nbt.CompoundTag leavesData = new net.minecraft.nbt.CompoundTag(); // Leaves - Leaves ex data + public void inactiveTick() { } // Paper end - EAR 2 -@@ -2516,6 +2518,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess - compound.putBoolean("Paper.FreezeLock", true); +@@ -2585,6 +2587,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess + output.putBoolean("Paper.FreezeLock", true); } // Paper end -+ compound.put("Leaves.Data", leavesData); // Leaves - leaves ex data - return compound; - } catch (Throwable var8) { - CrashReport crashReport = CrashReport.forThrowable(var8, "Saving entity NBT"); -@@ -2646,6 +2649,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess - freezeLocked = compound.getBooleanOr("Paper.FreezeLock", false); ++ output.store("Leaves.Data", net.minecraft.nbt.CompoundTag.CODEC, leavesData); // Leaves - leaves ex data + } catch (Throwable var7) { + CrashReport crashReport = CrashReport.forThrowable(var7, "Saving entity NBT"); + CrashReportCategory crashReportCategory = crashReport.addCategory("Entity being saved"); +@@ -2705,6 +2708,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } + freezeLocked = input.getBooleanOr("Paper.FreezeLock", false); // Paper end -+ // Leaves start - leaves ex data -+ if (compound.contains("Leaves.Data")) { -+ leavesData = compound.getCompoundOrEmpty("Leaves.Data"); -+ } -+ // Leaves end - leaves ex data - } catch (Throwable var8) { - CrashReport crashReport = CrashReport.forThrowable(var8, "Loading entity NBT"); ++ leavesData = input.read("Leaves.Data", net.minecraft.nbt.CompoundTag.CODEC).orElse(new net.minecraft.nbt.CompoundTag()); + } catch (Throwable var7) { + CrashReport crashReport = CrashReport.forThrowable(var7, "Loading entity NBT"); CrashReportCategory crashReportCategory = crashReport.addCategory("Entity being loaded"); -@@ -5114,4 +5122,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -5365,4 +5369,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess return ((ServerLevel) this.level()).isPositionEntityTicking(this.blockPosition()); } // Paper end - Expose entity id counter @@ -48,7 +44,7 @@ index 81a18b8e605bd4c28b48a32c80be231609182970..f8d45c1076852a0553c3dd7c5512f76a + // Leaves end - leaves ex data } diff --git a/net/minecraft/world/level/block/Block.java b/net/minecraft/world/level/block/Block.java -index ae3e6e31171b1bcfba1ae51a0941b52dda270acd..f289e37f77e1c9d3b0f6c29da1b99f0d5f156e37 100644 +index be6f37f91569c659c609e5e8d38671ca86f8cd95..958914e40fceda5d67a98154817b4c5ce478a62d 100644 --- a/net/minecraft/world/level/block/Block.java +++ b/net/minecraft/world/level/block/Block.java @@ -610,6 +610,13 @@ public class Block extends BlockBehaviour implements ItemLike {