2021-06-14 15:45:16 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Eearslya Sleiarion <eearslya@gmail.com>
|
|
|
|
Date: Sun, 23 Aug 2020 13:04:02 +0200
|
|
|
|
Subject: [PATCH] Add BellRingEvent
|
|
|
|
|
|
|
|
Add a new event, BellRingEvent, to trigger whenever a player rings a
|
|
|
|
village bell. Passes along the bell block and the player who rang it.
|
|
|
|
|
2023-04-07 20:39:13 +02:00
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
2024-04-06 21:53:39 +02:00
|
|
|
index b72fba605ea2c2ea88fee90058fb2ccc30197c95..657df7b4aa8c4a19bf8e085d8235aa0d1a1b08da 100644
|
2023-04-07 20:39:13 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
2024-04-06 21:53:39 +02:00
|
|
|
@@ -368,10 +368,11 @@ public class CraftEventFactory {
|
2023-04-07 20:39:13 +02:00
|
|
|
return tradeSelectEvent;
|
|
|
|
}
|
2021-06-14 15:45:16 +02:00
|
|
|
|
2023-04-07 20:39:13 +02:00
|
|
|
+ @SuppressWarnings("deprecation") // Paper use deprecated event to maintain compat (it extends modern event)
|
|
|
|
public static boolean handleBellRingEvent(Level world, BlockPos position, Direction direction, Entity entity) {
|
|
|
|
Block block = CraftBlock.at(world, position);
|
|
|
|
BlockFace bukkitDirection = CraftBlock.notchToBlockFace(direction);
|
|
|
|
- BellRingEvent event = new BellRingEvent(block, bukkitDirection, (entity != null) ? entity.getBukkitEntity() : null);
|
|
|
|
+ BellRingEvent event = new io.papermc.paper.event.block.BellRingEvent(block, bukkitDirection, (entity != null) ? entity.getBukkitEntity() : null); // Paper - deprecated BellRingEvent
|
|
|
|
Bukkit.getPluginManager().callEvent(event);
|
|
|
|
return !event.isCancelled();
|
|
|
|
}
|