mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-01 12:42:05 -07:00
Prepare for 1.19 dev
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
||||
Date: Wed, 24 Jun 2020 15:14:51 -0600
|
||||
Subject: [PATCH] Added firing of PlayerChangeBeaconEffectEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/inventory/BeaconMenu.java b/src/main/java/net/minecraft/world/inventory/BeaconMenu.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- 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 void updateEffects(int primaryEffectId, int secondaryEffectId) {
|
||||
if (this.paymentSlot.hasItem()) {
|
||||
- this.beaconData.set(1, primaryEffectId);
|
||||
- this.beaconData.set(2, secondaryEffectId);
|
||||
+ // Paper start
|
||||
+ io.papermc.paper.event.player.PlayerChangeBeaconEffectEvent event = new io.papermc.paper.event.player.PlayerChangeBeaconEffectEvent((org.bukkit.entity.Player) this.player.player.getBukkitEntity(), org.bukkit.potion.PotionEffectType.getById(primaryEffectId), org.bukkit.potion.PotionEffectType.getById(secondaryEffectId), this.access.getLocation().getBlock());
|
||||
+ if (event.callEvent()) {
|
||||
+ this.beaconData.set(1, event.getPrimary() == null ? 0 : event.getPrimary().getId());
|
||||
+ this.beaconData.set(2, event.getSecondary() == null ? 0 : event.getSecondary().getId());
|
||||
+ if (!event.willConsumeItem()) return;
|
||||
this.paymentSlot.remove(1);
|
||||
this.access.execute(Level::blockEntityChanged);
|
||||
+ }
|
||||
+ // Paper end
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user