From 9e0336d03cea2f43f491a529099f5638b82762e8 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Fri, 30 Nov 2012 12:07:10 -0600 Subject: [PATCH] Add data values for entity change block event. Adds BUKKIT-3077, BUKKIT-3076 By: Wesley Wolfe --- .../event/entity/EntityChangeBlockEvent.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/event/entity/EntityChangeBlockEvent.java b/paper-api/src/main/java/org/bukkit/event/entity/EntityChangeBlockEvent.java index c805e52db2..d2b03f487f 100644 --- a/paper-api/src/main/java/org/bukkit/event/entity/EntityChangeBlockEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/entity/EntityChangeBlockEvent.java @@ -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;