3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 04:20:04 +01:00

Correctly compare holders in BeaconMenu (#10673)

Dieser Commit ist enthalten in:
Bjarne Koll 2024-05-08 03:18:57 +02:00 committet von GitHub
Ursprung 89ad61fd00
Commit eee55d019f
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: B5690EEEBB952194

Datei anzeigen

@ -328,7 +328,7 @@ index 08dcc94c9eca9a5fd61055f05b7737ba5840b5bf..e0e5046c84941a8d17e18c177f3daea9
return 1; return 1;
} }
diff --git a/src/main/java/net/minecraft/world/inventory/BeaconMenu.java b/src/main/java/net/minecraft/world/inventory/BeaconMenu.java diff --git a/src/main/java/net/minecraft/world/inventory/BeaconMenu.java b/src/main/java/net/minecraft/world/inventory/BeaconMenu.java
index 5b6133f6758d322713321b7e918db0c3e0d4be51..7098bd97a30131dd7180ec2a4d4b485e3c6f9405 100644 index 5b6133f6758d322713321b7e918db0c3e0d4be51..6173c689013ab02c83ca6ff1fde2b1e47f3e7820 100644
--- a/src/main/java/net/minecraft/world/inventory/BeaconMenu.java --- a/src/main/java/net/minecraft/world/inventory/BeaconMenu.java
+++ b/src/main/java/net/minecraft/world/inventory/BeaconMenu.java +++ b/src/main/java/net/minecraft/world/inventory/BeaconMenu.java
@@ -178,6 +178,11 @@ public class BeaconMenu extends AbstractContainerMenu { @@ -178,6 +178,11 @@ public class BeaconMenu extends AbstractContainerMenu {
@ -336,7 +336,7 @@ index 5b6133f6758d322713321b7e918db0c3e0d4be51..7098bd97a30131dd7180ec2a4d4b485e
public void updateEffects(Optional<Holder<MobEffect>> primary, Optional<Holder<MobEffect>> secondary) { public void updateEffects(Optional<Holder<MobEffect>> primary, Optional<Holder<MobEffect>> secondary) {
+ // Paper start - fix MC-174630 - validate secondary power + // Paper start - fix MC-174630 - validate secondary power
+ if (secondary.isPresent() && secondary.get().value() != net.minecraft.world.effect.MobEffects.REGENERATION && (primary.isPresent() && secondary.get() != primary.get())) { + if (secondary.isPresent() && secondary.get() != net.minecraft.world.effect.MobEffects.REGENERATION && (primary.isPresent() && secondary.get() != primary.get())) {
+ secondary = Optional.empty(); + secondary = Optional.empty();
+ } + }
+ // Paper end + // Paper end