Fork of Poseidon providing Bukkit #1060 to older Beta versions (b1.0-b1.7.3)
1package org.bukkit.event.block;
2
3import org.bukkit.Material;
4import org.bukkit.block.Block;
5import org.bukkit.event.Cancellable;
6
7/**
8 * Thrown when a block physics check is called
9 */
10public class BlockPhysicsEvent extends BlockEvent implements Cancellable {
11 private final int changed;
12 private boolean cancel = false;
13
14 public BlockPhysicsEvent(final Block block, final int changed) {
15 super(Type.BLOCK_PHYSICS, block);
16 this.changed = changed;
17 }
18
19 /**
20 * Gets the type of block that changed, causing this event
21 *
22 * @return Changed block's type id
23 */
24 public int getChangedTypeId() {
25 return changed;
26 }
27
28 /**
29 * Gets the type of block that changed, causing this event
30 *
31 * @return Changed block's type
32 */
33 public Material getChangedType() {
34 return Material.getMaterial(changed);
35 }
36
37 public boolean isCancelled() {
38 return cancel;
39 }
40
41 public void setCancelled(boolean cancel) {
42 this.cancel = cancel;
43 }
44}