Added block events

By: durron597 <martin.jared@gmail.com>
This commit is contained in:
Bukkit/Spigot
2010-12-30 17:16:06 -05:00
parent 7e203ee761
commit 4e456dc092
8 changed files with 229 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
package org.bukkit.event.block;
import org.bukkit.Block;
import org.bukkit.event.Event;
/**
* Holds information for events with a source block and a destination block
*/
public class BlockFromToEvent extends BlockEvent {
protected Block from;
public BlockFromToEvent(final Event.Type type, final Block from, final Block to) {
super(type, to);
this.from = from;
}
/**
* Gets the location this player moved to
*
* @return Block the block is event originated from
*/
public Block getFrom() {
return from;
}
/**
* Gets the target block of this event
*
* @return Block the block containing this event
*/
public Block getTo() {
return getBlock();
}
}