Use Settings.Teleport.ON_LOGIN

This commit is contained in:
Jesse Boyd 2019-04-19 13:02:50 +10:00
parent 815e513093
commit ea26ec628d
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F
2 changed files with 4 additions and 2 deletions

View File

@ -541,7 +541,7 @@ public abstract class PlotPlayer implements CommandCaller, OfflinePlotPlayer {
return; return;
} }
if (!Settings.Enabled_Components.PERSISTENT_META) { if (!Settings.Teleport.ON_LOGIN) {
return; return;
} }
PlotAreaManager manager = PlotSquared.get().getPlotAreaManager(); PlotAreaManager manager = PlotSquared.get().getPlotAreaManager();

View File

@ -7,6 +7,8 @@ import com.github.intellectualsites.plotsquared.plot.flag.Flag;
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.object.*; import com.github.intellectualsites.plotsquared.plot.object.*;
import com.github.intellectualsites.plotsquared.plot.object.worlds.SinglePlotArea;
import com.github.intellectualsites.plotsquared.plot.object.worlds.SinglePlotAreaManager;
import com.github.intellectualsites.plotsquared.plot.util.expiry.ExpireManager; import com.github.intellectualsites.plotsquared.plot.util.expiry.ExpireManager;
import javax.annotation.Nullable; import javax.annotation.Nullable;
@ -75,7 +77,7 @@ public abstract class EventUtil {
} }
} }
final Plot plot = player.getCurrentPlot(); final Plot plot = player.getCurrentPlot();
if (Settings.Teleport.ON_LOGIN && plot != null) { if (Settings.Teleport.ON_LOGIN && plot != null && !(plot.getArea() instanceof SinglePlotArea)) {
TaskManager.runTask(() -> plot.teleportPlayer(player)); TaskManager.runTask(() -> plot.teleportPlayer(player));
MainUtil.sendMessage(player, MainUtil.sendMessage(player,
Captions.TELEPORTED_TO_ROAD.f() + " (on-login) " + "(" + plot.getId().x + ";" + plot Captions.TELEPORTED_TO_ROAD.f() + " (on-login) " + "(" + plot.getId().x + ";" + plot