mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-24 01:06:01 +01:00
Add data values for entity change block event. Adds BUKKIT-3077, BUKKIT-3076
By: Wesley Wolfe <weswolf@aol.com>
This commit is contained in:
parent
81cc73ac21
commit
9e0336d03c
1 changed files with 15 additions and 0 deletions
|
@ -16,12 +16,18 @@ public class EntityChangeBlockEvent extends EntityEvent implements Cancellable {
|
|||
private final Block block;
|
||||
private boolean cancel;
|
||||
private final Material to;
|
||||
private final byte data;
|
||||
|
||||
public EntityChangeBlockEvent(final LivingEntity what, final Block block, final Material to) {
|
||||
this (what, block, to, (byte) 0);
|
||||
}
|
||||
|
||||
public EntityChangeBlockEvent(final LivingEntity what, final Block block, final Material to, final byte data) {
|
||||
super(what);
|
||||
this.block = block;
|
||||
this.cancel = false;
|
||||
this.to = to;
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -55,6 +61,15 @@ public class EntityChangeBlockEvent extends EntityEvent implements Cancellable {
|
|||
return to;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the data for the block that would be changed into
|
||||
*
|
||||
* @return the data for the block that would be changed into
|
||||
*/
|
||||
public byte getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
|
|
Loading…
Add table
Reference in a new issue