2021-01-17 21:21:31 +01:00
|
|
|
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
|
|
|
|
|
|
|
|
|
2021-03-16 08:19:45 +01:00
|
|
|
diff --git a/src/main/java/net/minecraft/world/inventory/ContainerBeacon.java b/src/main/java/net/minecraft/world/inventory/ContainerBeacon.java
|
2021-01-17 21:21:31 +01:00
|
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
2021-03-16 08:19:45 +01:00
|
|
|
--- a/src/main/java/net/minecraft/world/inventory/ContainerBeacon.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/inventory/ContainerBeacon.java
|
|
|
|
@@ -0,0 +0,0 @@ import net.minecraft.world.entity.player.PlayerInventory;
|
|
|
|
import org.bukkit.craftbukkit.inventory.CraftInventoryView;
|
|
|
|
// CraftBukkit end
|
2021-01-17 21:21:31 +01:00
|
|
|
|
|
|
|
+// Paper start
|
|
|
|
+import io.papermc.paper.event.player.PlayerChangeBeaconEffectEvent;
|
|
|
|
+// Paper end
|
2021-03-16 08:19:45 +01:00
|
|
|
+
|
2021-01-17 21:21:31 +01:00
|
|
|
public class ContainerBeacon extends Container {
|
|
|
|
|
2021-03-16 08:19:45 +01:00
|
|
|
private final IInventory beacon;
|
2021-01-17 21:21:31 +01:00
|
|
|
@@ -0,0 +0,0 @@ public class ContainerBeacon extends Container {
|
|
|
|
|
|
|
|
public void c(int i, int j) {
|
|
|
|
if (this.d.hasItem()) {
|
|
|
|
- this.containerProperties.setProperty(1, i);
|
|
|
|
- this.containerProperties.setProperty(2, j);
|
|
|
|
+ // Paper start
|
|
|
|
+ PlayerChangeBeaconEffectEvent event = new PlayerChangeBeaconEffectEvent((org.bukkit.entity.Player) this.player.player.getBukkitEntity(), org.bukkit.potion.PotionEffectType.getById(i), org.bukkit.potion.PotionEffectType.getById(j), this.containerAccess.getLocation().getBlock());
|
|
|
|
+ if (event.callEvent()) {
|
|
|
|
+ this.containerProperties.setProperty(1, event.getPrimary() == null ? 0 : event.getPrimary().getId());
|
|
|
|
+ this.containerProperties.setProperty(2, event.getSecondary() == null ? 0 : event.getSecondary().getId());
|
|
|
|
+ if (!event.willConsumeItem()) return;
|
|
|
|
this.d.a(1);
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|