summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main/java/org/bukkit/event/entity/EntityBreakDoorEvent.java2
-rw-r--r--src/main/java/org/bukkit/event/entity/EntityChangeBlockEvent.java24
2 files changed, 7 insertions, 19 deletions
diff --git a/src/main/java/org/bukkit/event/entity/EntityBreakDoorEvent.java b/src/main/java/org/bukkit/event/entity/EntityBreakDoorEvent.java
index 2cbbc697..b877f1ba 100644
--- a/src/main/java/org/bukkit/event/entity/EntityBreakDoorEvent.java
+++ b/src/main/java/org/bukkit/event/entity/EntityBreakDoorEvent.java
@@ -12,7 +12,7 @@ import org.bukkit.entity.LivingEntity;
*/
public class EntityBreakDoorEvent extends EntityChangeBlockEvent {
public EntityBreakDoorEvent(final LivingEntity entity, final Block targetBlock) {
- super(entity, targetBlock, Material.AIR, (byte) 0);
+ super(entity, targetBlock, Material.AIR.createBlockData());
}
@Override
diff --git a/src/main/java/org/bukkit/event/entity/EntityChangeBlockEvent.java b/src/main/java/org/bukkit/event/entity/EntityChangeBlockEvent.java
index 9f69ded6..0fa1d0ce 100644
--- a/src/main/java/org/bukkit/event/entity/EntityChangeBlockEvent.java
+++ b/src/main/java/org/bukkit/event/entity/EntityChangeBlockEvent.java
@@ -2,6 +2,7 @@ package org.bukkit.event.entity;
import org.bukkit.Material;
import org.bukkit.block.Block;
+import org.bukkit.block.data.BlockData;
import org.bukkit.entity.Entity;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
@@ -13,24 +14,13 @@ public class EntityChangeBlockEvent extends EntityEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private final Block block;
private boolean cancel;
- private final Material to;
- private final byte data;
+ private final BlockData to;
- /**
- *
- * @param what the Entity causing the change
- * @param block the block (before the change)
- * @param to the future material being changed to
- * @param data the future block data
- * @deprecated Magic value
- */
- @Deprecated
- public EntityChangeBlockEvent(final Entity what, final Block block, final Material to, final byte data) {
+ public EntityChangeBlockEvent(final Entity what, final Block block, final BlockData to) {
super(what);
this.block = block;
this.cancel = false;
this.to = to;
- this.data = data;
}
/**
@@ -56,18 +46,16 @@ public class EntityChangeBlockEvent extends EntityEvent implements Cancellable {
* @return the material that the block is changing into
*/
public Material getTo() {
- return to;
+ return to.getMaterial();
}
/**
* Gets the data for the block that would be changed into
*
* @return the data for the block that would be changed into
- * @deprecated Magic value
*/
- @Deprecated
- public byte getData() {
- return data;
+ public BlockData getBlockData() {
+ return to;
}
@Override