Skip to content

Commit

Permalink
Check water/lava placement from dispensers on edge of region.
Browse files Browse the repository at this point in the history
Fixes WORLDGUARD-4161.
  • Loading branch information
wizjany committed Jan 4, 2020
1 parent 4a7552e commit b835ee3
Showing 1 changed file with 7 additions and 0 deletions.
Expand Up @@ -1068,6 +1068,13 @@ private static <T extends Event & Cancellable> void handleBlockRightClick(T even
Events.fireToCancel(event, new SpawnEntityEvent(event, cause, placed.getLocation().add(0.5, 0, 0.5), Materials.getEntitySpawnEgg(item.getType()))); Events.fireToCancel(event, new SpawnEntityEvent(event, cause, placed.getLocation().add(0.5, 0, 0.5), Materials.getEntitySpawnEgg(item.getType())));
return; 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) { private static <T extends Event & Cancellable> void handleInventoryHolderUse(T originalEvent, Cause cause, InventoryHolder holder) {
Expand Down

0 comments on commit b835ee3

Please sign in to comment.