Starts on the Scrapper implementation
This commit is contained in:
@ -0,0 +1,83 @@
|
||||
package net.knarcraft.blacksmith.config.scrapper;
|
||||
|
||||
import net.knarcraft.blacksmith.config.NPCSetting;
|
||||
import net.knarcraft.blacksmith.config.SettingValueType;
|
||||
|
||||
public enum ScrapperNPCSetting implements NPCSetting {
|
||||
|
||||
/**
|
||||
* The setting for whether the NPC should drop an item to the ground when finished
|
||||
*
|
||||
* <p>If set to false, the item will be directly put in the player's inventory instead</p>
|
||||
*/
|
||||
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"),
|
||||
|
||||
/*-----------
|
||||
| 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"),
|
||||
;
|
||||
|
||||
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 <p>The full config path for this setting</p>
|
||||
* @param valueType <p>The type of value used by this setting</p>
|
||||
* @param value <p>The default value of this setting</p>
|
||||
* @param commandName <p>The name of the command used to change this setting</p>
|
||||
*/
|
||||
ScrapperNPCSetting(String path, SettingValueType valueType, Object value, String commandName) {
|
||||
this.path = "defaults." + path;
|
||||
this.value = value;
|
||||
this.valueType = valueType;
|
||||
this.childPath = path;
|
||||
this.commandName = commandName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getChildPath() {
|
||||
return childPath;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getDefaultValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return commandName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SettingValueType getValueType() {
|
||||
return this.valueType;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
package net.knarcraft.blacksmith.config.scrapper;
|
||||
|
||||
public class ScrapperNPCSettings {
|
||||
}
|
Reference in New Issue
Block a user