Exemple #1
0
        public ScoreboardObjective registerObjective(string name, ScoreboardCriteria criteria)
        {
            var obj = new ScoreboardObjective()
            {
                Name     = name,
                Criteria = criteria
            };

            objective = obj;
            return(objective);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
		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;
		}