-
-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathItemFillWithAcidEvent.java
More file actions
64 lines (53 loc) · 1.59 KB
/
ItemFillWithAcidEvent.java
File metadata and controls
64 lines (53 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package world.bentobox.acidisland.events;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
import org.bukkit.inventory.ItemStack;
import world.bentobox.bentobox.api.events.IslandBaseEvent;
import world.bentobox.bentobox.database.objects.Island;
/**
* Fired when an ItemStack (water bottle or bucket) is filled with acid water.
* Cancel this event to prevent the acid bottle from being given to the player.
* @author Poslovitch
* @since 1.0
*/
public class ItemFillWithAcidEvent extends IslandBaseEvent implements Cancellable {
private final Player player;
private final ItemStack item;
private boolean cancelled;
private static final HandlerList handlers = new HandlerList();
@Override
public HandlerList getHandlers() {
return getHandlerList();
}
public static HandlerList getHandlerList() {
return handlers;
}
public ItemFillWithAcidEvent(Island island, Player player, ItemStack item) {
super(island);
this.player = player;
this.item = item;
}
/**
* Gets the player who triggered the event
* @return the player who triggered the event
*/
public Player getPlayer() {
return player;
}
/**
* Gets the item that will be acid-ified
* @return the item that will be acid-ified
*/
public ItemStack getItem() {
return item;
}
@Override
public boolean isCancelled() {
return cancelled;
}
@Override
public void setCancelled(boolean cancel) {
this.cancelled = cancel;
}
}