MC-135506: Experience should save as Integers

A large orb will lose its EXP value if it went over 32k due to short truncation.
This commit is contained in:
Aikar 2018-08-03 00:07:02 -04:00
parent 56b92ff216
commit 38af7610e3
No known key found for this signature in database
GPG Key ID: 401ADFC9891FAAFE
1 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,30 @@
From 3ee5221ba7dae7751cd0ed9cdfacbf358484ae53 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
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