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;
}
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;
}
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;
}
Aggregations