From 10610720ced7819afc77f6ebe3326fb04ae43edc Mon Sep 17 00:00:00 2001
From: Jake Potrebic <jake.m.potrebic@gmail.com>
Date: Wed, 22 Dec 2021 10:20:33 -0800
Subject: [PATCH] Load effect amplifiers greater than 127 correctly (#7175)

---
 ...mplifiers-greater-than-127-correctly.patch | 20 +++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 patches/server/Load-effect-amplifiers-greater-than-127-correctly.patch

diff --git a/patches/server/Load-effect-amplifiers-greater-than-127-correctly.patch b/patches/server/Load-effect-amplifiers-greater-than-127-correctly.patch
new file mode 100644
index 0000000000..c0f01db4d8
--- /dev/null
+++ b/patches/server/Load-effect-amplifiers-greater-than-127-correctly.patch
@@ -0,0 +1,20 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jake Potrebic <jake.m.potrebic@gmail.com>
+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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
+--- a/src/main/java/net/minecraft/world/effect/MobEffectInstance.java
++++ b/src/main/java/net/minecraft/world/effect/MobEffectInstance.java
+@@ -0,0 +0,0 @@ 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;