diff options
author | Jake Potrebic <[email protected]> | 2021-12-22 10:20:33 -0800 |
---|---|---|
committer | GitHub <[email protected]> | 2021-12-22 10:20:33 -0800 |
commit | cf621c5eb3f0854458375e12f5bcec8065a68f76 (patch) | |
tree | 2fb7fbea92356d567ab712b8e1613ac0f8a5138c | |
parent | 82eaf4ee15d77303cdd352cce9b33c2f3e5d14d7 (diff) | |
download | Paper-cf621c5eb3f0854458375e12f5bcec8065a68f76.tar.gz Paper-cf621c5eb3f0854458375e12f5bcec8065a68f76.zip |
Load effect amplifiers greater than 127 correctly (#7175)
-rw-r--r-- | patches/server/0838-Load-effect-amplifiers-greater-than-127-correctly.patch | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/patches/server/0838-Load-effect-amplifiers-greater-than-127-correctly.patch b/patches/server/0838-Load-effect-amplifiers-greater-than-127-correctly.patch new file mode 100644 index 0000000000..f09e0d4b96 --- /dev/null +++ b/patches/server/0838-Load-effect-amplifiers-greater-than-127-correctly.patch @@ -0,0 +1,20 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jake Potrebic <[email protected]> +Date: Tue, 21 Dec 2021 22:13:26 -0800 +Subject: [PATCH] Load effect amplifiers greater than 127 correctly + +MOJIRA: MC-118857 + +diff --git a/src/main/java/net/minecraft/world/effect/MobEffectInstance.java b/src/main/java/net/minecraft/world/effect/MobEffectInstance.java +index 1493cff2087080a53210349e9d13e81594c24a04..0dadea0c9559d99c7de04dbda68b3e743c9eeecb 100644 +--- a/src/main/java/net/minecraft/world/effect/MobEffectInstance.java ++++ b/src/main/java/net/minecraft/world/effect/MobEffectInstance.java +@@ -235,7 +235,7 @@ public class MobEffectInstance implements Comparable<MobEffectInstance> { + } + + private static MobEffectInstance loadSpecifiedEffect(MobEffect type, CompoundTag nbt) { +- int i = nbt.getByte("Amplifier"); ++ int i = Byte.toUnsignedInt(nbt.getByte("Amplifier")); // Paper - correctly load amplifiers > 127 + int j = nbt.getInt("Duration"); + boolean bl = nbt.getBoolean("Ambient"); + boolean bl2 = true; |