From bf406493e35acf403dbfd7d059d186b26d0f5a56 Mon Sep 17 00:00:00 2001 From: NewGarbo Date: Wed, 21 Oct 2015 20:14:35 +0100 Subject: [PATCH 1/4] Fixed tutorial tasks that rely on territory entrances not working because formatting... --- .../game/clans/tutorials/types/TutorialGettingStarted.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/types/TutorialGettingStarted.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/types/TutorialGettingStarted.java index 08002cd91..5b0d99c8f 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/types/TutorialGettingStarted.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/types/TutorialGettingStarted.java @@ -66,15 +66,15 @@ public class TutorialGettingStarted extends Tutorial public void onEnterTerritory(Player player, String ownerString) { - if (isInTutorial(player) && ownerString.endsWith("Spawn") && get(player).hasFinishedPart(getPart(2)) && !get(player).hasFinishedPart(getPart(3))) + if (isInTutorial(player) && ownerString.contains("Spawn") && get(player).hasFinishedPart(getPart(2)) && !get(player).hasFinishedPart(getPart(3))) { getPart(3).getWaiter().consume(player); } - else if (isInTutorial(player) && ownerString.endsWith("Wilderness") && get(player).hasFinishedPart(getPart(3)) && !get(player).hasFinishedPart(getPart(4))) + else if (isInTutorial(player) && ownerString.contains("Wilderness") && get(player).hasFinishedPart(getPart(3)) && !get(player).hasFinishedPart(getPart(4))) { getPart(4).getWaiter().consume(player); } - else if (isInTutorial(player) && ownerString.endsWith("Shops") && get(player).hasFinishedPart(getPart(5)) && !get(player).hasFinishedPart(getPart(6))) + else if (isInTutorial(player) && ownerString.contains("Shops") && get(player).hasFinishedPart(getPart(5)) && !get(player).hasFinishedPart(getPart(6))) { getPart(6).getWaiter().consume(player); } From 825b519890ad021298ec9034bbecb5321b4381e6 Mon Sep 17 00:00:00 2001 From: NewGarbo Date: Wed, 21 Oct 2015 21:51:12 +0100 Subject: [PATCH 2/4] Finalization of tutorials, made my code more consistent, and renamed any parts of code that referred to tasks as parts refer to them as "tasks." Removed unused imports, and other code cleanup stuff. Renamed EndTutorialCommand to SkipTutorialCommand as the actual command is "/skiptutorial" instaed of "/endtutorial" --- .../game/clans/tutorials/PlayerTutorial.java | 31 +++-- .../game/clans/tutorials/Tutorial.java | 66 +++++------ .../game/clans/tutorials/TutorialManager.java | 19 ++-- .../{TutorialPart.java => TutorialTask.java} | 13 +-- .../game/clans/tutorials/TutorialType.java | 16 +-- .../commands/OngoingOptOutCommand.java | 2 +- .../tutorials/commands/QAResetCommand.java | 12 +- ...lCommand.java => SkipTutorialCommand.java} | 4 +- .../tutorials/commands/TaskInfoCommand.java | 2 +- .../types/TutorialGettingStarted.java | 106 +++++++++--------- .../tutorials/types/TutorialOnGoingMap.java | 2 +- 11 files changed, 118 insertions(+), 155 deletions(-) rename Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/{TutorialPart.java => TutorialTask.java} (75%) rename Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/commands/{EndTutorialCommand.java => SkipTutorialCommand.java} (83%) diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/PlayerTutorial.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/PlayerTutorial.java index 6db82f050..f51823f5a 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/PlayerTutorial.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/PlayerTutorial.java @@ -12,8 +12,8 @@ public class PlayerTutorial private final Tutorial _tutorial; private final Player _player; - private int _currentPart = 1; - private HashMap _data = new HashMap<>(); + private final HashMap _data = new HashMap<>(); + private int _currentTask = 1; public PlayerTutorial(final Player player, final TaskManager taskManager, final Tutorial tutorial) { @@ -26,23 +26,22 @@ public class PlayerTutorial { PlayerTutorial user = new PlayerTutorial(player, taskManager, tutorial); - for (int i : tutorial.getParts().keySet()) + for (final int i : tutorial.getTasks().keySet()) { - if (taskManager.hasCompletedTask(player, tutorial.getType().getId() + tutorial.getPart(i).getNameID())) + if (taskManager.hasCompletedTask(player, tutorial.getType().getId() + tutorial.getTask(i).getNameID())) { - user._currentPart = i; - + user._currentTask = i; } } - tutorial.getPart(user._currentPart).sendDescriptionTo(player); + tutorial.getTask(user._currentTask).sendDescriptionTo(player); return user; } - public int getCurrentPart() + public int getCurrentTask() { - return _currentPart; + return _currentTask; } public Tutorial getTutorial() @@ -60,29 +59,29 @@ public class PlayerTutorial return _taskManager; } - public void finishedPart(final int partID) + public void setTaskFinished(final int taskID) { - _currentPart = partID + 1; + _currentTask = taskID + 1; } - public boolean hasFinishedPart(TutorialPart part) + public boolean hasFinishedTask(final TutorialTask task) { - return part.getID() < _currentPart; + return task.getID() < _currentTask; } - public T getData(String name, T defValue) + public T getData(final String name, final T defValue) { if (!_data.containsKey(name)) _data.put(name, defValue); return (T) _data.get(name); } - public T getData(String name) + public T getData(final String name) { return (T) _data .get(name); } - public void setData(String name, T value) + public void setData(final String name, final T value) { _data.put(name, value); } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/Tutorial.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/Tutorial.java index d109f7c6a..10b4320a3 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/Tutorial.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/Tutorial.java @@ -10,7 +10,6 @@ import org.bukkit.entity.Player; import org.bukkit.event.Listener; import org.bukkit.util.Vector; -import mineplex.core.common.Pair; import mineplex.core.common.util.C; import mineplex.core.common.util.Callback; import mineplex.core.common.util.F; @@ -38,7 +37,7 @@ public abstract class Tutorial implements ScoreboardElement, Listener private final int _rewardAmount; - private final HashMap>> _parts; + private final HashMap _tasks; protected final HashMap _inTutorial; private final TutorialType _type; @@ -52,13 +51,13 @@ public abstract class Tutorial implements ScoreboardElement, Listener _rewardAmount = rewardAmount; _manager = manager; _type = type; - _parts = new HashMap<>(); + _tasks = new HashMap<>(); _inTutorial = new HashMap<>(); } - public ArrayList getLines(ScoreboardManager manager, Player player, ArrayList out) + public ArrayList getLines(final ScoreboardManager manager, final Player player, final ArrayList out) { - ArrayList lines = new ArrayList<>(); + final ArrayList lines = new ArrayList<>(); if (!isInTutorial(player) || !_doScoreboard) { @@ -67,19 +66,19 @@ public abstract class Tutorial implements ScoreboardElement, Listener out.clear(); - PlayerTutorial ptutorial = _inTutorial.get(player.getName()); + final PlayerTutorial ptutorial = _inTutorial.get(player.getName()); lines.add(C.cAqua + _type.getFriendlyName() + " Tutorial"); - for (Pair> part : _parts.values()) + for (final TutorialTask task : _tasks.values()) { - if (ptutorial.hasFinishedPart(part.getLeft())) + if (ptutorial.hasFinishedTask(task)) { - lines.add(C.cGreen + part.getLeft().getID() + ". " + part.getLeft().getName()); + lines.add(C.cGreen + task.getID() + ". " + task.getName()); } else { - lines.add(C.cRed + part.getLeft().getID() + ". " + part.getLeft().getName()); + lines.add(C.cRed + task.getID() + ". " + task.getName()); } } @@ -90,36 +89,26 @@ public abstract class Tutorial implements ScoreboardElement, Listener return lines; } - protected Consumer addPart(final int id, final String name, final String description) + protected void addTask(final int id, final String name, final String description) { - final Consumer consumer = new Consumer() - { - public void consume(Player player) - { - finishPart(player, id); - } - }; - - _parts.put(id, Pair.create(new TutorialPart(id, name, description, consumer), consumer)); - - return consumer; + _tasks.put(id, new TutorialTask(id, name, description)); } - private void finishPart(final Player player, final int partID) + protected void finishTask(final Player player, final int taskID) { - final Pair> part = _parts.get(partID); + final TutorialTask task = _tasks.get(taskID); - _inTutorial.get(player.getName()).finishedPart(partID); + _inTutorial.get(player.getName()).setTaskFinished(taskID); - if (!_taskManager.hasCompletedTask(player, _type.getId() + part.getLeft().getNameID())) + if (!_taskManager.hasCompletedTask(player, _type.getId() + task.getNameID())) { _taskManager.completedTask(new Callback() { - public void run(Boolean completed) + public void run(final Boolean completed) { - UtilPlayer.message(player, F.main("Tutorials", "You have completed task " + F.elem(partID + " (" + part.getLeft().getName() + ")") + ". " + (_parts.size() - partID) + " tasks to go!")); + UtilPlayer.message(player, F.main("Tutorials", "You have completed task " + F.elem(taskID + " (" + task.getName() + ")") + ". " + (_tasks.size() - taskID) + " tasks to go!")); - if (partID == _parts.size()) + if (taskID == _tasks.size()) { finishFor(player); } @@ -129,25 +118,20 @@ public abstract class Tutorial implements ScoreboardElement, Listener { public void run() { - _parts.get(partID + 1).getLeft().sendDescriptionTo(player); - newPart(partID + 1); + _tasks.get(taskID + 1).sendDescriptionTo(player); } }, 40L); } player.playSound(player.getLocation(), Sound.LEVEL_UP, 2f, 1.5f); } - }, player, _type.getId() + part.getLeft().getNameID()); + }, player, _type.getId() + task.getNameID()); } } - protected void newPart(int partID) + public TutorialTask getTask(final int taskID) { - } - - public TutorialPart getPart(final int partID) - { - return _parts.get(partID).getLeft(); + return _tasks.get(taskID); } public TutorialType getType() @@ -166,7 +150,7 @@ public abstract class Tutorial implements ScoreboardElement, Listener { _taskManager.completedTask(new Callback() { - public void run(Boolean completed) + public void run(final Boolean completed) { _goldManager.addGold(player, _rewardAmount); UtilPlayer.message(player, F.main("Tutorials", "You have been awarded " + F.elem(_rewardAmount + " Gold") + ".")); @@ -212,9 +196,9 @@ public abstract class Tutorial implements ScoreboardElement, Listener return _inTutorial.containsKey(player); } - public HashMap>> getParts() + public HashMap getTasks() { - return _parts; + return _tasks; } public boolean hasDoneBefore(final Player player) diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/TutorialManager.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/TutorialManager.java index 17a852cef..b42a1c58b 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/TutorialManager.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/TutorialManager.java @@ -13,7 +13,7 @@ import mineplex.core.common.util.UtilPlayer; import mineplex.core.task.TaskManager; import mineplex.game.clans.clans.ClansManager; import mineplex.game.clans.economy.GoldManager; -import mineplex.game.clans.tutorials.commands.EndTutorialCommand; +import mineplex.game.clans.tutorials.commands.SkipTutorialCommand; import mineplex.game.clans.tutorials.commands.QAResetCommand; import mineplex.game.clans.tutorials.commands.TaskInfoCommand; import mineplex.game.clans.tutorials.types.TutorialGettingStarted; @@ -25,8 +25,7 @@ public class TutorialManager extends MiniPlugin private final HashMap _tutorials = new HashMap<>(); - private TaskManager _taskManager; - + private final TaskManager _taskManager; public TutorialManager(final JavaPlugin plugin, final GoldManager goldManager, final TaskManager taskManager, final ClansManager clansManager) { @@ -44,7 +43,7 @@ public class TutorialManager extends MiniPlugin public void addCommands() { - this.addCommand(new EndTutorialCommand(this)); + this.addCommand(new SkipTutorialCommand(this)); this.addCommand(new TaskInfoCommand(this)); this.addCommand(new QAResetCommand(this)); } @@ -76,9 +75,9 @@ public class TutorialManager extends MiniPlugin }, 40L); } - public boolean isInTutorial(Player player) + public boolean isInTutorial(final Player player) { - for (Tutorial tutorial : _tutorials.values()) + for (final Tutorial tutorial : _tutorials.values()) { if (tutorial.isInTutorial(player)) { @@ -89,9 +88,9 @@ public class TutorialManager extends MiniPlugin return false; } - public void cancelTutorial(Player player) + public void cancelTutorial(final Player player) { - for (Tutorial tutorial : _tutorials.values()) + for (final Tutorial tutorial : _tutorials.values()) { if (tutorial.isInTutorial(player)) { @@ -102,9 +101,9 @@ public class TutorialManager extends MiniPlugin } } - public Tutorial getTutorial(Player player) + public Tutorial getTutorial(final Player player) { - for (Tutorial tutorial : _tutorials.values()) + for (final Tutorial tutorial : _tutorials.values()) { if (tutorial.isInTutorial(player)) { diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/TutorialPart.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/TutorialTask.java similarity index 75% rename from Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/TutorialPart.java rename to Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/TutorialTask.java index 35cb041cb..394c85963 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/TutorialPart.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/TutorialTask.java @@ -6,19 +6,17 @@ import mineplex.core.common.util.C; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilText; -public class TutorialPart +public class TutorialTask { private final String _name; private final String _description; private final int _id; - private final Consumer _waiter; - public TutorialPart(final int id, final String name, final String description, final Consumer waiter) + public TutorialTask(final int id, final String name, final String description) { _id = id; _name = name; _description = description; - _waiter = waiter; } public int getID() @@ -41,16 +39,11 @@ public class TutorialPart return _name.replace(" ", ""); } - public void sendDescriptionTo(Player player) + public void sendDescriptionTo(final Player player) { UtilPlayer.message(player, C.cGreen + "==== Pt." + _id + ": " + _name + " ===="); UtilPlayer.message(player, UtilText.insertEvery(_description, C.cYellow, 20).replace("{", C.cAqua).replace("}", C.cYellow)); UtilPlayer.message(player, C.cGreen + UtilText.repeat("=", _name.length() + ("=== Pt." + _id + ": ===").length())); } - - public Consumer getWaiter() - { - return _waiter; - } } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/TutorialType.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/TutorialType.java index d48c1c987..b6503104a 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/TutorialType.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/TutorialType.java @@ -1,29 +1,19 @@ package mineplex.game.clans.tutorials; -import mineplex.game.clans.tutorials.types.TutorialGettingStarted; -import mineplex.game.clans.tutorials.types.TutorialOnGoingMap; - public enum TutorialType { - GETTING_STARTED(TutorialGettingStarted.class, "Getting Started", "GettingStartedTutorial"), - ON_GOING(TutorialOnGoingMap.class, "Ongoing Map", "OngoingMapTutorial"); + GETTING_STARTED("Getting Started", "GettingStartedTutorial"), + ON_GOING("Ongoing Map", "OngoingMapTutorial"); - private final Class _clazz; private final String _uniqueId; private final String _friendlyName; - TutorialType(final Class clazz, final String friendlyName, final String uniqueId) + TutorialType( final String friendlyName, final String uniqueId) { - _clazz = clazz; _uniqueId = uniqueId; _friendlyName = friendlyName; } - public Class getClazz() - { - return _clazz; - } - public String getId() { return _uniqueId; diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/commands/OngoingOptOutCommand.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/commands/OngoingOptOutCommand.java index cb30efe42..ad0789cc5 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/commands/OngoingOptOutCommand.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/commands/OngoingOptOutCommand.java @@ -21,7 +21,7 @@ public class OngoingOptOutCommand extends CommandBase { Plugin.getTaskManager().completedTask(new Callback() { - public void run(Boolean completed) + public void run(final Boolean completed) { UtilPlayer.message(caller, F.main("Tutorials", "You have opted out of territory warnings, be careful!")); } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/commands/QAResetCommand.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/commands/QAResetCommand.java index c4dd83038..10e622087 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/commands/QAResetCommand.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/commands/QAResetCommand.java @@ -5,13 +5,11 @@ import java.util.Arrays; import org.bukkit.entity.Player; import mineplex.core.command.CommandBase; -import mineplex.core.common.Pair; import mineplex.core.common.Rank; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilPlayer; -import mineplex.game.clans.tutorials.Consumer; import mineplex.game.clans.tutorials.TutorialManager; -import mineplex.game.clans.tutorials.TutorialPart; +import mineplex.game.clans.tutorials.TutorialTask; import mineplex.game.clans.tutorials.TutorialType; import mineplex.game.clans.tutorials.types.TutorialGettingStarted; @@ -31,17 +29,17 @@ public class QAResetCommand extends CommandBase // ANNOYING PLEASE DON'T HARM ME IT'S // ONLY A TEMP COMMAND FOR TESTING { - TutorialGettingStarted tutorial = (TutorialGettingStarted) Plugin.getTutorials().get(TutorialType.GETTING_STARTED); + final TutorialGettingStarted tutorial = (TutorialGettingStarted) Plugin.getTutorials().get(TutorialType.GETTING_STARTED); UtilPlayer.message(caller, F.main("Tutorials", Arrays.toString(Plugin.getTaskManager().Get(caller).TasksCompleted.toArray()))); Plugin.getTaskManager().Get(caller).TasksCompleted.remove(Plugin.getTaskManager().getTaskId(tutorial.getType().getId())); UtilPlayer.message(caller, F.main("Tutorials", "Removed " + F.elem(tutorial.getType().getId()))); - for (Pair> part : tutorial.getParts().values()) + for (final TutorialTask task : tutorial.getTasks().values()) { - Plugin.getTaskManager().Get(caller).TasksCompleted.remove(Plugin.getTaskManager().getTaskId(tutorial.getType().getId() + part.getLeft().getNameID())); - UtilPlayer.message(caller, F.main("Tutorials", "Removed " + F.elem(tutorial.getType().getId() + part.getLeft().getNameID()) + " (" + Plugin.getTaskManager().getTaskId(tutorial.getType().getId() + part.getLeft().getNameID()) + ")")); + Plugin.getTaskManager().Get(caller).TasksCompleted.remove(Plugin.getTaskManager().getTaskId(tutorial.getType().getId() + task.getNameID())); + UtilPlayer.message(caller, F.main("Tutorials", "Removed " + F.elem(tutorial.getType().getId() + task.getNameID()) + " (" + Plugin.getTaskManager().getTaskId(tutorial.getType().getId() + task.getNameID()) + ")")); } UtilPlayer.message(caller, F.main("Tutorials", Arrays.toString(Plugin.getTaskManager().Get(caller).TasksCompleted.toArray()))); diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/commands/EndTutorialCommand.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/commands/SkipTutorialCommand.java similarity index 83% rename from Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/commands/EndTutorialCommand.java rename to Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/commands/SkipTutorialCommand.java index 0fa8f041a..7401dfd88 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/commands/EndTutorialCommand.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/commands/SkipTutorialCommand.java @@ -8,9 +8,9 @@ import mineplex.core.common.util.F; import mineplex.core.common.util.UtilPlayer; import mineplex.game.clans.tutorials.TutorialManager; -public class EndTutorialCommand extends CommandBase +public class SkipTutorialCommand extends CommandBase { - public EndTutorialCommand(final TutorialManager plugin) + public SkipTutorialCommand(final TutorialManager plugin) { super(plugin, Rank.ALL, "skiptutorial", "skiptut", "st"); } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/commands/TaskInfoCommand.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/commands/TaskInfoCommand.java index df1b69d02..5e98b32c0 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/commands/TaskInfoCommand.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/commands/TaskInfoCommand.java @@ -20,7 +20,7 @@ public class TaskInfoCommand extends CommandBase { if (Plugin.isInTutorial(caller)) { - Plugin.getTutorial(caller).getPart(Plugin.getTutorial(caller).get(caller).getCurrentPart()).sendDescriptionTo(caller); + Plugin.getTutorial(caller).getTask(Plugin.getTutorial(caller).get(caller).getCurrentTask()).sendDescriptionTo(caller); } else { diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/types/TutorialGettingStarted.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/types/TutorialGettingStarted.java index 5b0d99c8f..301453498 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/types/TutorialGettingStarted.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/types/TutorialGettingStarted.java @@ -28,17 +28,17 @@ public class TutorialGettingStarted extends Tutorial { super(50, goldManager, taskManager, clansManager, manager, TutorialType.GETTING_STARTED); - addPart(1, "Create A Clan", "To create your own clan, type {/c create [name]}. Don’t worry about being though, you can always disband this clan and join another later if you need to!"); - addPart(2, "Viewing Clan Info", "Now you can view information about your clan. To do this type {/c [name]}! You can also use any clans name to get some information about them as well."); - addPart(3, "Leave Spawn", "Now you can leave the Spawn Island. Don't worry, you won’t get hurt from the fall! Once you jump off though, PvP is enabled! Be careful!"); - addPart(4, "Go To The Wilderness", "Access your map with {/map} and head out into the wilderness! You’ll see various other locations marked on your map later."); - addPart(5, "Claiming Territory", "In order to claim a chunk of land for your clan you type {/c claim}! Notice though, your clan runs on energy! You can buy energy from the shops!"); - addPart(6, "Visit The Shops", "At the shops you can buy most things you need! Once a day you can transfer 1000 gems to 5000 clans gold here as well!"); - addPart(7, "Buy Armor", "Head to the PvP Gear villager and purchase a set of armor! Make sure to buy a matching set to access your class skills!"); - addPart(8, "Equip Armor", "In order to equip a kit, you must put on the full armor set of that kit! Put on the armor set you just bought and you will have selected your kit!"); - addPart(9, "Use An Ability", "In order to use abilities you need a sword or axe. To use your sword ability, right click with your sword! To use your axe ability, right click with your axe!"); - addPart(10, "Class Customization", "To customize your class, right click an enchantment table! There you will find the GUI for all the skills in that class! Customize it to your liking!"); - addPart(11, "Clan Home", "In order to set a clan home, type {/c sethome}. You can only use {/c home} from the spawn island every 5 minutes to return home!"); + addTask(1, "Create A Clan", "To create your own clan, type {/c create [name]}. Don’t worry about being though, you can always disband this clan and join another later if you need to!"); + addTask(2, "Viewing Clan Info", "Now you can view information about your clan. To do this type {/c [name]}! You can also use any clans name to get some information about them as well."); + addTask(3, "Leave Spawn", "Now you can leave the Spawn Island. Don't worry, you won’t get hurt from the fall! Once you jump off though, PvP is enabled! Be careful!"); + addTask(4, "Go To The Wilderness", "Access your map with {/map} and head out into the wilderness! You’ll see various other locations marked on your map later."); + addTask(5, "Claiming Territory", "In order to claim a chunk of land for your clan you type {/c claim}! Notice though, your clan runs on energy! You can buy energy from the shops!"); + addTask(6, "Visit The Shops", "At the shops you can buy most things you need! Once a day you can transfer 1000 gems to 5000 clans gold here as well!"); + addTask(7, "Buy Armor", "Head to the PvP Gear villager and purchase a set of armor! Make sure to buy a matching set to access your class skills!"); + addTask(8, "Equip Armor", "In order to equip a kit, you must put on the full armor set of that kit! Put on the armor set you just bought and you will have selected your kit!"); + addTask(9, "Use An Ability", "In order to use abilities you need a sword or axe. To use your sword ability, right click with your sword! To use your axe ability, right click with your axe!"); + addTask(10, "Class Customization", "To customize your class, right click an enchantment table! There you will find the GUI for all the skills in that class! Customize it to your liking!"); + addTask(11, "Clan Home", "In order to set a clan home, type {/c sethome}. You can only use {/c home} from the spawn island every 5 minutes to return home!"); _doScoreboard = true; } @@ -48,49 +48,49 @@ public class TutorialGettingStarted extends Tutorial UtilPlayer.message(player, F.main("Tutorials", "You are now ready to play, welcome to the game.")); } - public void onClanCreated(String caller, String name) + public void onClanCreated(final String caller, final String name) { - if (isInTutorial(caller) && !get(Bukkit.getPlayer(caller)).hasFinishedPart(getPart(1))) + if (isInTutorial(caller) && !get(Bukkit.getPlayer(caller)).hasFinishedTask(getTask(1))) { - getPart(1).getWaiter().consume(Bukkit.getPlayer(caller)); + finishTask(Bukkit.getPlayer(caller), 1); } } - public void onClanInfo(Player caller, String name) + public void onClanInfo(final Player caller, final String name) { - if (isInTutorial(caller.getName()) && get(caller).hasFinishedPart(getPart(1)) && !get(caller).hasFinishedPart(getPart(2))) + if (isInTutorial(caller.getName()) && get(caller).hasFinishedTask(getTask(1)) && !get(caller).hasFinishedTask(getTask(2))) { - getPart(2).getWaiter().consume(caller); + finishTask(caller, 2); } } - public void onEnterTerritory(Player player, String ownerString) + public void onEnterTerritory(final Player player, final String ownerString) { - if (isInTutorial(player) && ownerString.contains("Spawn") && get(player).hasFinishedPart(getPart(2)) && !get(player).hasFinishedPart(getPart(3))) + if (isInTutorial(player) && ownerString.contains("Spawn") && get(player).hasFinishedTask(getTask(2)) && !get(player).hasFinishedTask(getTask(3))) { - getPart(3).getWaiter().consume(player); + finishTask(player, 3); } - else if (isInTutorial(player) && ownerString.contains("Wilderness") && get(player).hasFinishedPart(getPart(3)) && !get(player).hasFinishedPart(getPart(4))) + else if (isInTutorial(player) && ownerString.contains("Wilderness") && get(player).hasFinishedTask(getTask(3)) && !get(player).hasFinishedTask(getTask(4))) { - getPart(4).getWaiter().consume(player); + finishTask(player, 4); } - else if (isInTutorial(player) && ownerString.contains("Shops") && get(player).hasFinishedPart(getPart(5)) && !get(player).hasFinishedPart(getPart(6))) + else if (isInTutorial(player) && ownerString.contains("Shops") && get(player).hasFinishedTask(getTask(5)) && !get(player).hasFinishedTask(getTask(6))) { - getPart(6).getWaiter().consume(player); + finishTask(player, 6); } } - public void onClaim(Player caller) + public void onClaim(final Player caller) { - if (isInTutorial(caller) && get(caller).hasFinishedPart(getPart(4)) && !get(caller).hasFinishedPart(getPart(5))) + if (isInTutorial(caller) && get(caller).hasFinishedTask(getTask(4)) && !get(caller).hasFinishedTask(getTask(5))) { - getPart(5).getWaiter().consume(caller); + finishTask(caller, 5); } } - public void onItemBought(Player player, ItemStack item) + public void onItemBought(final Player player, final ItemStack item) { - if (isInTutorial(player) && get(player).hasFinishedPart(getPart(6)) && !get(player).hasFinishedPart(getPart(7))) + if (isInTutorial(player) && get(player).hasFinishedTask(getTask(6)) && !get(player).hasFinishedTask(getTask(7))) { if (get(player).getData("amount", 0) < 3) { @@ -98,87 +98,87 @@ public class TutorialGettingStarted extends Tutorial } else { - getPart(7).getWaiter().consume(player); + finishTask(player, 7); } } } @EventHandler(priority = EventPriority.MONITOR) - public void onInventoryClick(InventoryClickEvent event) + public void onInventoryClick(final InventoryClickEvent event) { if (event.getWhoClicked() instanceof Player) { - Player player = (Player) event.getWhoClicked(); + final Player player = (Player) event.getWhoClicked(); - if (isInTutorial(player) && get(player).hasFinishedPart(getPart(7)) && !get(player).hasFinishedPart(getPart(8))) + if (isInTutorial(player) && get(player).hasFinishedTask(getTask(7)) && !get(player).hasFinishedTask(getTask(8))) { - ClientClass clientclass = _clansManager.getClassManager().Get(player); + final ClientClass clientclass = _clansManager.getClassManager().Get(player); if (clientclass != null && clientclass.GetGameClass() != null) { - getPart(8).getWaiter().consume(player); + finishTask(player, 8); } } } } @EventHandler(priority = EventPriority.MONITOR) - public void onInteract(PlayerInteractEvent event) + public void onInteract(final PlayerInteractEvent event) { if (event.getAction().name().contains("RIGHT_CLICK")) { - Player player = event.getPlayer(); + final Player player = event.getPlayer(); - if (isInTutorial(player) && get(player).hasFinishedPart(getPart(7)) && !get(player).hasFinishedPart(getPart(8))) + if (isInTutorial(player) && get(player).hasFinishedTask(getTask(7)) && !get(player).hasFinishedTask(getTask(8))) { - ClientClass clientclass = _clansManager.getClassManager().Get(player); + final ClientClass clientclass = _clansManager.getClassManager().Get(player); if (clientclass != null && clientclass.GetGameClass() != null) { - getPart(8).getWaiter().consume(player); + finishTask(player, 8); } } } } @EventHandler(priority = EventPriority.MONITOR) - public void onSkillTriggered(SkillTriggerEvent event) + public void onSkillTriggered(final SkillTriggerEvent event) { - Player player = event.GetPlayer(); + final Player player = event.GetPlayer(); - if (isInTutorial(player) && get(player).hasFinishedPart(getPart(8)) && !get(player).hasFinishedPart(getPart(9))) + if (isInTutorial(player) && get(player).hasFinishedTask(getTask(8)) && !get(player).hasFinishedTask(getTask(9))) { - getPart(9).getWaiter().consume(player); + finishTask(player, 9); } } @EventHandler(priority = EventPriority.MONITOR) - public void onUpdate(UpdateEvent event) + public void onUpdate(final UpdateEvent event) { if (event.getType().equals(UpdateType.SEC)) { - for (PlayerTutorial tut : _inTutorial.values()) + for (final PlayerTutorial tut : _inTutorial.values()) { - if (isInTutorial(tut.getPlayer()) && get(tut.getPlayer()).hasFinishedPart(getPart(9)) && !get(tut.getPlayer()).hasFinishedPart(getPart(10))) + if (isInTutorial(tut.getPlayer()) && get(tut.getPlayer()).hasFinishedTask(getTask(9)) && !get(tut.getPlayer()).hasFinishedTask(getTask(10))) { - ClientClass clientclass = _clansManager.getClassManager().Get(tut.getPlayer()); + final ClientClass clientclass = _clansManager.getClassManager().Get(tut.getPlayer()); if (clientclass != null && clientclass.GetSavingCustomBuild() != null) { - getPart(10).getWaiter().consume(tut.getPlayer()); + finishTask(tut.getPlayer(), 10); } } } } } - public void onHomeSet(String name) + public void onHomeSet(final String name) { - Player player = Bukkit.getPlayer(name); + final Player player = Bukkit.getPlayer(name); - if (isInTutorial(player) && get(player).hasFinishedPart(getPart(10)) && !get(player).hasFinishedPart(getPart(11))) + if (isInTutorial(player) && get(player).hasFinishedTask(getTask(10)) && !get(player).hasFinishedTask(getTask(11))) { - getPart(11).getWaiter().consume(player); + finishTask(player, 11); } } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/types/TutorialOnGoingMap.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/types/TutorialOnGoingMap.java index 38af58081..255611787 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/types/TutorialOnGoingMap.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/types/TutorialOnGoingMap.java @@ -21,7 +21,7 @@ public class TutorialOnGoingMap extends Tutorial _doScoreboard = false; } - public void onEnterTerritory(Player player, String ownerString) + public void onEnterTerritory(final Player player, final String ownerString) { if (!_taskManager.hasCompletedTask(player, "ClansOnGoingOptOut")) { From 18d998fc04e3162b3d7b4e69a6fb9faa5a200651 Mon Sep 17 00:00:00 2001 From: NewGarbo Date: Fri, 23 Oct 2015 05:56:53 +0100 Subject: [PATCH 3/4] Fixed colors cutting out in the middle of the message in task information, moar fireworks! --- .../src/mineplex/core/common/util/UtilText.java | 13 ------------- .../src/mineplex/game/clans/tutorials/Tutorial.java | 8 +++++--- .../mineplex/game/clans/tutorials/TutorialTask.java | 2 +- 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilText.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilText.java index 2095bc1fe..cffbc5f3e 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilText.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilText.java @@ -100,17 +100,4 @@ public class UtilText { { return new String(new byte[times]).replace("\0", txt); } - - public static String insertEvery(String txt, String insert, int chars) - { - StringBuilder builder = new StringBuilder(insert + txt); - if (txt.length() > chars) - { - for (int i = 0; i < txt.length() / chars; i++) - { - builder.insert(chars * i, insert); - } - } - return builder.toString(); - } } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/Tutorial.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/Tutorial.java index 10b4320a3..cd899a4a6 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/Tutorial.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/Tutorial.java @@ -14,7 +14,9 @@ import mineplex.core.common.util.C; import mineplex.core.common.util.Callback; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilFirework; +import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.scoreboard.ScoreboardManager; import mineplex.core.scoreboard.elements.ScoreboardElement; import mineplex.core.task.TaskManager; @@ -155,16 +157,16 @@ public abstract class Tutorial implements ScoreboardElement, Listener _goldManager.addGold(player, _rewardAmount); UtilPlayer.message(player, F.main("Tutorials", "You have been awarded " + F.elem(_rewardAmount + " Gold") + ".")); - for (int i = 0; i < 5; i++) + for (int i = 0; i < 8; i++) { final int index = i; _manager.getPlugin().getServer().getScheduler().scheduleSyncDelayedTask(_manager.getPlugin(), new Runnable() { public void run() { - UtilFirework.launchFirework(player.getLocation(), Type.BALL_LARGE, (index % 2 == 0) ? Color.RED : Color.LIME, false, false, new Vector(0, 0, 0), 1); + UtilFirework.launchFirework(player.getLocation(), Type.BALL_LARGE, (index % 2 == 0) ? Color.RED : Color.LIME, false, false, new Vector(0, 0, 0), 0); } - }, i * 30); + }, i * 10); } } }, player, _type.getId()); 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 394c85963..0ccd59234 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 @@ -42,7 +42,7 @@ public class TutorialTask public void sendDescriptionTo(final Player player) { UtilPlayer.message(player, C.cGreen + "==== Pt." + _id + ": " + _name + " ===="); - UtilPlayer.message(player, UtilText.insertEvery(_description, C.cYellow, 20).replace("{", C.cAqua).replace("}", C.cYellow)); + UtilPlayer.message(player, C.cYellow + _description.replace("{", C.cAqua).replace("}", C.cYellow)); UtilPlayer.message(player, C.cGreen + UtilText.repeat("=", _name.length() + ("=== Pt." + _id + ": ===").length())); } From 4c381d41fe16b8836ae66f172efdf00ed1b26000 Mon Sep 17 00:00:00 2001 From: NewGarbo Date: Fri, 23 Oct 2015 06:10:09 +0100 Subject: [PATCH 4/4] Fixed second tutorial task misspelling, and added the first tutorial, which is /c help, as I completely forgot about it in the first place. --- .../types/TutorialGettingStarted.java | 86 +++++++++++-------- 1 file changed, 50 insertions(+), 36 deletions(-) diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/types/TutorialGettingStarted.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/types/TutorialGettingStarted.java index 301453498..34efecf73 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/types/TutorialGettingStarted.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorials/types/TutorialGettingStarted.java @@ -5,6 +5,7 @@ import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.inventory.InventoryClickEvent; +import org.bukkit.event.player.PlayerCommandPreprocessEvent; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.inventory.ItemStack; @@ -28,17 +29,18 @@ public class TutorialGettingStarted extends Tutorial { super(50, goldManager, taskManager, clansManager, manager, TutorialType.GETTING_STARTED); - addTask(1, "Create A Clan", "To create your own clan, type {/c create [name]}. Don’t worry about being though, you can always disband this clan and join another later if you need to!"); - addTask(2, "Viewing Clan Info", "Now you can view information about your clan. To do this type {/c [name]}! You can also use any clans name to get some information about them as well."); - addTask(3, "Leave Spawn", "Now you can leave the Spawn Island. Don't worry, you won’t get hurt from the fall! Once you jump off though, PvP is enabled! Be careful!"); - addTask(4, "Go To The Wilderness", "Access your map with {/map} and head out into the wilderness! You’ll see various other locations marked on your map later."); - addTask(5, "Claiming Territory", "In order to claim a chunk of land for your clan you type {/c claim}! Notice though, your clan runs on energy! You can buy energy from the shops!"); - addTask(6, "Visit The Shops", "At the shops you can buy most things you need! Once a day you can transfer 1000 gems to 5000 clans gold here as well!"); - addTask(7, "Buy Armor", "Head to the PvP Gear villager and purchase a set of armor! Make sure to buy a matching set to access your class skills!"); - addTask(8, "Equip Armor", "In order to equip a kit, you must put on the full armor set of that kit! Put on the armor set you just bought and you will have selected your kit!"); - addTask(9, "Use An Ability", "In order to use abilities you need a sword or axe. To use your sword ability, right click with your sword! To use your axe ability, right click with your axe!"); - addTask(10, "Class Customization", "To customize your class, right click an enchantment table! There you will find the GUI for all the skills in that class! Customize it to your liking!"); - addTask(11, "Clan Home", "In order to set a clan home, type {/c sethome}. You can only use {/c home} from the spawn island every 5 minutes to return home!"); + addTask(1, "Welcome", "Welcome to Clans! Before you start playing Clans, you should be familiar with the various commands. Type {/c help} now to view all of the commands for Clans!"); + addTask(2, "Create A Clan", "To create your own clan, type {/c create [name]}. Don’t worry about your friends though, you can always disband this clan and join another later if you need to!"); + addTask(3, "Viewing Clan Info", "Now you can view information about your clan. To do this type {/c [name]}! You can also use any clans name to get some information about them as well."); + addTask(4, "Leave Spawn", "Now you can leave the Spawn Island. Don't worry, you won’t get hurt from the fall! Once you jump off though, PvP is enabled! Be careful!"); + addTask(5, "Go To The Wilderness", "Access your map with {/map} and head out into the wilderness! You’ll see various other locations marked on your map later."); + addTask(6, "Claiming Territory", "In order to claim a chunk of land for your clan you type {/c claim}! Notice though, your clan runs on energy! You can buy energy from the shops!"); + addTask(7, "Visit The Shops", "At the shops you can buy most things you need! Once a day you can transfer 1000 gems to 5000 clans gold here as well!"); + addTask(8, "Buy Armor", "Head to the PvP Gear villager and purchase a set of armor! Make sure to buy a matching set to access your class skills!"); + addTask(9, "Equip Armor", "In order to equip a kit, you must put on the full armor set of that kit! Put on the armor set you just bought and you will have selected your kit!"); + addTask(10, "Use An Ability", "In order to use abilities you need a sword or axe. To use your sword ability, right click with your sword! To use your axe ability, right click with your axe!"); + addTask(11, "Class Customization", "To customize your class, right click an enchantment table! There you will find the GUI for all the skills in that class! Customize it to your liking!"); + addTask(12, "Clan Home", "In order to set a clan home, type {/c sethome}. You can only use {/c home} from the spawn island every 5 minutes to return home!"); _doScoreboard = true; } @@ -48,49 +50,61 @@ public class TutorialGettingStarted extends Tutorial UtilPlayer.message(player, F.main("Tutorials", "You are now ready to play, welcome to the game.")); } + @EventHandler + public void onCommandPreprocess(final PlayerCommandPreprocessEvent event) + { + if (event.getMessage().startsWith("/c help") || event.getMessage().startsWith("/clans help") || event.getMessage().startsWith("/clan help") || event.getMessage().startsWith("/factions help")) + { + if (isInTutorial(event.getPlayer()) && !get(event.getPlayer()).hasFinishedTask(getTask(1))) + { + finishTask(event.getPlayer(), 1); + } + } + } + public void onClanCreated(final String caller, final String name) { - if (isInTutorial(caller) && !get(Bukkit.getPlayer(caller)).hasFinishedTask(getTask(1))) + if (isInTutorial(caller) && get(Bukkit.getPlayer(caller)).hasFinishedTask(getTask(1)) && !get(Bukkit.getPlayer(caller)).hasFinishedTask(getTask(2))) { - finishTask(Bukkit.getPlayer(caller), 1); + finishTask(Bukkit.getPlayer(caller), 2); } } public void onClanInfo(final Player caller, final String name) { - if (isInTutorial(caller.getName()) && get(caller).hasFinishedTask(getTask(1)) && !get(caller).hasFinishedTask(getTask(2))) + if (isInTutorial(caller.getName()) && get(caller).hasFinishedTask(getTask(2)) && !get(caller).hasFinishedTask(getTask(3))) { - finishTask(caller, 2); + finishTask(caller, 3); } } public void onEnterTerritory(final Player player, final String ownerString) { - if (isInTutorial(player) && ownerString.contains("Spawn") && get(player).hasFinishedTask(getTask(2)) && !get(player).hasFinishedTask(getTask(3))) - { - finishTask(player, 3); - } - else if (isInTutorial(player) && ownerString.contains("Wilderness") && get(player).hasFinishedTask(getTask(3)) && !get(player).hasFinishedTask(getTask(4))) + if (isInTutorial(player) && ownerString.contains("Spawn") && get(player).hasFinishedTask(getTask(3)) && !get(player).hasFinishedTask(getTask(4))) { finishTask(player, 4); } - else if (isInTutorial(player) && ownerString.contains("Shops") && get(player).hasFinishedTask(getTask(5)) && !get(player).hasFinishedTask(getTask(6))) + else if (isInTutorial(player) && ownerString.contains("Wilderness") && get(player).hasFinishedTask(getTask(4)) && !get(player).hasFinishedTask(getTask(5))) { - finishTask(player, 6); + finishTask(player, 5); + } + else if (isInTutorial(player) && ownerString.contains("Shops") && get(player).hasFinishedTask(getTask(6)) && !get(player).hasFinishedTask(getTask(7))) + { + finishTask(player, 7); } } public void onClaim(final Player caller) { - if (isInTutorial(caller) && get(caller).hasFinishedTask(getTask(4)) && !get(caller).hasFinishedTask(getTask(5))) + if (isInTutorial(caller) && get(caller).hasFinishedTask(getTask(5)) && !get(caller).hasFinishedTask(getTask(6))) { - finishTask(caller, 5); + finishTask(caller, 6); } } public void onItemBought(final Player player, final ItemStack item) { - if (isInTutorial(player) && get(player).hasFinishedTask(getTask(6)) && !get(player).hasFinishedTask(getTask(7))) + if (isInTutorial(player) && get(player).hasFinishedTask(getTask(7)) && !get(player).hasFinishedTask(getTask(8))) { if (get(player).getData("amount", 0) < 3) { @@ -98,7 +112,7 @@ public class TutorialGettingStarted extends Tutorial } else { - finishTask(player, 7); + finishTask(player, 8); } } } @@ -110,13 +124,13 @@ public class TutorialGettingStarted extends Tutorial { final Player player = (Player) event.getWhoClicked(); - if (isInTutorial(player) && get(player).hasFinishedTask(getTask(7)) && !get(player).hasFinishedTask(getTask(8))) + if (isInTutorial(player) && get(player).hasFinishedTask(getTask(8)) && !get(player).hasFinishedTask(getTask(9))) { final ClientClass clientclass = _clansManager.getClassManager().Get(player); if (clientclass != null && clientclass.GetGameClass() != null) { - finishTask(player, 8); + finishTask(player, 9); } } } @@ -129,13 +143,13 @@ public class TutorialGettingStarted extends Tutorial { final Player player = event.getPlayer(); - if (isInTutorial(player) && get(player).hasFinishedTask(getTask(7)) && !get(player).hasFinishedTask(getTask(8))) + if (isInTutorial(player) && get(player).hasFinishedTask(getTask(8)) && !get(player).hasFinishedTask(getTask(9))) { final ClientClass clientclass = _clansManager.getClassManager().Get(player); if (clientclass != null && clientclass.GetGameClass() != null) { - finishTask(player, 8); + finishTask(player, 9); } } } @@ -146,9 +160,9 @@ public class TutorialGettingStarted extends Tutorial { final Player player = event.GetPlayer(); - if (isInTutorial(player) && get(player).hasFinishedTask(getTask(8)) && !get(player).hasFinishedTask(getTask(9))) + if (isInTutorial(player) && get(player).hasFinishedTask(getTask(9)) && !get(player).hasFinishedTask(getTask(10))) { - finishTask(player, 9); + finishTask(player, 10); } } @@ -159,13 +173,13 @@ public class TutorialGettingStarted extends Tutorial { for (final PlayerTutorial tut : _inTutorial.values()) { - if (isInTutorial(tut.getPlayer()) && get(tut.getPlayer()).hasFinishedTask(getTask(9)) && !get(tut.getPlayer()).hasFinishedTask(getTask(10))) + if (isInTutorial(tut.getPlayer()) && get(tut.getPlayer()).hasFinishedTask(getTask(10)) && !get(tut.getPlayer()).hasFinishedTask(getTask(11))) { final ClientClass clientclass = _clansManager.getClassManager().Get(tut.getPlayer()); if (clientclass != null && clientclass.GetSavingCustomBuild() != null) { - finishTask(tut.getPlayer(), 10); + finishTask(tut.getPlayer(), 11); } } } @@ -176,9 +190,9 @@ public class TutorialGettingStarted extends Tutorial { final Player player = Bukkit.getPlayer(name); - if (isInTutorial(player) && get(player).hasFinishedTask(getTask(10)) && !get(player).hasFinishedTask(getTask(11))) + if (isInTutorial(player) && get(player).hasFinishedTask(getTask(11)) && !get(player).hasFinishedTask(getTask(12))) { - finishTask(player, 11); + finishTask(player, 12); } }