From c7de9379ad5ddbb9c3739e3a14f88b280061f482 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20S=C3=B6derberg?= Date: Mon, 24 Feb 2020 11:47:52 +0100 Subject: [PATCH] Prevent liquids from flowing out of block walls. Fixes #2598. --- .../plotsquared/bukkit/listeners/PlayerEvents.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlayerEvents.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlayerEvents.java index 66977d308..1c76668f0 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlayerEvents.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlayerEvents.java @@ -1432,6 +1432,13 @@ import java.util.regex.Pattern; } else if (!area.contains(fLocation.getX(), fLocation.getZ()) || !Objects .equals(null, area.getOwnedPlot(fLocation))) { event.setCancelled(true); + } else if (event.getBlock().isLiquid()) { + final org.bukkit.Location location = event.getBlock().getLocation(); + if (BukkitUtil.getPlot(location.clone().add(0, 0, 1)) != null || + BukkitUtil.getPlot(location.clone().add(1, 0, 0)) != null || + BukkitUtil.getPlot(location.clone().add(1, 0, 1)) != null) { + event.setCancelled(true); + } } }