package net.knarcraft.blacksmith.config.scrapper; import net.knarcraft.blacksmith.config.NPCSetting; import net.knarcraft.blacksmith.config.SettingValueType; import org.jetbrains.annotations.NotNull; public enum ScrapperNPCSetting implements NPCSetting { /** * The setting for whether the NPC should drop an item to the ground when finished * *

If set to false, the item will be directly put in the player's inventory instead

*/ DROP_ITEM("dropItem", SettingValueType.BOOLEAN, true, "dropItem"), /** * The chance of a scrapper returning no salvage, regardless of item condition */ FAIL_SALVAGE_CHANCE("failSalvageChance", SettingValueType.POSITIVE_DOUBLE, 0, "failSalvageChance"), /** * The setting for which items a scrapper is able to salvage */ SALVAGE_ABLE_ITEMS("salvageAbleItems", SettingValueType.REFORGE_ABLE_ITEMS, "", "salvageAbleItems"), /** * The maximum amount of seconds a player may need to wait for the reforging to finish */ MAX_SALVAGE_DELAY("delaysInSeconds.maximum", SettingValueType.POSITIVE_INTEGER, 30, "maxReforgeDelay"), /** * The minimum amount of seconds a player may need to wait for the reforging to finish */ MIN_SALVAGE_DELAY("delaysInSeconds.minimum", SettingValueType.POSITIVE_INTEGER, 5, "minReforgeDelay"), /** * The setting for number of seconds a player has to wait between each usage of the blacksmith */ SALVAGE_COOL_DOWN("delaysInSeconds.reforgeCoolDown", SettingValueType.POSITIVE_INTEGER, 60, "reforgeCoolDown"), /*----------- | Messages | -----------*/ /** * The message displayed when the scrapper is busy with another player */ BUSY_WITH_PLAYER_MESSAGE("messages.busyPlayerMessage", SettingValueType.STRING, "&cI'm busy at the moment. Come back later!", "busyPlayerMessage"), /** * The message displayed when the scrapper is busy salvaging the player's item */ BUSY_WITH_SALVAGE_MESSAGE("messages.busySalvageMessage", SettingValueType.STRING, "&cI'm working on it. Be patient! I'll finish {time}!", "busySalvageMessage"), /** * The message displayed if the player needs to wait for the cool-down to expire */ COOL_DOWN_UNEXPIRED_MESSAGE("messages.coolDownUnexpiredMessage", SettingValueType.STRING, "&cYou've already had your chance! Give me a break! I'll be ready {time}!", "coolDownUnexpiredMessage"), /** * The message displayed if presented with an item that cannot be salvaged by the NPC */ CANNOT_SALVAGE_MESSAGE("messages.cannotSalvageMessage", SettingValueType.STRING, "&cI'm unable to salvage that item", "cannotSalvageMessage"), /** * The message displayed if salvaging an item would return in no items */ TOO_DAMAGED_FOR_SALVAGE_MESSAGE("messages.tooDamagedForSalvageMessage", SettingValueType.STRING, "&cThat item is too damaged to be salvaged into anything useful", "tooDamagedForSalvageMessage"), /** * The message displayed if a salvage is successful */ SUCCESS_SALVAGE_MESSAGE("messages.successSalvagedMessage", SettingValueType.STRING, "&cThere you go!", "successSalvagedMessage"), /** * The message displayed if a player presents a different item after seeing the price to reforge an item */ ITEM_UNEXPECTEDLY_CHANGED_MESSAGE("messages.itemChangedMessage", SettingValueType.STRING, "&cThat's not the item you wanted to reforge before!", "itemChangedMessage"), /** * The message displayed when the scrapper starts salvaging an item */ START_SALVAGE_MESSAGE("messages.startSalvageMessage", SettingValueType.STRING, "&eOk, let's see what I can do...", "startSalvageMessage"), ; private final String path; private final String childPath; private final Object value; private final String commandName; private final SettingValueType valueType; /** * Instantiates a new setting * * @param path

The full config path for this setting

* @param valueType

The type of value used by this setting

* @param value

The default value of this setting

* @param commandName

The name of the command used to change this setting

*/ ScrapperNPCSetting(String path, SettingValueType valueType, Object value, String commandName) { this.path = "scrapper.defaults." + path; this.value = value; this.valueType = valueType; this.childPath = path; this.commandName = commandName; } @Override public @NotNull String getPath() { return path; } @Override public @NotNull String getChildPath() { return childPath; } @Override public @NotNull Object getDefaultValue() { return value; } @Override public @NotNull String getCommandName() { return commandName; } @Override public @NotNull SettingValueType getValueType() { return this.valueType; } }