Implements a mix of #3 and #7

Adds a preset command which can be used to see available presets
Adds preset filters which can be used to specify item sub-categories within a preset
Removes SWORD_SMITH and RANGED_SMITH, as those are replaced by the RANGED and SWORD filters
Adds a list of usable filters for each preset
This commit is contained in:
2022-10-13 18:40:38 +02:00
parent 6a55300c1e
commit 12f807060e
16 changed files with 552 additions and 55 deletions

View File

@ -5,6 +5,8 @@ import net.knarcraft.blacksmith.command.BlackSmithConfigCommand;
import net.knarcraft.blacksmith.command.BlackSmithConfigTabCompleter;
import net.knarcraft.blacksmith.command.BlackSmithEditCommand;
import net.knarcraft.blacksmith.command.BlackSmithEditTabCompleter;
import net.knarcraft.blacksmith.command.PresetCommand;
import net.knarcraft.blacksmith.command.PresetTabCompleter;
import net.knarcraft.blacksmith.config.GlobalSettings;
import net.knarcraft.blacksmith.formatting.Translator;
import net.knarcraft.blacksmith.listener.NPCClickListener;
@ -88,10 +90,6 @@ public class BlacksmithPlugin extends JavaPlugin {
registerListeners();
getLogger().log(Level.INFO, " v" + getDescription().getVersion() + " enabled.");
//TODO: Improve un-setting of values for a given NPC: While setting values works fine, a bit more care should
// be performed regarding removing a custom value. Basically, using null for strings and -1 for numbers should
// unset a value for an NPC. Unsetting a value would make the NPC use the default value set in the config file
// instead
}
/**
@ -136,6 +134,12 @@ public class BlacksmithPlugin extends JavaPlugin {
blacksmithConfigCommand.setExecutor(new BlackSmithConfigCommand());
blacksmithConfigCommand.setTabCompleter(new BlackSmithConfigTabCompleter());
}
PluginCommand presetCommand = this.getCommand("preset");
if (presetCommand != null) {
presetCommand.setExecutor(new PresetCommand());
presetCommand.setTabCompleter(new PresetTabCompleter());
}
}
}