mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-23 11:06:29 +01:00
e4d10a6d67
Upstream has released updates that appears to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: 122289ff Add FaceAttachable interface to handle Grindstone facing in common with Switches a6db750e SPIGOT-5647: ZombieVillager entity should have getVillagerType() CraftBukkit Changes:bbe3d58e
SPIGOT-5650: Lectern.setPage(int) causes a NullPointerException3075579f
Add FaceAttachable interface to handle Grindstone facing in common with Switches95bd4238
SPIGOT-5647: ZombieVillager entity should have getVillagerType()4d975ac3
SPIGOT-5617: setBlockData does not work when NotPlayEvent is called by redstone current
102 lines
2.6 KiB
Diff
102 lines
2.6 KiB
Diff
From 2aa65d30322969ef1977dfbb7e972747b19e6398 Mon Sep 17 00:00:00 2001
|
|
From: Byteflux <byte@byteflux.net>
|
|
Date: Mon, 29 Feb 2016 18:09:40 -0600
|
|
Subject: [PATCH] Add BeaconEffectEvent
|
|
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/event/block/BeaconEffectEvent.java b/src/main/java/com/destroystokyo/paper/event/block/BeaconEffectEvent.java
|
|
new file mode 100644
|
|
index 000000000..978813b94
|
|
--- /dev/null
|
|
+++ b/src/main/java/com/destroystokyo/paper/event/block/BeaconEffectEvent.java
|
|
@@ -0,0 +1,86 @@
|
|
+package com.destroystokyo.paper.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;
|
|
+import org.jetbrains.annotations.NotNull;
|
|
+
|
|
+/**
|
|
+ * Called when a beacon effect is being applied to a player.
|
|
+ */
|
|
+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(@NotNull Block block, @NotNull PotionEffect effect, @NotNull 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;
|
|
+ }
|
|
+
|
|
+ /**
|
|
+ * Gets the potion effect being applied.
|
|
+ *
|
|
+ * @return Potion effect
|
|
+ */
|
|
+ @NotNull
|
|
+ public PotionEffect getEffect() {
|
|
+ return effect;
|
|
+ }
|
|
+
|
|
+ /**
|
|
+ * Sets the potion effect that will be applied.
|
|
+ *
|
|
+ * @param effect Potion effect
|
|
+ */
|
|
+ public void setEffect(@NotNull PotionEffect effect) {
|
|
+ this.effect = effect;
|
|
+ }
|
|
+
|
|
+ /**
|
|
+ * Gets the player who the potion effect is being applied to.
|
|
+ *
|
|
+ * @return Affected player
|
|
+ */
|
|
+ @NotNull
|
|
+ public Player getPlayer() {
|
|
+ return player;
|
|
+ }
|
|
+
|
|
+ /**
|
|
+ * Gets whether the effect is a primary beacon effect.
|
|
+ *
|
|
+ * @return true if this event represents a primary effect
|
|
+ */
|
|
+ public boolean isPrimary() {
|
|
+ return primary;
|
|
+ }
|
|
+
|
|
+ @NotNull
|
|
+ @Override
|
|
+ public HandlerList getHandlers() {
|
|
+ return handlers;
|
|
+ }
|
|
+
|
|
+ @NotNull
|
|
+ public static HandlerList getHandlerList() {
|
|
+ return handlers;
|
|
+ }
|
|
+}
|
|
--
|
|
2.25.1
|
|
|