Allow redstone to be used in server plot with redstone.disable-offline enabled.

Potentially fixes #2613
This commit is contained in:
Alexander Söderberg 2020-02-23 20:06:23 +01:00
parent 449c9f9416
commit 9eb41f05db

View File

@ -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.PlotSquared;
import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.config.Settings; 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.flag.Flags;
import com.github.intellectualsites.plotsquared.plot.listener.PlayerBlockEventType; import com.github.intellectualsites.plotsquared.plot.listener.PlayerBlockEventType;
import com.github.intellectualsites.plotsquared.plot.listener.PlotListener; import com.github.intellectualsites.plotsquared.plot.listener.PlotListener;
@ -413,17 +414,19 @@ import java.util.regex.Pattern;
return; return;
} }
if (Settings.Redstone.DISABLE_OFFLINE) { if (Settings.Redstone.DISABLE_OFFLINE) {
boolean disable; boolean disable = false;
if (plot.isMerged()) { if (!plot.getOwner().equals(DBFunc.SERVER)) {
disable = true; if (plot.isMerged()) {
for (UUID owner : plot.getOwners()) { disable = true;
if (UUIDHandler.getPlayer(owner) != null) { for (UUID owner : plot.getOwners()) {
disable = false; if (UUIDHandler.getPlayer(owner) != null) {
break; disable = false;
break;
}
} }
} else {
disable = UUIDHandler.getPlayer(plot.guessOwner()) == null;
} }
} else {
disable = UUIDHandler.getPlayer(plot.guessOwner()) == null;
} }
if (disable) { if (disable) {
for (UUID trusted : plot.getTrusted()) { for (UUID trusted : plot.getTrusted()) {