Paper/patches/server/0241-MC-135506-Experience-should-save-as-Integers.patch

29 lines
1.4 KiB
Diff
Raw Normal View History

2021-06-13 01:45:00 +02:00
From 0000000000000000000000000000000000000000 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/world/entity/ExperienceOrb.java b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
2022-03-01 06:43:03 +01:00
index 6bf6d6629dfb9338d3e34f433a5698904a2acdad..4848f26a006f4d4df620ded526134b3b39e90d29 100644
2021-06-13 01:45:00 +02:00
--- a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
+++ b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
2022-03-01 06:43:03 +01:00
@@ -284,7 +284,7 @@ public class ExperienceOrb extends Entity {
2021-06-13 01:45:00 +02:00
public void addAdditionalSaveData(CompoundTag nbt) {
nbt.putShort("Health", (short) this.health);
nbt.putShort("Age", (short) this.age);
- nbt.putShort("Value", (short) this.value);
+ nbt.putInt("Value", this.value); // Paper - save as Integer
nbt.putInt("Count", this.count);
this.savePaperNBT(nbt); // Paper
}
2022-03-01 06:43:03 +01:00
@@ -293,7 +293,7 @@ public class ExperienceOrb extends Entity {
2021-06-13 01:45:00 +02:00
public void readAdditionalSaveData(CompoundTag nbt) {
this.health = nbt.getShort("Health");
this.age = nbt.getShort("Age");
- this.value = nbt.getShort("Value");
+ this.value = nbt.getInt("Value"); // Paper - load as Integer
this.count = Math.max(nbt.getInt("Count"), 1);
this.loadPaperNBT(nbt); // Paper
}