Skip to content
Permalink
Browse files

Check water/lava placement from dispensers on edge of region.

Fixes WORLDGUARD-4161.
  • Loading branch information
wizjany committed Jan 4, 2020
1 parent 4a7552e commit b835ee39d5ce73afb2e7b9af8eb1b2c61495a451
@@ -1068,6 +1068,13 @@ public void onTakeLecternBook(PlayerTakeLecternBookEvent event) {
Events.fireToCancel(event, new SpawnEntityEvent(event, cause, placed.getLocation().add(0.5, 0, 0.5), Materials.getEntitySpawnEgg(item.getType())));
return;
}

// handle water/lava placement
if (item != null && (item.getType() == Material.WATER_BUCKET || item.getType() == Material.LAVA_BUCKET)) {
Events.fireToCancel(event, new PlaceBlockEvent(event, cause, placed.getLocation(),
item.getType() == Material.WATER_BUCKET ? Material.WATER : Material.LAVA));
return;
}
}

private static <T extends Event & Cancellable> void handleInventoryHolderUse(T originalEvent, Cause cause, InventoryHolder holder) {

0 comments on commit b835ee3

Please sign in to comment.
You can’t perform that action at this time.