Made Skill API use materials instead of ToolTypes

This commit is contained in:
ile123ile 2014-08-31 17:49:21 -07:00
parent b18d81836d
commit 65400bcfae

View File

@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.bukkit.Color; import org.bukkit.Color;
import org.bukkit.Material;
import com.gmail.nossr50.commands.skills.SkillCommand; import com.gmail.nossr50.commands.skills.SkillCommand;
import com.gmail.nossr50.config.AdvancedConfig; import com.gmail.nossr50.config.AdvancedConfig;
@ -13,6 +14,7 @@ import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.datatypes.skills.ToolType; import com.gmail.nossr50.datatypes.skills.ToolType;
import com.gmail.nossr50.datatypes.skills.SkillType.SkillUseType; import com.gmail.nossr50.datatypes.skills.SkillType.SkillUseType;
import com.gmail.nossr50.skills.SkillManager; import com.gmail.nossr50.skills.SkillManager;
import com.gmail.nossr50.util.StringUtils;
import com.gmail.nossr50.util.commands.CommandRegistrationManager; import com.gmail.nossr50.util.commands.CommandRegistrationManager;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
@ -107,22 +109,18 @@ public final class SkillAPI {
return skill; return skill;
} }
public static SkillType createSkill(String name, Class<? extends SkillManager> managerClass, Class<? extends SkillCommand> commandClass, boolean isChild, Color runescapeColor, SkillUseType skillUseType, AbilityType ability, ToolType tool, List<SecondaryAbility> secondaryAbilities) { public static SkillType createSkill(String name, Class<? extends SkillManager> managerClass, Class<? extends SkillCommand> commandClass, boolean isChild, Color runescapeColor, SkillUseType skillUseType, AbilityType ability, Material material, List<SecondaryAbility> secondaryAbilities) {
SkillType skill = SkillType.createSkill(name, managerClass, commandClass, isChild, runescapeColor, skillUseType, ability, tool, secondaryAbilities); SkillType skill = SkillType.createSkill(name, managerClass, commandClass, isChild, runescapeColor, skillUseType, ability, ToolType.createToolType(StringUtils.getCapitalized(name), material), secondaryAbilities);
CommandRegistrationManager.registerSkillCommandAndPassSkillToConstructor(skill); CommandRegistrationManager.registerSkillCommandAndPassSkillToConstructor(skill);
return skill; return skill;
} }
public static SkillType createSkill(String name, Class<? extends SkillManager> managerClass, Class<? extends SkillCommand> commandClass, boolean isChild, Color runescapeColor, SkillUseType skillUseType, SecondaryAbility... secondaryAbilities) { public static SkillType createSkill(String name, Class<? extends SkillManager> managerClass, Class<? extends SkillCommand> commandClass, boolean isChild, Color runescapeColor, SkillUseType skillUseType, SecondaryAbility... secondaryAbilities) {
SkillType skill = SkillType.createSkill(name, managerClass, commandClass, isChild, runescapeColor, skillUseType, ImmutableList.copyOf(secondaryAbilities)); return createSkill(name, managerClass, commandClass, isChild, runescapeColor, skillUseType, ImmutableList.copyOf(secondaryAbilities));
CommandRegistrationManager.registerSkillCommandAndPassSkillToConstructor(skill);
return skill;
} }
public static SkillType createSkill(String name, Class<? extends SkillManager> managerClass, Class<? extends SkillCommand> commandClass, boolean isChild, Color runescapeColor, SkillUseType skillUseType, AbilityType ability, ToolType tool, SecondaryAbility... secondaryAbilities) { public static SkillType createSkill(String name, Class<? extends SkillManager> managerClass, Class<? extends SkillCommand> commandClass, boolean isChild, Color runescapeColor, SkillUseType skillUseType, AbilityType ability, Material material, SecondaryAbility... secondaryAbilities) {
SkillType skill = SkillType.createSkill(name, managerClass, commandClass, isChild, runescapeColor, skillUseType, ability, tool, ImmutableList.copyOf(secondaryAbilities)); return createSkill(name, managerClass, commandClass, isChild, runescapeColor, skillUseType, ability, material, ImmutableList.copyOf(secondaryAbilities));
CommandRegistrationManager.registerSkillCommandAndPassSkillToConstructor(skill);
return skill;
} }
public static void loadNewSkills() { public static void loadNewSkills() {