mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2025-02-28 18:21:20 +01:00
Cover item dispense behaviors.
Depends on spigot throwing events.
This commit is contained in:
parent
34ed6175e5
commit
dd90fa21c7
@ -1050,9 +1050,14 @@ public void onBlockDispense(BlockDispenseEvent event) {
|
||||
handleBlockRightClick(event, cause, item, clicked, placed);
|
||||
|
||||
// handle special dispenser behavior
|
||||
if (item != null && Materials.isShulkerBox(item.getType())) {
|
||||
Events.fireToCancel(event, new PlaceBlockEvent(event, cause, placed.getLocation(), item.getType()));
|
||||
return;
|
||||
if (Materials.isShulkerBox(item.getType())) {
|
||||
if (Events.fireToCancel(event, new PlaceBlockEvent(event, cause, placed.getLocation(), item.getType()))) {
|
||||
playDenyEffect(placed.getLocation());
|
||||
}
|
||||
} else if (isItemAppliedToBlock(item, placed)) {
|
||||
if (Events.fireToCancel(event, new PlaceBlockEvent(event, cause, placed.getLocation(), placed.getType()))) {
|
||||
playDenyEffect(placed.getLocation());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user