mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-26 20:46:59 +01:00
1e7dd72f15
The game uses 0.95d now
26 lines
1.6 KiB
Diff
26 lines
1.6 KiB
Diff
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.
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
|
index 31de936ece1391d75d41a00479a82f8dd0cbc850..e33dbade37e4763f838b6cd1267a4f0b9c1533b9 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
|
@@ -366,10 +366,11 @@ public class CraftEventFactory {
|
|
return tradeSelectEvent;
|
|
}
|
|
|
|
+ @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();
|
|
}
|