Merge remote branch 'upstream/master'

Conflicts:
	src/org/bukkit/event/block/BlockEvent.java
	src/org/bukkit/event/block/BlockListener.java
	src/org/bukkit/event/block/BlockPhysicsEvent.java

By: durron597 <martin.jared@gmail.com>
This commit is contained in:
Bukkit/Spigot 2010-12-30 17:40:14 -05:00
commit d9184242dc
2 changed files with 64 additions and 26 deletions

View file

@ -3,12 +3,15 @@ package org.bukkit.event.block;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
/** /**
* Handles all events thrown in relation to a Block * Handles all events thrown in relation to Blocks
* *
* @author durron597 * @author durron597
*/ */
public class BlockListener implements Listener { public class BlockListener implements Listener {
public BlockListener() { /**
* Default Constructor
*/
public BlockListener() {
} }
/** /**
@ -66,6 +69,6 @@ public class BlockListener implements Listener {
* *
* @param event Relevant event details * @param event Relevant event details
*/ */
public void onRedstoneChange(BlockFromToEvent event) { public void onRedstoneChange(BlockFromToEvent event) {
} }
} }

View file

@ -1,23 +1,58 @@
/** package org.bukkit.event.block;
*
*/ import org.bukkit.Block;
package org.bukkit.event.block; import org.bukkit.ItemStack;
import org.bukkit.event.Event;
import org.bukkit.Block;
/**
/** * Thrown when a block physics check is called
* @author jmartin *
* * @author Dinnerbone
*/ */
public class BlockPhysicsEvent extends BlockEvent { public class BlockPhysicsEvent extends BlockEvent {
private final int changed;
/** private boolean cancel = false;
* @param type
* @param theBlock public BlockPhysicsEvent(final Event.Type type, final Block block, final int changed) {
*/ super(type, block);
public BlockPhysicsEvent(Type type, Block theBlock) { this.changed = changed;
super(type, theBlock); }
// TODO Auto-generated constructor stub
} /**
* 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 ItemStack.Type getChangedType() {
return ItemStack.Type.getType(changed); // TODO: Move type to its own file
}
/**
* 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;
}
}