mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 15:30:19 +01:00
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:
parent
56b92ff216
commit
38af7610e3
1 changed files with 30 additions and 0 deletions
|
@ -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
|
||||
|
Loading…
Reference in a new issue