aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0760-Load-effect-amplifiers-greater-than-127-correctly.patch
blob: 2b10cf2e71d3a2189176440ff6b1957e1034d75a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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 ddb369057bbfeb67c7825f7a93fa68d1c18eb6fc..14fab63346d56c72cd7534a04760efd10eef4295 100644
--- a/src/main/java/net/minecraft/world/effect/MobEffectInstance.java
+++ b/src/main/java/net/minecraft/world/effect/MobEffectInstance.java
@@ -286,7 +286,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;