made it so that you can only use /reset in safe zones
This commit is contained in:
parent
d6ca52e4a4
commit
3a4e453ac3
@ -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<TutorialManager>
|
||||
@Override
|
||||
public void Execute(Player caller, String[] args)
|
||||
{
|
||||
String ignoreString = String.format(Tutorial.TUTORIAL_REWARD_TASK, "GettingStartedTutorial");
|
||||
Integer ignoreInt = TaskManager.Instance.getTaskId(ignoreString);
|
||||
|
||||
Iterator<Integer> 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<Integer> 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);
|
||||
}
|
||||
}
|
||||
|
@ -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<T extends Tutorial> implements Listener
|
||||
@ -122,6 +123,8 @@ public class TutorialTask<T extends Tutorial> implements Listener
|
||||
_tutorial._manager.sendTutorialMsg(player, " ");
|
||||
_tutorial._manager.sendTutorialMsg(player, C.cDGreenB + C.Strike + "---------------------------------------------");
|
||||
|
||||
UtilTextMiddle.display("", getDisplayName());
|
||||
|
||||
client.LastDescriptionSentTime = System.currentTimeMillis();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user