diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Visit.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Visit.java index ea5647b66..5c38ea63f 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Visit.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Visit.java @@ -5,6 +5,7 @@ import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; 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.flag.Flags; import com.github.intellectualsites.plotsquared.plot.object.*; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.MathMan; @@ -129,7 +130,8 @@ import java.util.concurrent.CompletableFuture; return CompletableFuture.completedFuture(false); } } else { - if (!Permissions.hasPermission(player, Captions.PERMISSION_VISIT_OTHER)) { + if (!Permissions.hasPermission(player, Captions.PERMISSION_VISIT_OTHER) && + !Flags.UNTRUSTED_VISIT.isTrue(plot)) { Captions.NO_PERMISSION.send(player, Captions.PERMISSION_VISIT_OTHER); return CompletableFuture.completedFuture(false); } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/Flags.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/Flags.java index fc203a00b..d3f98041c 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/Flags.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/Flags.java @@ -121,6 +121,7 @@ public final class Flags { public static final BooleanFlag SLEEP = new BooleanFlag("sleep"); public static final TeleportDenyFlag DENY_TELEPORT = new TeleportDenyFlag("deny-teleport"); public static final BooleanFlag DENY_EXIT = new BooleanFlag("deny-exit"); + public static final BooleanFlag UNTRUSTED_VISIT = new BooleanFlag("untrusted-visit"); private static final HashMap> flags;