Fork of Poseidon providing Bukkit #1060 to older Beta versions (b1.0-b1.7.3)
1package org.bukkit.event.player;
2
3import org.bukkit.Material;
4import org.bukkit.block.Block;
5import org.bukkit.block.BlockFace;
6import org.bukkit.entity.Player;
7import org.bukkit.event.Cancellable;
8import org.bukkit.inventory.ItemStack;
9
10public abstract class PlayerBucketEvent extends PlayerEvent implements Cancellable {
11
12 private ItemStack itemStack;
13 private boolean cancelled = false;
14 private Block blockClicked;
15 private BlockFace blockFace;
16 private Material bucket;
17
18 public PlayerBucketEvent(Type type, Player who, Block blockClicked, BlockFace blockFace, Material bucket, ItemStack itemInHand) {
19 super(type, who);
20 this.blockClicked = blockClicked;
21 this.blockFace = blockFace;
22 this.itemStack = itemInHand;
23 this.bucket = bucket;
24 }
25
26 /**
27 * Returns the bucket used in this event
28 *
29 * @return the used bucket
30 */
31 public Material getBucket() {
32 return bucket;
33 }
34
35 /**
36 * Get the resulting item in hand after the bucket event
37 *
38 * @return Itemstack hold in hand after the event.
39 */
40 public ItemStack getItemStack() {
41 return itemStack;
42 }
43
44 /**
45 * Set the item in hand after the event
46 *
47 * @param itemStack the new held itemstack after the bucket event.
48 */
49 public void setItemStack(ItemStack itemStack) {
50 this.itemStack = itemStack;
51 }
52
53
54 /**
55 * Return the block clicked
56 *
57 * @return the blicked block
58 */
59 public Block getBlockClicked() {
60 return blockClicked;
61 }
62
63 /**
64 * Get the face on the clicked block
65 *
66 * @return the clicked face
67 */
68 public BlockFace getBlockFace() {
69 return blockFace;
70 }
71
72 public boolean isCancelled() {
73 return cancelled;
74 }
75
76 public void setCancelled(boolean cancel) {
77 this.cancelled = cancel;
78 }
79}