mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-31 12:23:51 -07:00
[ci skip] Cleanup events (#10202)
This commit is contained in:
@@ -9,17 +9,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
--- a/src/main/java/net/minecraft/world/inventory/BeaconMenu.java
|
||||
+++ b/src/main/java/net/minecraft/world/inventory/BeaconMenu.java
|
||||
@@ -0,0 +0,0 @@ public class BeaconMenu extends AbstractContainerMenu {
|
||||
public MobEffect getSecondaryEffect() {
|
||||
return BeaconMenu.decodeEffect(this.beaconData.get(2));
|
||||
}
|
||||
|
||||
+ // Paper start - Add PlayerChangeBeaconEffectEvent
|
||||
+ private static @Nullable org.bukkit.potion.PotionEffectType convert(Optional<MobEffect> effect) {
|
||||
+ return effect.flatMap(net.minecraft.core.registries.BuiltInRegistries.MOB_EFFECT::getResourceKey).map(key -> {
|
||||
+ return org.bukkit.potion.PotionEffectType.getByKey(org.bukkit.craftbukkit.util.CraftNamespacedKey.fromMinecraft(key.location()));
|
||||
+ }).orElse(null);
|
||||
+ private static @Nullable org.bukkit.potion.PotionEffectType convert(Optional<MobEffect> optionalEffect) {
|
||||
+ return optionalEffect.map(org.bukkit.craftbukkit.potion.CraftPotionEffectType::minecraftToBukkit).orElse(null);
|
||||
+ }
|
||||
+ // Paper end - Add PlayerChangeBeaconEffectEvent
|
||||
|
||||
+
|
||||
public void updateEffects(Optional<MobEffect> primary, Optional<MobEffect> secondary) {
|
||||
if (this.paymentSlot.hasItem()) {
|
||||
- this.beaconData.set(1, BeaconMenu.encodeEffect((MobEffect) primary.orElse(null))); // CraftBukkit - decompile error
|
||||
|
Reference in New Issue
Block a user