001 package org.bukkit.event.block;
002
003 import org.bukkit.block.Block;
004 import org.bukkit.Material;
005 import org.bukkit.event.Cancellable;
006 import org.bukkit.event.HandlerList;
007
008 /**
009 * Thrown when a block physics check is called
010 */
011 public class BlockPhysicsEvent extends BlockEvent implements Cancellable {
012 private static final HandlerList handlers = new HandlerList();
013 private final int changed;
014 private boolean cancel = false;
015
016 /**
017 *
018 * @deprecated Magic value
019 */
020 @Deprecated
021 public BlockPhysicsEvent(final Block block, final int changed) {
022 super(block);
023 this.changed = changed;
024 }
025
026 /**
027 * Gets the type of block that changed, causing this event
028 *
029 * @return Changed block's type id
030 * @deprecated Magic value
031 */
032 @Deprecated
033 public int getChangedTypeId() {
034 return changed;
035 }
036
037 /**
038 * Gets the type of block that changed, causing this event
039 *
040 * @return Changed block's type
041 */
042 public Material getChangedType() {
043 return Material.getMaterial(changed);
044 }
045
046 public boolean isCancelled() {
047 return cancel;
048 }
049
050 public void setCancelled(boolean cancel) {
051 this.cancel = cancel;
052 }
053
054 @Override
055 public HandlerList getHandlers() {
056 return handlers;
057 }
058
059 public static HandlerList getHandlerList() {
060 return handlers;
061 }
062 }