34
paper-api/src/org/bukkit/event/block/BlockFromToEvent.java
Normal file
34
paper-api/src/org/bukkit/event/block/BlockFromToEvent.java
Normal 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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user