mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
Fixed BlockFromToEvent not knowing source block from destination block.
By: sk89q <the.sk89q@gmail.com>
This commit is contained in:
parent
a92c284ca1
commit
b105f07fa7
1 changed files with 4 additions and 4 deletions
|
@ -9,14 +9,14 @@ import org.bukkit.event.Event;
|
||||||
* Holds information for events with a source block and a destination block
|
* Holds information for events with a source block and a destination block
|
||||||
*/
|
*/
|
||||||
public class BlockFromToEvent extends BlockEvent implements Cancellable {
|
public class BlockFromToEvent extends BlockEvent implements Cancellable {
|
||||||
protected Block from;
|
protected Block to;
|
||||||
protected BlockFace face;
|
protected BlockFace face;
|
||||||
protected boolean cancel;
|
protected boolean cancel;
|
||||||
|
|
||||||
public BlockFromToEvent(final Event.Type type, final Block block, final BlockFace face) {
|
public BlockFromToEvent(final Event.Type type, final Block block, final BlockFace face) {
|
||||||
super(type, block);
|
super(type, block);
|
||||||
this.face = face;
|
this.face = face;
|
||||||
this.from = block.getRelative(face.getModX(), face.getModY(), face.getModZ());
|
this.to = block.getRelative(face.getModX(), face.getModY(), face.getModZ());
|
||||||
this.cancel = false;
|
this.cancel = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,8 +34,8 @@ public class BlockFromToEvent extends BlockEvent implements Cancellable {
|
||||||
*
|
*
|
||||||
* @return Block the faced block
|
* @return Block the faced block
|
||||||
*/
|
*/
|
||||||
public Block getFromBlock() {
|
public Block getToBlock() {
|
||||||
return from;
|
return to;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isCancelled() {
|
public boolean isCancelled() {
|
||||||
|
|
Loading…
Reference in a new issue