Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
PaintingPlaceEvent.java
1 package org.bukkit.event.painting;
2 
3 import org.bukkit.Warning;
4 import org.bukkit.block.Block;
7 import org.bukkit.entity.Player;
10 
11 /**
12  * Triggered when a painting is created in the world
13  *
14  * @deprecated Use {@link org.bukkit.event.hanging.HangingPlaceEvent} instead.
15  */
16 @Deprecated
17 @Warning(reason="This event has been replaced by HangingPlaceEvent")
18 public class PaintingPlaceEvent extends PaintingEvent implements Cancellable {
19  private static final HandlerList handlers = new HandlerList();
20  private boolean cancelled;
21  private final Player player;
22  private final Block block;
23  private final BlockFace blockFace;
24 
25  public PaintingPlaceEvent(final Painting painting, final Player player, final Block block, final BlockFace blockFace) {
26  super(painting);
27  this.player = player;
28  this.block = block;
29  this.blockFace = blockFace;
30  }
31 
32  /**
33  * Returns the player placing the painting
34  *
35  * @return Entity returns the player placing the painting
36  */
37  public Player getPlayer() {
38  return player;
39  }
40 
41  /**
42  * Returns the block that the painting was placed on
43  *
44  * @return Block returns the block painting placed on
45  */
46  public Block getBlock() {
47  return block;
48  }
49 
50  /**
51  * Returns the face of the block that the painting was placed on
52  *
53  * @return BlockFace returns the face of the block the painting was placed
54  * on
55  */
57  return blockFace;
58  }
59 
60  public boolean isCancelled() {
61  return cancelled;
62  }
63 
64  public void setCancelled(boolean cancel) {
65  this.cancelled = cancel;
66  }
67 
68  @Override
69  public HandlerList getHandlers() {
70  return handlers;
71  }
72 
73  public static HandlerList getHandlerList() {
74  return handlers;
75  }
76 }