turned ClansTips into it's own miniplugin, as it doesn't fit as a subclass of Tutorial

This commit is contained in:
NewGarbo 2015-11-23 09:04:30 +00:00
parent 47abbfbedf
commit 58ed9e586c
2 changed files with 17 additions and 26 deletions

View File

@ -17,7 +17,7 @@ import mineplex.game.clans.tutorials.commands.QAResetCommand;
import mineplex.game.clans.tutorials.commands.SkipTutorialCommand;
import mineplex.game.clans.tutorials.commands.TaskInfoCommand;
import mineplex.game.clans.tutorials.types.TutorialGettingStarted;
import mineplex.game.clans.tutorials.types.TutorialClansTips;
import mineplex.game.clans.tutorials.types.ClansTips;
public class TutorialManager extends MiniPlugin
{
@ -27,7 +27,7 @@ public class TutorialManager extends MiniPlugin
private final TaskManager _taskManager;
public TutorialManager( final JavaPlugin plugin, final GoldManager goldManager, final TaskManager taskManager, final PreferencesManager preferencesManager, final ClansManager clansManager)
public TutorialManager(final JavaPlugin plugin, final GoldManager goldManager, final TaskManager taskManager, final PreferencesManager preferencesManager, final ClansManager clansManager)
{
super("Tutorials", plugin);
@ -36,7 +36,8 @@ public class TutorialManager extends MiniPlugin
_taskManager = taskManager;
_tutorials.put(TutorialGettingStarted.class, new TutorialGettingStarted(this, clansManager, goldManager, taskManager));
_tutorials.put(TutorialClansTips.class, new TutorialClansTips( this, clansManager, goldManager, taskManager, preferencesManager));
new ClansTips(this, preferencesManager);
}
public void addCommands()

View File

@ -3,33 +3,26 @@ package mineplex.game.clans.tutorials.types;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import mineplex.core.MiniPlugin;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.preferences.PreferencesManager;
import mineplex.core.task.TaskManager;
import mineplex.game.clans.clans.ClansManager;
import mineplex.game.clans.clans.event.DominanceChangeEvent;
import mineplex.game.clans.clans.event.PlayerClaimTerritoryEvent;
import mineplex.game.clans.clans.event.PlayerEnterTerritoryEvent;
import mineplex.game.clans.clans.event.PlayerUnClaimTerritoryEvent;
import mineplex.game.clans.economy.GoldManager;
import mineplex.game.clans.tutorials.Tutorial;
import mineplex.game.clans.tutorials.TutorialManager;
public class TutorialClansTips extends Tutorial
public class ClansTips extends MiniPlugin
{
private PreferencesManager _preferences;
public TutorialClansTips(final TutorialManager manager, final ClansManager clansManager, final GoldManager goldManager, final TaskManager taskManager, final PreferencesManager preferences)
public ClansTips(final TutorialManager manager, final PreferencesManager preferences)
{
super(0, goldManager, taskManager, clansManager, manager);
super("Clans Tips", manager.getPlugin());
_preferences = preferences;
_doScoreboard = false;
_uniqueId = "ClansTipsTutorial";
_friendlyName = "Clans Game";
}
@EventHandler
@ -43,8 +36,7 @@ public class TutorialClansTips extends Tutorial
final Player player = event.getPlayer();
final String newTerritory = event.getNewTerritory();
if (_preferences.Get(player).ClanTips) // TODO: IMPLEMENT THIS INTO THE
// PREFERENCES UI
if (_preferences.Get(player).ClanTips)
{
if (newTerritory.equals("Fields"))
{
@ -78,8 +70,7 @@ public class TutorialClansTips extends Tutorial
{
final Player player = event.getClaimer();
if (_preferences.Get(player).ClanTips) // TODO: IMPLEMENT THIS INTO THE
// PREFERENCES UI
if (_preferences.Get(player).ClanTips)
{
UtilPlayer.message(player, C.cDGreenB + "You claimed some Clan Territory!");
UtilPlayer.message(player, C.cGreen + "Clan Territory is an area of the map that only your Clan is allowed to edit! This means that you can build a base and stash your loot safely inside.");
@ -94,8 +85,7 @@ public class TutorialClansTips extends Tutorial
{
final Player player = event.getUnClaimer();
if (_preferences.Get(player).ClanTips) // TODO: IMPLEMENT THIS INTO THE
// PREFERENCES UI
if (_preferences.Get(player).ClanTips)
{
UtilPlayer.message(player, C.cDGreenB + "You unclaimed some Clan Territory!");
UtilPlayer.message(player, C.cGreen + "When territory is unclaimed, it cannot be reclaimed by anyone for 30 minutes.");
@ -103,10 +93,10 @@ public class TutorialClansTips extends Tutorial
}
}
/**
*
* TODO: implement DominanceChangeEvent once Shaun creates it.
*
*/
@EventHandler
public void onDominanceChange(final DominanceChangeEvent event)
{
// TODO: pls remember ben
}
}