PC-21 - Combine Tutorial 1 and 2

This commit is contained in:
Shaun Bennett 2016-03-28 11:52:18 +11:00
parent f7c57a7699
commit 9ff7e2da82
4 changed files with 61 additions and 60 deletions

View File

@ -41,7 +41,6 @@ import mineplex.game.clans.tutorial.tutorials.clans.objective.ClassesObjective;
import mineplex.game.clans.tutorial.tutorials.clans.objective.EnergyObjective;
import mineplex.game.clans.tutorial.tutorials.clans.objective.FieldsObjective;
import mineplex.game.clans.tutorial.tutorials.clans.objective.FinalObjective;
import mineplex.game.clans.tutorial.tutorials.clans.objective.LeaveSpawnObjective;
import mineplex.game.clans.tutorial.tutorials.clans.objective.PurchaseItemsObjective;
import mineplex.game.clans.tutorial.tutorials.clans.objective.ShopsObjective;
//import mineplex.game.clans.tutorial.tutorials.clans.repository.TutorialRepository;
@ -69,7 +68,6 @@ public class ClansMainTutorial extends Tutorial
// _repository = new TutorialRepository(ClansManager.getInstance().getClientManager());
addObjective(new LeaveSpawnObjective(this, plugin));
addObjective(new ClanObjective(this, plugin));
addObjective(new AttackEnemyObjective(this, plugin));
addObjective(new ShopsObjective(this, npcManager, plugin));

View File

@ -11,6 +11,7 @@ import mineplex.game.clans.tutorial.tutorials.clans.objective.goals.clan.BuildHo
import mineplex.game.clans.tutorial.tutorials.clans.objective.goals.clan.ClaimLandGoal;
import mineplex.game.clans.tutorial.tutorials.clans.objective.goals.clan.ClanDetailsGoal;
import mineplex.game.clans.tutorial.tutorials.clans.objective.goals.clan.CreateClanGoal;
import mineplex.game.clans.tutorial.tutorials.clans.objective.goals.clan.LeaveSpawnGoal;
import mineplex.game.clans.tutorial.tutorials.clans.objective.goals.clan.SetHomeGoal;
public class ClanObjective extends OrderedObjective<ClansMainTutorial>
@ -19,6 +20,7 @@ public class ClanObjective extends OrderedObjective<ClansMainTutorial>
{
super(clansMainTutorial, javaPlugin, "Clans", "Create clan with /c create <name>");
addGoal(new LeaveSpawnGoal(this));
addGoal(new CreateClanGoal(this));
addGoal(new ClanDetailsGoal(this));
addGoal(new ClaimLandGoal(this));

View File

@ -1,58 +0,0 @@
package mineplex.game.clans.tutorial.tutorials.clans.objective;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.plugin.java.JavaPlugin;
import mineplex.core.common.util.C;
import mineplex.game.clans.tutorial.TutorialRegion;
import mineplex.game.clans.tutorial.objective.SingleObjective;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.game.clans.tutorial.tutorials.clans.ClansMainTutorial;
public class LeaveSpawnObjective extends SingleObjective<ClansMainTutorial>
{
public LeaveSpawnObjective(ClansMainTutorial plugin, JavaPlugin javaPlugin)
{
super(plugin, javaPlugin, "Leave Spawn", "Exit the tutorial spawn area");
}
@Override
public void setup(Player player, TutorialRegion region)
{
getPlugin().addHologram(player,
getPlugin().getPoint(region, ClansMainTutorial.Point.SPAWN).add(0, 1, -3),
C.cGoldB + "Welcome to Clans Beta!", C.cWhite + "Walk forward to Start Tutorial");
}
@Override
protected void customStart(Player player)
{
}
@Override
protected void customLeave(Player player)
{
}
@Override
protected void customFinish(Player player)
{
}
@EventHandler
public void checkRegion(UpdateEvent event)
{
if (event.getType() != UpdateType.FAST)
return;
for (Player player : getActivePlayers())
{
if (!getPlugin().isIn(player, ClansMainTutorial.Bounds.SPAWN))
{
finish(player);
}
}
}
}

View File

@ -0,0 +1,59 @@
package mineplex.game.clans.tutorial.tutorials.clans.objective.goals.clan;
import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import mineplex.core.common.util.C;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.game.clans.tutorial.TutorialRegion;
import mineplex.game.clans.tutorial.objective.ObjectiveGoal;
import mineplex.game.clans.tutorial.tutorials.clans.ClansMainTutorial;
import mineplex.game.clans.tutorial.tutorials.clans.objective.ClanObjective;
public class LeaveSpawnGoal extends ObjectiveGoal<ClanObjective>
{
public LeaveSpawnGoal(ClanObjective objective)
{
super(objective, "Leave Spawn", "Exit the tutorial spawn area");
}
@Override
protected void setup(Player player, TutorialRegion region)
{
getObjective().getPlugin().addHologram(player,
getObjective().getPlugin().getPoint(region, ClansMainTutorial.Point.SPAWN).add(0, 1, -3),
C.cGoldB + "Welcome to Clans Beta!", C.cWhite + "Walk forward to Start Tutorial");
}
@Override
protected void customStart(Player player)
{
}
@Override
protected void customFinish(Player player)
{
}
@EventHandler
public void checkRegion(UpdateEvent event)
{
if (event.getType() != UpdateType.FAST)
return;
for (UUID uuid : getActivePlayers())
{
Player player = Bukkit.getPlayer(uuid);
if (!getObjective().getPlugin().isIn(player, ClansMainTutorial.Bounds.SPAWN))
{
finish(player);
}
}
}
}