Files
Bukkit/src/main/java/org/bukkit/event/block/BlockPhysicsEvent.java
Erik Broes 158906c132 Some more backwards incompatible changes (minor though), also a ton of small cleanup.
onPluginEnable(PluginEvent event)   -> onPluginEnable(PluginEnableEvent event)
onPluginDisable(PluginEvent event)  -> onPluginDisable(PluginDisableEvent event)
onVehicleUpdate(VehicleEvent event) -> onVehicleUpdate(VehicleUpdateEvent event)
onWorldSave(WorldEvent event)       -> onWorldSave(WorldSaveEvent event)
onWorldLoad(WorldEvent event)       -> onWorldLoad(WorldLoadEvent event)
2011-03-26 22:32:14 +01:00

58 lines
1.4 KiB
Java

package org.bukkit.event.block;
import org.bukkit.block.Block;
import org.bukkit.Material;
/**
* Thrown when a block physics check is called
*
* @author Dinnerbone
*/
public class BlockPhysicsEvent extends BlockEvent {
private final int changed;
private boolean cancel = false;
public BlockPhysicsEvent(final Block block, final int changed) {
super(Type.BLOCK_PHYSICS, block);
this.changed = changed;
}
/**
* Gets the type of block that changed, causing this event
*
* @return Changed block's type id
*/
public int getChangedTypeId() {
return changed;
}
/**
* Gets the type of block that changed, causing this event
*
* @return Changed block's type
*/
public Material getChangedType() {
return Material.getMaterial(changed);
}
/**
* Gets the cancellation state of this event. A cancelled event will not
* be executed in the server, but will still pass to other plugins
*
* @return true if this event is cancelled
*/
public boolean isCancelled() {
return cancel;
}
/**
* Sets the cancellation state of this event. A cancelled event will not
* be executed in the server, but will still pass to other plugins
*
* @param cancel true if you wish to cancel this event
*/
public void setCancelled(boolean cancel) {
this.cancel = cancel;
}
}