diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/commands/RestartTutCommand.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/commands/RestartTutCommand.java index 2b599831f..be19befc8 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/commands/RestartTutCommand.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/commands/RestartTutCommand.java @@ -7,6 +7,7 @@ import org.bukkit.entity.Player; import mineplex.core.command.CommandBase; import mineplex.core.common.Rank; import mineplex.core.task.TaskManager; +import mineplex.game.clans.clans.ClansManager; import mineplex.game.clans.tutorials.Tutorial; import mineplex.game.clans.tutorials.TutorialManager; import mineplex.game.clans.tutorials.gettingstarted.TutorialGettingStarted; @@ -21,20 +22,28 @@ public class RestartTutCommand extends CommandBase @Override public void Execute(Player caller, String[] args) { - String ignoreString = String.format(Tutorial.TUTORIAL_REWARD_TASK, "GettingStartedTutorial"); - Integer ignoreInt = TaskManager.Instance.getTaskId(ignoreString); - - Iterator it = TaskManager.Instance.Get(caller).TasksCompleted.iterator(); - while (it.hasNext()) + if (ClansManager.getInstance().getClanUtility().getClaim(caller.getLocation()) != null + && ClansManager.getInstance().getClanUtility().getClaim(caller.getLocation()).isSafe(caller.getLocation())) { - Integer i = it.next(); - if (i != null && (ignoreInt == null || i.intValue() != ignoreInt.intValue())) + String ignoreString = String.format(Tutorial.TUTORIAL_REWARD_TASK, "GettingStartedTutorial"); + Integer ignoreInt = TaskManager.Instance.getTaskId(ignoreString); + + Iterator it = TaskManager.Instance.Get(caller).TasksCompleted.iterator(); + while (it.hasNext()) { - it.remove(); + Integer i = it.next(); + if (i != null && (ignoreInt == null || i.intValue() != ignoreInt.intValue())) + { + it.remove(); + } } + + TutorialManager.Instance.cancelTutorial(caller); + TutorialManager.Instance.startTutorial(TutorialGettingStarted.class, caller); + } + else + { + TutorialManager.Instance.sendTutorialMsg(caller, "You must be in a safezone to restart the tutorial."); } - - TutorialManager.Instance.cancelTutorial(caller); - TutorialManager.Instance.startTutorial(TutorialGettingStarted.class, caller); } } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/TutorialTask.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/TutorialTask.java index 909d303d6..0934fff08 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/TutorialTask.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/TutorialTask.java @@ -7,6 +7,7 @@ import org.bukkit.event.Listener; import mineplex.core.common.util.C; import mineplex.core.common.util.NautArrayList; import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilTextMiddle; import mineplex.game.clans.clans.ClansManager; public class TutorialTask implements Listener @@ -122,6 +123,8 @@ public class TutorialTask implements Listener _tutorial._manager.sendTutorialMsg(player, " "); _tutorial._manager.sendTutorialMsg(player, C.cDGreenB + C.Strike + "---------------------------------------------"); + UtilTextMiddle.display("", getDisplayName()); + client.LastDescriptionSentTime = System.currentTimeMillis(); } }