Paper/Spigot-API-Patches/0013-Add-BeaconEffectEvent.patch

74 Zeilen
1.9 KiB
Diff

2015-07-23 21:57:12 +02:00
From fb47713bc3aa1e7c44c50caacd86b3a29a275203 Mon Sep 17 00:00:00 2001
From: Byteflux <byte@byteflux.net>
Date: Thu, 23 Jul 2015 11:45:20 -0700
Subject: [PATCH] Add BeaconEffectEvent
diff --git a/src/main/java/org/github/paperspigot/event/block/BeaconEffectEvent.java b/src/main/java/org/github/paperspigot/event/block/BeaconEffectEvent.java
new file mode 100644
index 0000000..9bc14a2
--- /dev/null
+++ b/src/main/java/org/github/paperspigot/event/block/BeaconEffectEvent.java
@@ -0,0 +1,58 @@
+package org.github.paperspigot.event.block;
+
+import org.bukkit.block.Block;
+import org.bukkit.entity.Player;
+import org.bukkit.event.Cancellable;
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.block.BlockEvent;
+import org.bukkit.potion.PotionEffect;
+
+public class BeaconEffectEvent extends BlockEvent implements Cancellable {
+ private static final HandlerList handlers = new HandlerList();
+ private boolean cancelled;
+ private PotionEffect effect;
+ private Player player;
+ private boolean primary;
+
+ public BeaconEffectEvent(Block block, PotionEffect effect, Player player, boolean primary) {
+ super(block);
+ this.effect = effect;
+ this.player = player;
+ this.primary = primary;
+ }
+
+ @Override
+ public boolean isCancelled() {
+ return cancelled;
+ }
+
+ @Override
+ public void setCancelled(boolean cancelled) {
+ this.cancelled = cancelled;
+ }
+
+ public PotionEffect getEffect() {
+ return effect;
+ }
+
+ public void setEffect(PotionEffect effect) {
+ this.effect = effect;
+ }
+
+ public Player getPlayer() {
+ return player;
+ }
+
+ public boolean isPrimary() {
+ return primary;
+ }
+
+ @Override
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }
+}
--
1.9.5.msysgit.1