Correctly compare holders in BeaconMenu (#10673)

This commit is contained in:
Bjarne Koll 2024-05-08 03:18:57 +02:00 committed by GitHub
parent 89ad61fd00
commit eee55d019f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -328,7 +328,7 @@ index 08dcc94c9eca9a5fd61055f05b7737ba5840b5bf..e0e5046c84941a8d17e18c177f3daea9
return 1;
}
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
+++ b/src/main/java/net/minecraft/world/inventory/BeaconMenu.java
@@ -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) {
+ // 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();
+ }
+ // Paper end