Paper/patches/server/0719-Load-effect-amplifiers-greater-than-127-correctly.patch

21 lines
1.1 KiB
Diff
Raw Normal View History

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
2024-01-06 15:07:59 +01:00
index 758a9ddd3489be9502cd4e7f31b709c49ce9e009..bf304db1f9506d3e83d16cd632b9155c39346634 100644
--- a/src/main/java/net/minecraft/world/effect/MobEffectInstance.java
+++ b/src/main/java/net/minecraft/world/effect/MobEffectInstance.java
@@ -293,7 +293,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;