mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-09-28 22:57:29 +02: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);
|
handleBlockRightClick(event, cause, item, clicked, placed);
|
||||||
|
|
||||||
// handle special dispenser behavior
|
// handle special dispenser behavior
|
||||||
if (item != null && Materials.isShulkerBox(item.getType())) {
|
if (Materials.isShulkerBox(item.getType())) {
|
||||||
Events.fireToCancel(event, new PlaceBlockEvent(event, cause, placed.getLocation(), item.getType()));
|
if (Events.fireToCancel(event, new PlaceBlockEvent(event, cause, placed.getLocation(), item.getType()))) {
|
||||||
return;
|
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