Fire a use item event on placed blocks.

This commit is contained in:
sk89q 2014-08-24 13:45:39 -07:00
parent 182c5f6a17
commit 7a8ab1df99

View File

@ -142,6 +142,9 @@ public void onBlockPlace(BlockPlaceEvent event) {
Events.fireToCancel(event, new BreakBlockEvent(event, create(event.getPlayer()), previousState.getLocation(), previousState.getType()));
}
ItemStack itemStack = new ItemStack(event.getBlockPlaced().getType(), 1);
Events.fireToCancel(event, new UseItemEvent(event, create(event.getPlayer()), event.getPlayer().getWorld(), itemStack));
Events.fireToCancel(event, new PlaceBlockEvent(event, create(event.getPlayer()), event.getBlock()));
}