Search in sources :

Example 1 with PlayerQuest

use of com.solinia.solinia.Models.PlayerQuest in project solinia3-core by mixxit.

the class CommandQuests method onCommand.

@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
    if (!(sender instanceof Player))
        return false;
    try {
        Player player = (Player) sender;
        ISoliniaPlayer solplayer = SoliniaPlayerAdapter.Adapt(player);
        player.sendMessage("Aquired Quest Flags:");
        String flags = "";
        for (String questFlag : solplayer.getPlayerQuestFlags()) {
            flags += questFlag.toUpperCase() + " ";
        }
        if (flags.length() > 32767) {
            flags = flags.substring(0, 32760) + "...";
        }
        player.sendMessage(flags.trim());
        player.sendMessage("Active Quests:");
        for (PlayerQuest playerQuest : solplayer.getPlayerQuests()) {
            player.sendMessage(playerQuest.getQuest().getName() + " Complete: " + playerQuest.isComplete());
        }
    } catch (CoreStateInitException e) {
    }
    return true;
}
Also used : ISoliniaPlayer(com.solinia.solinia.Interfaces.ISoliniaPlayer) Player(org.bukkit.entity.Player) CoreStateInitException(com.solinia.solinia.Exceptions.CoreStateInitException) PlayerQuest(com.solinia.solinia.Models.PlayerQuest) ISoliniaPlayer(com.solinia.solinia.Interfaces.ISoliniaPlayer)

Aggregations

CoreStateInitException (com.solinia.solinia.Exceptions.CoreStateInitException)1 ISoliniaPlayer (com.solinia.solinia.Interfaces.ISoliniaPlayer)1 PlayerQuest (com.solinia.solinia.Models.PlayerQuest)1 Player (org.bukkit.entity.Player)1