Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
PaintingBreakEvent.java
1 package org.bukkit.event.painting;
2 
3 import org.bukkit.Warning;
7 
8 /**
9  * Triggered when a painting is removed
10  *
11  * @deprecated Use {@link org.bukkit.event.hanging.HangingBreakEvent} instead.
12  */
13 @Deprecated
14 @Warning(reason="This event has been replaced by HangingBreakEvent")
15 public class PaintingBreakEvent extends PaintingEvent implements Cancellable {
16  private static final HandlerList handlers = new HandlerList();
17  private boolean cancelled;
18  private final RemoveCause cause;
19 
20  public PaintingBreakEvent(final Painting painting, final RemoveCause cause) {
21  super(painting);
22  this.cause = cause;
23  }
24 
25  /**
26  * Gets the cause for the painting's removal
27  *
28  * @return the RemoveCause for the painting's removal
29  */
30  public RemoveCause getCause() {
31  return cause;
32  }
33 
34  public boolean isCancelled() {
35  return cancelled;
36  }
37 
38  public void setCancelled(boolean cancel) {
39  this.cancelled = cancel;
40  }
41 
42  /**
43  * An enum to specify the cause of the removal
44  */
45  public enum RemoveCause {
46  /**
47  * Removed by an entity
48  */
50  /**
51  * Removed by fire
52  */
54  /**
55  * Removed by placing a block on it
56  */
58  /**
59  * Removed by water flowing over it
60  */
62  /**
63  * Removed by destroying the block behind it, etc
64  */
66  }
67 
68  @Override
69  public HandlerList getHandlers() {
70  return handlers;
71  }
72 
73  public static HandlerList getHandlerList() {
74  return handlers;
75  }
76 }