mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-04-20 10:18:16 +02:00
Upstream has released updates that appears to apply and compile correctly Paper Changes: b75eeca0 Boost light task priority to ensure it doesnt hold up chunk loads 3d2bc848 Ensure VillagerTrades doesn't load async - fixes #3495 e470f1ef Add more information to Timing Reports f4a47db6 Improve Thread Pool usage to allow single threads for single cpu servers a4fe910f Fix sounds when using worldedit regen command 70ad51a8 Updated Upstream (Bukkit/CraftBukkit) d7cfa4fa Improve legacy format serialization more
76 lines
2.1 KiB
Diff
76 lines
2.1 KiB
Diff
From 1af4daf9a5234c33b5e3d53c401ffacf74179d8f Mon Sep 17 00:00:00 2001
|
|
From: Eearslya Sleiarion <eearslya@gmail.com>
|
|
Date: Mon, 24 Jun 2019 21:27:39 -0700
|
|
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.
|
|
---
|
|
.../paper/event/block/BellRingEvent.java | 54 +++++++++++++++++++
|
|
1 file changed, 54 insertions(+)
|
|
create mode 100644 src/main/java/com/destroystokyo/paper/event/block/BellRingEvent.java
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/event/block/BellRingEvent.java b/src/main/java/com/destroystokyo/paper/event/block/BellRingEvent.java
|
|
new file mode 100644
|
|
index 000000000..7b4de3f0a
|
|
--- /dev/null
|
|
+++ b/src/main/java/com/destroystokyo/paper/event/block/BellRingEvent.java
|
|
@@ -0,0 +1,54 @@
|
|
+package com.destroystokyo.paper.event.block;
|
|
+
|
|
+import org.bukkit.block.Block;
|
|
+import org.bukkit.entity.Entity;
|
|
+import org.bukkit.event.Cancellable;
|
|
+import org.bukkit.event.HandlerList;
|
|
+import org.bukkit.event.block.BlockEvent;
|
|
+import org.bukkit.potion.PotionEffect;
|
|
+import org.jetbrains.annotations.NotNull;
|
|
+
|
|
+/**
|
|
+ * Called when a bell is rung by an entity.
|
|
+ */
|
|
+public class BellRingEvent extends BlockEvent implements Cancellable {
|
|
+ private static final HandlerList handlers = new HandlerList();
|
|
+ private boolean cancelled;
|
|
+ private Entity entity;
|
|
+
|
|
+ public BellRingEvent(@NotNull Block block, @NotNull Entity entity) {
|
|
+ super(block);
|
|
+ this.entity = entity;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public boolean isCancelled() {
|
|
+ return cancelled;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public void setCancelled(boolean cancelled) {
|
|
+ this.cancelled = cancelled;
|
|
+ }
|
|
+
|
|
+ /**
|
|
+ * Gets the entity that rang the bell.
|
|
+ *
|
|
+ * @return Entity
|
|
+ */
|
|
+ @NotNull
|
|
+ public Entity getEntity() {
|
|
+ return entity;
|
|
+ }
|
|
+
|
|
+ @NotNull
|
|
+ @Override
|
|
+ public HandlerList getHandlers() {
|
|
+ return handlers;
|
|
+ }
|
|
+
|
|
+ @NotNull
|
|
+ public static HandlerList getHandlerList() {
|
|
+ return handlers;
|
|
+ }
|
|
+}
|
|
--
|
|
2.24.0
|
|
|