9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-29 11:59:24 +00:00
Files
Leaf/patches/server/0053-Fix-MC-2025.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

43 lines
2.3 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: HaHaWTH <fsjk947@gmail.com>
Date: Wed, 13 Mar 2024 03:04:36 +0800
Subject: [PATCH] Fix MC-2025
Mojang issues: https://bugs.mojang.com/browse/MC-2025
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 8b314a1ad2bf833cee950471d63e5538192bb1ab..c0089483f2085b60fa34884885fa83915d5fc143 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2629,6 +2629,16 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
// Purpur end
nbttagcompound.put("Leaves.Data", leavesData); // Leaves - leaves ex data
+
+ // Leaf start - Fix MC-2025
+ AABB boundingBox = getBoundingBox();
+ ListTag boundingBoxList = new ListTag();
+ for (double coord : new double[]{boundingBox.minX, boundingBox.minY, boundingBox.minZ, boundingBox.maxX, boundingBox.maxY, boundingBox.maxZ}) {
+ boundingBoxList.add(DoubleTag.valueOf(coord));
+ }
+ nbttagcompound.put("Leaf.BoundingBox", boundingBoxList);
+ // Leaf end - Fix MC-2025
+
return nbttagcompound;
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.forThrowable(throwable, "Saving entity NBT");
@@ -2706,6 +2716,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
this.reapplyPosition();
}
+ // Leaf start - Fix MC-2025
+ if (nbt.contains("Leaf.BoundingBox", net.minecraft.nbt.Tag.TAG_LIST)) {
+ ListTag boundingBoxList = nbt.getList("Leaf.BoundingBox", net.minecraft.nbt.Tag.TAG_DOUBLE);
+ setBoundingBox(new AABB(boundingBoxList.getDouble(0), boundingBoxList.getDouble(1), boundingBoxList.getDouble(2), boundingBoxList.getDouble(3), boundingBoxList.getDouble(4), boundingBoxList.getDouble(5)));
+ }
+ // Leaf end - Fix MC-2025
+
} else {
throw new IllegalStateException("Entity has invalid rotation");
}