@@ -1,6 +1,7 @@
|
||||
package org.bukkit.event.block;
|
||||
|
||||
public enum Action {
|
||||
|
||||
/**
|
||||
* Left-clicking a block
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
package org.bukkit.event.block;
|
||||
|
||||
import org.bukkit.block.Block;
|
||||
|
||||
@@ -39,7 +39,7 @@ public class BlockDamageEvent extends BlockEvent implements Cancellable {
|
||||
public boolean getInstaBreak() {
|
||||
return instaBreak;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set if the block should instantly break
|
||||
*/
|
||||
@@ -49,13 +49,12 @@ public class BlockDamageEvent extends BlockEvent implements Cancellable {
|
||||
|
||||
/**
|
||||
* Returns the ItemStack in hand
|
||||
*
|
||||
*
|
||||
* @return Currently wielding itemstack
|
||||
*/
|
||||
public ItemStack getItemInHand() {
|
||||
return itemstack;
|
||||
}
|
||||
|
||||
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
|
||||
@@ -7,15 +7,15 @@ import org.bukkit.util.Vector;
|
||||
|
||||
/**
|
||||
* Event called on dispense of an item from a block.
|
||||
*
|
||||
*
|
||||
* @author sk89q
|
||||
*/
|
||||
public class BlockDispenseEvent extends BlockEvent implements Cancellable {
|
||||
|
||||
|
||||
private boolean cancelled = false;
|
||||
private ItemStack item;
|
||||
private Vector velocity;
|
||||
|
||||
|
||||
public BlockDispenseEvent(Block block, ItemStack dispensed, Vector velocity) {
|
||||
super(Type.BLOCK_DISPENSE, block);
|
||||
this.item = dispensed;
|
||||
@@ -25,7 +25,7 @@ public class BlockDispenseEvent extends BlockEvent implements Cancellable {
|
||||
/**
|
||||
* Get the item that is being dispensed. Modifying the returned item
|
||||
* will have no effect.
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public ItemStack getItem() {
|
||||
@@ -34,26 +34,26 @@ public class BlockDispenseEvent extends BlockEvent implements Cancellable {
|
||||
|
||||
/**
|
||||
* Set the item being dispensed.
|
||||
*
|
||||
*
|
||||
* @param item
|
||||
*/
|
||||
public void setItem(ItemStack item) {
|
||||
this.item = item;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the velocity. Modifying the returned Vector will not
|
||||
* change the velocity.
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Vector getVelocity() {
|
||||
return velocity.clone();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set the velocity.
|
||||
*
|
||||
*
|
||||
* @param vel
|
||||
*/
|
||||
public void setVelocity(Vector vel) {
|
||||
@@ -73,5 +73,4 @@ public class BlockDispenseEvent extends BlockEvent implements Cancellable {
|
||||
public void setCancelled(boolean cancel) {
|
||||
cancelled = cancel;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public class BlockFromToEvent extends BlockEvent implements Cancellable {
|
||||
|
||||
/**
|
||||
* Convenience method for getting the faced block
|
||||
*
|
||||
*
|
||||
* @return Block the faced block
|
||||
*/
|
||||
public Block getToBlock() {
|
||||
|
||||
@@ -55,8 +55,7 @@ public class BlockIgniteEvent extends BlockEvent implements Cancellable {
|
||||
* Gets the cause of block ignite.
|
||||
* @return An IgniteCause value detailing the cause of block ignition.
|
||||
*/
|
||||
public IgniteCause getCause()
|
||||
{
|
||||
public IgniteCause getCause() {
|
||||
return cause;
|
||||
}
|
||||
|
||||
@@ -73,6 +72,7 @@ public class BlockIgniteEvent extends BlockEvent implements Cancellable {
|
||||
* An enum to specify the cause of the ignite
|
||||
*/
|
||||
public enum IgniteCause {
|
||||
|
||||
/**
|
||||
* Block ignition caused by lava.
|
||||
*/
|
||||
@@ -90,5 +90,4 @@ public class BlockIgniteEvent extends BlockEvent implements Cancellable {
|
||||
*/
|
||||
LIGHTNING,
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,25 +9,23 @@ import org.bukkit.plugin.AuthorNagException;
|
||||
* @author durron597
|
||||
*/
|
||||
public class BlockListener implements Listener {
|
||||
|
||||
/**
|
||||
* Default Constructor
|
||||
*/
|
||||
public BlockListener() {
|
||||
}
|
||||
public BlockListener() {}
|
||||
|
||||
/**
|
||||
* Called when a block is damaged (or broken)
|
||||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onBlockDamage(BlockDamageEvent event) {
|
||||
}
|
||||
public void onBlockDamage(BlockDamageEvent event) {}
|
||||
|
||||
/**
|
||||
* Called when we try to place a block, to see if we can build it
|
||||
*/
|
||||
public void onBlockCanBuild(BlockCanBuildEvent event) {
|
||||
}
|
||||
public void onBlockCanBuild(BlockCanBuildEvent event) {}
|
||||
|
||||
/**
|
||||
* Called when a block flows (water/lava)
|
||||
@@ -48,24 +46,21 @@ public class BlockListener implements Listener {
|
||||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onBlockIgnite(BlockIgniteEvent event) {
|
||||
}
|
||||
public void onBlockIgnite(BlockIgniteEvent event) {}
|
||||
|
||||
/**
|
||||
* Called when block physics occurs
|
||||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onBlockPhysics(BlockPhysicsEvent event) {
|
||||
}
|
||||
public void onBlockPhysics(BlockPhysicsEvent event) {}
|
||||
|
||||
/**
|
||||
* Called when a player places a block
|
||||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onBlockPlace(BlockPlaceEvent event) {
|
||||
}
|
||||
public void onBlockPlace(BlockPlaceEvent event) {}
|
||||
|
||||
/**
|
||||
* Called when redstone changes
|
||||
@@ -74,54 +69,47 @@ public class BlockListener implements Listener {
|
||||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onBlockRedstoneChange(BlockRedstoneEvent event) {
|
||||
}
|
||||
public void onBlockRedstoneChange(BlockRedstoneEvent event) {}
|
||||
|
||||
/**
|
||||
* Called when leaves are decaying naturally
|
||||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onLeavesDecay(LeavesDecayEvent event) {
|
||||
}
|
||||
public void onLeavesDecay(LeavesDecayEvent event) {}
|
||||
|
||||
/**
|
||||
* Called when a sign is changed
|
||||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onSignChange(SignChangeEvent event) {
|
||||
}
|
||||
public void onSignChange(SignChangeEvent event) {}
|
||||
|
||||
/**
|
||||
* Called when a block is destroyed from burning
|
||||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onBlockBurn(BlockBurnEvent event) {
|
||||
}
|
||||
public void onBlockBurn(BlockBurnEvent event) {}
|
||||
|
||||
/**
|
||||
* Called when a block is destroyed by a player.
|
||||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onBlockBreak(BlockBreakEvent event) {
|
||||
}
|
||||
public void onBlockBreak(BlockBreakEvent event) {}
|
||||
|
||||
/**
|
||||
* Called when a world is attempting to place a block during a snowfall
|
||||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onSnowForm(SnowFormEvent event) {
|
||||
}
|
||||
|
||||
public void onSnowForm(SnowFormEvent event) {}
|
||||
|
||||
/**
|
||||
* Called when a block is dispensing an item
|
||||
*
|
||||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onBlockDispense(BlockDispenseEvent event) {
|
||||
}
|
||||
public void onBlockDispense(BlockDispenseEvent event) {}
|
||||
}
|
||||
|
||||
@@ -75,7 +75,6 @@ public class BlockPlaceEvent extends BlockEvent implements Cancellable {
|
||||
return this.replacedBlockState;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the block that this block was placed against
|
||||
*
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package org.bukkit.event.block;
|
||||
|
||||
import org.bukkit.block.Block;
|
||||
@@ -42,5 +41,4 @@ public class BlockRedstoneEvent extends BlockEvent {
|
||||
public void setNewCurrent(int newCurrent) {
|
||||
this.newCurrent = newCurrent;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package org.bukkit.event.block;
|
||||
|
||||
import org.bukkit.block.Block;
|
||||
|
||||
@@ -23,7 +23,7 @@ public class SnowFormEvent extends BlockEvent implements Cancellable {
|
||||
*
|
||||
* @return the material being placed by a snowfall
|
||||
*/
|
||||
public Material getMaterial(){
|
||||
public Material getMaterial() {
|
||||
return material;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ public class SnowFormEvent extends BlockEvent implements Cancellable {
|
||||
*
|
||||
* @param material the material to be placed during a snowfall
|
||||
*/
|
||||
public void setMaterial(Material material){
|
||||
public void setMaterial(Material material) {
|
||||
this.material = material;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ public class SnowFormEvent extends BlockEvent implements Cancellable {
|
||||
*
|
||||
* @return the data of the block being placed by a snowfall
|
||||
*/
|
||||
public byte getData(){
|
||||
public byte getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ public class SnowFormEvent extends BlockEvent implements Cancellable {
|
||||
*
|
||||
* @param data
|
||||
*/
|
||||
public void setData(byte data){
|
||||
public void setData(byte data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
@@ -73,4 +73,4 @@ public class SnowFormEvent extends BlockEvent implements Cancellable {
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user