From 38af7610e325f6ddccdbe1e64d2ce8f3a834805d Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 3 Aug 2018 00:07:02 -0400 Subject: [PATCH] MC-135506: Experience should save as Integers A large orb will lose its EXP value if it went over 32k due to short truncation. --- ...6-Experience-should-save-as-Integers.patch | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Spigot-Server-Patches/0347-MC-135506-Experience-should-save-as-Integers.patch diff --git a/Spigot-Server-Patches/0347-MC-135506-Experience-should-save-as-Integers.patch b/Spigot-Server-Patches/0347-MC-135506-Experience-should-save-as-Integers.patch new file mode 100644 index 000000000..c2eea1f08 --- /dev/null +++ b/Spigot-Server-Patches/0347-MC-135506-Experience-should-save-as-Integers.patch @@ -0,0 +1,30 @@ +From 3ee5221ba7dae7751cd0ed9cdfacbf358484ae53 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Fri, 3 Aug 2018 00:04:54 -0400 +Subject: [PATCH] MC-135506: Experience should save as Integers + + +diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java +index 1c59fd9661..c179fe516e 100644 +--- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java ++++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java +@@ -193,14 +193,14 @@ public class EntityExperienceOrb extends Entity { + public void b(NBTTagCompound nbttagcompound) { + nbttagcompound.setShort("Health", (short) this.d); + nbttagcompound.setShort("Age", (short) this.b); +- nbttagcompound.setShort("Value", (short) this.value); ++ nbttagcompound.setInt("Value", (short) this.value); // Paper - save as Integer + savePaperNBT(nbttagcompound); // Paper + } + + public void a(NBTTagCompound nbttagcompound) { + this.d = nbttagcompound.getShort("Health"); + this.b = nbttagcompound.getShort("Age"); +- this.value = nbttagcompound.getShort("Value"); ++ this.value = nbttagcompound.getInt("Value"); // Paper - load as Integer + loadPaperNBT(nbttagcompound); // Paper + } + +-- +2.18.0 +