From 9eb41f05db1cde0bfa9612f8d91b88f8cd34dd57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20S=C3=B6derberg?= Date: Sun, 23 Feb 2020 20:06:23 +0100 Subject: [PATCH] Allow redstone to be used in server plot with `redstone.disable-offline` enabled. Potentially fixes #2613 --- .../bukkit/listeners/PlayerEvents.java | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) 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 bd49e4df9..9c3219687 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 @@ -6,6 +6,7 @@ import com.github.intellectualsites.plotsquared.bukkit.util.BukkitUtil; import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Settings; +import com.github.intellectualsites.plotsquared.plot.database.DBFunc; import com.github.intellectualsites.plotsquared.plot.flag.Flags; import com.github.intellectualsites.plotsquared.plot.listener.PlayerBlockEventType; import com.github.intellectualsites.plotsquared.plot.listener.PlotListener; @@ -413,17 +414,19 @@ import java.util.regex.Pattern; return; } if (Settings.Redstone.DISABLE_OFFLINE) { - boolean disable; - if (plot.isMerged()) { - disable = true; - for (UUID owner : plot.getOwners()) { - if (UUIDHandler.getPlayer(owner) != null) { - disable = false; - break; + boolean disable = false; + if (!plot.getOwner().equals(DBFunc.SERVER)) { + if (plot.isMerged()) { + disable = true; + for (UUID owner : plot.getOwners()) { + if (UUIDHandler.getPlayer(owner) != null) { + disable = false; + break; + } } + } else { + disable = UUIDHandler.getPlayer(plot.guessOwner()) == null; } - } else { - disable = UUIDHandler.getPlayer(plot.guessOwner()) == null; } if (disable) { for (UUID trusted : plot.getTrusted()) {