blob: ec45668c984a906924d4e95ea1478f38658410d5 (
plain)
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
package org.bukkit.event.player;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.inventory.ItemStack;
public abstract class PlayerBucketEvent extends PlayerEvent implements Cancellable {
private ItemStack itemStack;
private boolean cancelled = false;
private Block blockClicked;
private BlockFace blockFace;
private Material bucket;
public PlayerBucketEvent(Type type, Player who, Block blockClicked, BlockFace blockFace, Material bucket, ItemStack itemInHand) {
super(type, who);
this.blockClicked = blockClicked;
this.blockFace = blockFace;
this.itemStack = itemInHand;
this.bucket = bucket;
}
/**
* Returns the bucket used in this event
*
* @return the used bucket
*/
public Material getBucket() {
return bucket;
}
/**
* Get the resulting item in hand after the bucket event
*
* @return Itemstack hold in hand after the event.
*/
public ItemStack getItemStack() {
return itemStack;
}
/**
* Set the item in hand after the event
*
* @param itemStack the new held itemstack after the bucket event.
*/
public void setItemStack(ItemStack itemStack) {
this.itemStack = itemStack;
}
/**
* Return the block clicked
*
* @return the blicked block
*/
public Block getBlockClicked() {
return blockClicked;
}
/**
* Get the face on the clicked block
*
* @return the clicked face
*/
public BlockFace getBlockFace() {
return blockFace;
}
public boolean isCancelled() {
return cancelled;
}
public void setCancelled(boolean cancel) {
this.cancelled = cancel;
}
}
|