mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-05 02:19:30 +01:00
Fire a use item event on placed blocks.
This commit is contained in:
parent
182c5f6a17
commit
7a8ab1df99
@ -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()));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user