9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2025-12-19 14:59:32 +00:00
Files
LeavesMC/leaves-server/minecraft-patches/features/0003-Leaves-entity-ex-data.patch
Lumine1909 f09fbb247d 1.21.5 (#470)
---------

Co-authored-by: violetc <58360096+s-yh-china@users.noreply.github.com>
Co-authored-by: Fortern <blueten.ki@gmail.com>
Co-authored-by: MC_XiaoHei <xor7xiaohei@gmail.com>
Co-authored-by: Helvetica Volubi <88063803+Suisuroru@users.noreply.github.com>
Co-authored-by: MC_XiaoHei <xiaohei.xor7@outlook.com>
2025-06-05 18:41:51 +08:00

50 lines
2.3 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Lumine1909 <133463833+Lumine1909@users.noreply.github.com>
Date: Tue, 22 Apr 2025 23:32:41 +0800
Subject: [PATCH] Leaves entity ex data
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
index 81a18b8e605bd4c28b48a32c80be231609182970..f8d45c1076852a0553c3dd7c5512f76a6891e2cb 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
public boolean isTemporarilyActive;
public long activatedImmunityTick = Integer.MIN_VALUE;
+ private CompoundTag leavesData = new 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);
}
// 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);
}
// 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");
CrashReportCategory crashReportCategory = crashReport.addCategory("Entity being loaded");
@@ -5114,4 +5122,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
return ((ServerLevel) this.level()).isPositionEntityTicking(this.blockPosition());
}
// Paper end - Expose entity id counter
+ // Leaves start - leaves ex data
+ public CompoundTag getLeavesData() {
+ return leavesData;
+ }
+ // Leaves end - leaves ex data
}