Add data values for entity change block event. Adds BUKKIT-3077, BUKKIT-3076
This commit is contained in:
parent
6cf0821f0a
commit
58c8f0ae30
@ -16,12 +16,18 @@ public class EntityChangeBlockEvent extends EntityEvent implements Cancellable {
|
|||||||
private final Block block;
|
private final Block block;
|
||||||
private boolean cancel;
|
private boolean cancel;
|
||||||
private final Material to;
|
private final Material to;
|
||||||
|
private final byte data;
|
||||||
|
|
||||||
public EntityChangeBlockEvent(final LivingEntity what, final Block block, final Material to) {
|
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);
|
super(what);
|
||||||
this.block = block;
|
this.block = block;
|
||||||
this.cancel = false;
|
this.cancel = false;
|
||||||
this.to = to;
|
this.to = to;
|
||||||
|
this.data = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -55,6 +61,15 @@ public class EntityChangeBlockEvent extends EntityEvent implements Cancellable {
|
|||||||
return to;
|
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
|
@Override
|
||||||
public HandlerList getHandlers() {
|
public HandlerList getHandlers() {
|
||||||
return handlers;
|
return handlers;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user