9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-22 00:19:20 +00:00
Files
Leaf/patches/server/0029-Leaves-Server-Utils.patch
Dreeam e703cd5445 Update 1.20.6 (#49)
* Update Leaf API patches to 1.20.5

* Updated Upstream (Purpur API)

* Some server patches work

* Update 1.20.6

* Some server patches work

* Some some server patches work

* 0oO0oO0oOo

* iI1IiI1i|!il|

* Updated Upstream (Gale/Purpur)

* Server patches work

* Updated Upstream (Gale)
2024-05-01 12:08:20 -04:00

52 lines
2.5 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: violetc <58360096+s-yh-china@users.noreply.github.com>
Date: Tue, 13 Sep 2022 16:59:31 +0800
Subject: [PATCH] Leaves: Server Utils
Original license: GPLv3
Original project: https://github.com/LeavesMC/Leaves
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 7c347b26e9d65acbdc901a7197eee1a1cbb0be40..8b314a1ad2bf833cee950471d63e5538192bb1ab 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -431,6 +431,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
public boolean activatedPriorityReset = false; // Pufferfish - DAB
public int activatedPriority = org.dreeam.leaf.config.modules.opt.DynamicActivationofBrain.maximumActivationPrio; // Pufferfish - DAB (golf score)
public @Nullable Boolean immuneToFire = null; // Purpur - Fire immune API
+ private CompoundTag leavesData = new CompoundTag(); // Leaves - Leaves ex data
public void setOrigin(@javax.annotation.Nonnull Location location) {
this.origin = location.toVector();
@@ -2627,6 +2628,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
nbttagcompound.putBoolean("Purpur.FireImmune", immuneToFire);
}
// Purpur end
+ nbttagcompound.put("Leaves.Data", leavesData); // Leaves - leaves ex data
return nbttagcompound;
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.forThrowable(throwable, "Saving entity NBT");
@@ -2779,6 +2781,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
immuneToFire = nbt.getBoolean("Purpur.FireImmune");
}
// Purpur end
+ // Leaves start - leaves ex data
+ if (nbt.contains("Leaves.Data")) {
+ leavesData = nbt.getCompound("Leaves.Data");
+ }
+ // Leaves end - leaves ex data
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.forThrowable(throwable, "Loading entity NBT");
@@ -5217,4 +5224,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
return false;
}
// Purpur end
+
+ // Leaves start - leaves ex data
+ public CompoundTag getLeavesData() {
+ return leavesData;
+ }
+ // Leaves end - leaves ex data
}