public ScoreboardObjective registerObjective(string name, ScoreboardCriteria criteria) { var obj = new ScoreboardObjective() { Name = name, Criteria = criteria }; objective = obj; return(objective); }
public string ScoreboardObjectivesAdd(string objectiveName, ScoreboardCriteria criteria, string displayName = "") { if (string.IsNullOrWhiteSpace(objectiveName)) { throw new ArgumentNullException("objectiveName", "You must provide the objective name."); } string cmd = string.Empty; if (!string.IsNullOrWhiteSpace(displayName)) { cmd = string.Format(TonkaCommands.CMD_SCOREBOARD_OBJ_ADD_2, objectiveName, EnumUtils.GetEnumDefaultValue(criteria), displayName); } else { cmd = string.Format(TonkaCommands.CMD_SCOREBOARD_OBJ_ADD, objectiveName, EnumUtils.GetEnumDefaultValue(criteria)); } string result = SendCommand(cmd); return(result); }
public string ScoreboardObjectivesAdd(string objectiveName, ScoreboardCriteria criteria, string displayName = "") { if (string.IsNullOrWhiteSpace(objectiveName)) { throw new ArgumentNullException("objectiveName", "You must provide the objective name."); } string cmd = string.Empty; if (!string.IsNullOrWhiteSpace(displayName)) { cmd = string.Format(TonkaCommands.CMD_SCOREBOARD_OBJ_ADD_2, objectiveName, EnumUtils.GetEnumDefaultValue(criteria), displayName); } else { cmd = string.Format(TonkaCommands.CMD_SCOREBOARD_OBJ_ADD, objectiveName, EnumUtils.GetEnumDefaultValue(criteria)); } string result = SendCommand(cmd); return result; }