diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/bukkit/event/block/BlockPlaceEvent.java | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/main/java/org/bukkit/event/block/BlockPlaceEvent.java b/src/main/java/org/bukkit/event/block/BlockPlaceEvent.java index 3c9489e2..c84b9c6e 100644 --- a/src/main/java/org/bukkit/event/block/BlockPlaceEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockPlaceEvent.java @@ -1,9 +1,10 @@ package org.bukkit.event.block; import org.bukkit.block.Block; -import org.bukkit.inventory.ItemStack; +import org.bukkit.block.BlockState; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; +import org.bukkit.inventory.ItemStack; /** * Not implemented yet @@ -12,14 +13,16 @@ public class BlockPlaceEvent extends BlockEvent implements Cancellable { protected boolean cancel; protected boolean canBuild; protected Block placedAgainst; + protected BlockState replacedBlockState; protected ItemStack itemInHand; protected Player player; - public BlockPlaceEvent(Type type, Block placedBlock, Block placedAgainst, ItemStack itemInHand, Player thePlayer, boolean canBuild) { + public BlockPlaceEvent(Type type, Block placedBlock, BlockState replacedBlockState, Block placedAgainst, ItemStack itemInHand, Player thePlayer, boolean canBuild) { super(type, placedBlock); this.placedAgainst = placedAgainst; this.itemInHand = itemInHand; this.player = thePlayer; + this.replacedBlockState = replacedBlockState; this.canBuild = canBuild; cancel = false; } @@ -63,6 +66,15 @@ public class BlockPlaceEvent extends BlockEvent implements Cancellable { return getBlock(); } + /** + * Returns the state of the block which was replaced. Material type air mostly. + * + * @return BlockState of block which was replaced. + */ + public BlockState getBlockReplacedState() { + return this.replacedBlockState; + } + /** * Get the block that this block was placed against |