9
0
mirror of https://github.com/BX-Team/DivineMC.git synced 2025-12-28 11:19:19 +00:00
Files
DivineMC/patches/server/0010-Fix-MC-2025.patch
NONPLAYT ebf82913c5 Updated Upstream (Purpur)
Upstream has released updates that appear to apply and compile correctly

Purpur Changes:
PurpurMC/Purpur@9efd5fc Updated Upstream (Paper)
PurpurMC/Purpur@ad910f8 Updated Upstream (Paper)
2024-06-24 14:09:30 +03:00

46 lines
2.5 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Sun, 11 Jun 2023 23:59:29 +0300
Subject: [PATCH] Fix MC-2025
Original post on Mojira: https://bugs.mojang.com/browse/MC-2025
Fix taken from Reddit: https://redd.it/8pgd4q
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 4a3a05324d1c732abc344c17242368a3cbaf81f3..7f1ec9f60cdd52eb6ddb6ad00542d9fa6eed03a6 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2481,6 +2481,17 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
nbttagcompound.putBoolean("Purpur.FireImmune", immuneToFire);
}
// Purpur end
+
+ // DivineMC start - Fix MC-2025
+ // This fix was taken from Reddit: https://redd.it/8pgd4q
+ 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("DivineMC.BoundingBox", boundingBoxList);
+ // DivineMC end
+
return nbttagcompound;
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.forThrowable(throwable, "Saving entity NBT");
@@ -2558,6 +2569,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
this.reapplyPosition();
}
+ // DivineMC start - Fix MC-2025
+ // This fix was taken from Reddit: https://redd.it/8pgd4q
+ if (nbt.contains("DivineMC.BoundingBox", net.minecraft.nbt.Tag.TAG_LIST)) {
+ ListTag boundingBoxList = nbt.getList("DivineMC.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)));
+ }
+ // DivineMC end
+
} else {
throw new IllegalStateException("Entity has invalid rotation");
}