Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
BlockPhysicsEvent.java
1 package org.bukkit.event.block;
2 
3 import org.bukkit.block.Block;
4 import org.bukkit.Material;
7 
8 /**
9  * Thrown when a block physics check is called
10  */
11 public class BlockPhysicsEvent extends BlockEvent implements Cancellable {
12  private static final HandlerList handlers = new HandlerList();
13  private final int changed;
14  private boolean cancel = false;
15 
16  /**
17  *
18  * @deprecated Magic value
19  */
20  @Deprecated
21  public BlockPhysicsEvent(final Block block, final int changed) {
22  super(block);
23  this.changed = changed;
24  }
25 
26  /**
27  * Gets the type of block that changed, causing this event
28  *
29  * @return Changed block's type id
30  * @deprecated Magic value
31  */
32  @Deprecated
33  public int getChangedTypeId() {
34  return changed;
35  }
36 
37  /**
38  * Gets the type of block that changed, causing this event
39  *
40  * @return Changed block's type
41  */
43  return Material.getMaterial(changed);
44  }
45 
46  public boolean isCancelled() {
47  return cancel;
48  }
49 
50  public void setCancelled(boolean cancel) {
51  this.cancel = cancel;
52  }
53 
54  @Override
55  public HandlerList getHandlers() {
56  return handlers;
57  }
58 
59  public static HandlerList getHandlerList() {
60  return handlers;
61  }
62 }
static Material getMaterial(final int id)
Definition: Material.java:575
BlockPhysicsEvent(final Block block, final int changed)