mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-29 14:06:17 +01:00
a207d14a0e
Signed-off-by: Mariell Hoversholm <proximyst@proximyst.com>
38 lines
2.0 KiB
Diff
38 lines
2.0 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Spyridon Pagkalos <spyridon@ender.gr>
|
|
Date: Thu, 25 Mar 2021 20:28:04 +0200
|
|
Subject: [PATCH] Introduce beacon activation/deactivation events
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
|
|
index fed29e5707e2a7f64159d284c52647dd91e1948e..7025a27c25f8640df06a3c65c2086059769870b5 100644
|
|
--- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
|
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
|
|
@@ -199,6 +199,15 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Tick
|
|
this.playSound(SoundEvents.BEACON_AMBIENT);
|
|
}
|
|
}
|
|
+ // Paper start - beacon activation/deactivation events
|
|
+ if (!(i1 > 0) && this.levels > 0) {
|
|
+ org.bukkit.block.Block block = org.bukkit.craftbukkit.block.CraftBlock.at(level, worldPosition);
|
|
+ new io.papermc.paper.event.block.BeaconActivatedEvent(block).callEvent();
|
|
+ } else if (i1 > 0 && !(this.levels > 0)) {
|
|
+ org.bukkit.block.Block block = org.bukkit.craftbukkit.block.CraftBlock.at(level, worldPosition);
|
|
+ new io.papermc.paper.event.block.BeaconDeactivatedEvent(block).callEvent();
|
|
+ }
|
|
+ // Paper end
|
|
|
|
if (this.lastCheckY >= l) {
|
|
this.lastCheckY = -1;
|
|
@@ -255,6 +264,10 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Tick
|
|
|
|
@Override
|
|
public void setRemoved() {
|
|
+ // Paper start - BeaconDeactivatedEvent
|
|
+ org.bukkit.block.Block block = org.bukkit.craftbukkit.block.CraftBlock.at(level, worldPosition);
|
|
+ new io.papermc.paper.event.block.BeaconDeactivatedEvent(block).callEvent();
|
|
+ // Paper end
|
|
this.playSound(SoundEvents.BEACON_DEACTIVATE);
|
|
super.setRemoved();
|
|
}
|