Search in sources :

Example 1 with TeamOptionKey

use of com.massivecraft.massivecore.nms.TeamOptionKey in project MassiveCore by MassiveCraft.

the class BoardUtil method createPersonalTeam.

public static Team createPersonalTeam(Scoreboard board, Object key) {
    // Create
    String id = getKey(key);
    Team team = createTeam(board, id);
    // Fill
    Boolean persistent = PERSONAL_DEFAULT_PERSISTENT;
    String name = PERSONAL_DEFAULT_NAME;
    String prefix = PERSONAL_DEFAULT_PREFIX;
    String suffix = PERSONAL_DEFAULT_SUFFIX;
    Boolean friendlyFireEnabled = PERSONAL_DEFAULT_FRIENDLY_FIRE_ENABLED;
    Boolean friendlyTruesightEnabled = PERSONAL_DEFAULT_FRIENDLY_TRUESIGHT_ENABLED;
    Map<TeamOptionKey, TeamOptionValue> options = PERSONAL_DEFAULT_OPTIONS;
    Set<String> members = Collections.singleton(id);
    setTeam(team, persistent, name, prefix, suffix, friendlyFireEnabled, friendlyTruesightEnabled, options, members);
    // Return
    return team;
}
Also used : TeamOptionValue(com.massivecraft.massivecore.nms.TeamOptionValue) Team(org.bukkit.scoreboard.Team) TeamOptionKey(com.massivecraft.massivecore.nms.TeamOptionKey)

Example 2 with TeamOptionKey

use of com.massivecraft.massivecore.nms.TeamOptionKey in project MassiveCore by MassiveCraft.

the class BoardUtil method setTeamOptions.

public static boolean setTeamOptions(Team team, Map<TeamOptionKey, TeamOptionValue> options) {
    if (options == null)
        return false;
    boolean ret = false;
    for (Entry<TeamOptionKey, TeamOptionValue> entry : options.entrySet()) {
        TeamOptionKey option = entry.getKey();
        TeamOptionValue status = entry.getValue();
        ret |= setTeamOption(team, option, status);
    }
    return ret;
}
Also used : TeamOptionValue(com.massivecraft.massivecore.nms.TeamOptionValue) TeamOptionKey(com.massivecraft.massivecore.nms.TeamOptionKey)

Example 3 with TeamOptionKey

use of com.massivecraft.massivecore.nms.TeamOptionKey in project MassiveCore by MassiveCraft.

the class BoardUtil method getTeamOptions.

// -------------------------------------------- //
// TEAM > OPTIONS
// -------------------------------------------- //
public static Map<TeamOptionKey, TeamOptionValue> getTeamOptions(Team team) {
    // Create
    Map<TeamOptionKey, TeamOptionValue> ret = new MassiveMap<>();
    // Fill
    for (TeamOptionKey key : TeamOptionKey.values()) {
        TeamOptionValue value = getTeamOption(team, key);
        if (value == null)
            continue;
        ret.put(key, value);
    }
    // Return
    return ret;
}
Also used : TeamOptionValue(com.massivecraft.massivecore.nms.TeamOptionValue) MassiveMap(com.massivecraft.massivecore.collections.MassiveMap) TeamOptionKey(com.massivecraft.massivecore.nms.TeamOptionKey)

Aggregations

TeamOptionKey (com.massivecraft.massivecore.nms.TeamOptionKey)3 TeamOptionValue (com.massivecraft.massivecore.nms.TeamOptionValue)3 MassiveMap (com.massivecraft.massivecore.collections.MassiveMap)1 Team (org.bukkit.scoreboard.Team)1