Removes unnecessary options #8

Removes the DISABLE_COOL_DOWN option
Removes the DISABLE_DELAY option
Uses the old DISABLE_COOL_DOWN behavior if cool-down is set to 0 or below
Uses the old DISABLE_DELAY behavior if max-delay is set to 0 or below
This commit is contained in:
Kristian Knarvik 2022-10-14 00:33:39 +02:00
parent 12f807060e
commit 4fa47349c6
3 changed files with 3 additions and 31 deletions

View File

@ -12,16 +12,6 @@ public enum NPCSetting {
*/ */
DROP_ITEM("dropItem", SettingValueType.BOOLEAN, true, "dropItem"), DROP_ITEM("dropItem", SettingValueType.BOOLEAN, true, "dropItem"),
/**
* The setting for whether the cool-down period between reforging sessions should be disabled
*/
DISABLE_COOL_DOWN("disableCoolDown", SettingValueType.BOOLEAN, false, "disableCoolDown"),
/**
* The setting for whether the delay it takes for an item to be repaired should be disabled
*/
DISABLE_DELAY("disableDelay", SettingValueType.BOOLEAN, false, "disableDelay"),
/** /**
* The setting for the chance of a reforging to fail * The setting for the chance of a reforging to fail
*/ */

View File

@ -248,7 +248,7 @@ public class NPCSettings {
* @return <p>Whether to drop reforged items on the ground</p> * @return <p>Whether to drop reforged items on the ground</p>
*/ */
public boolean getDropItem() { public boolean getDropItem() {
return asBoolean(NPCSetting.DROP_ITEM); return ConfigHelper.asBoolean(getValue(NPCSetting.DROP_ITEM));
} }
/** /**
@ -257,7 +257,7 @@ public class NPCSettings {
* @return <p>Whether to disable the reforge-cool-down</p> * @return <p>Whether to disable the reforge-cool-down</p>
*/ */
public boolean getDisableCoolDown() { public boolean getDisableCoolDown() {
return asBoolean(NPCSetting.DISABLE_COOL_DOWN); return asInt(NPCSetting.REFORGE_COOL_DOWN) <= 0;
} }
/** /**
@ -266,19 +266,7 @@ public class NPCSettings {
* @return <p>Whether to disable the reforge delay</p> * @return <p>Whether to disable the reforge delay</p>
*/ */
public boolean getDisableDelay() { public boolean getDisableDelay() {
return asBoolean(NPCSetting.DISABLE_DELAY); return asInt(NPCSetting.MAX_REFORGE_DELAY) <= 0;
}
/**
* Gets the given value as a boolean
*
* <p>This will throw an exception if used for a non-boolean value</p>
*
* @param setting <p>The setting to get the value of</p>
* @return <p>The value of the given setting as a boolean</p>
*/
private boolean asBoolean(NPCSetting setting) {
return ConfigHelper.asBoolean(getValue(setting));
} }
/** /**

View File

@ -32,12 +32,6 @@ defaults:
# up yet. # up yet.
reforgeAbleItems: [ ] reforgeAbleItems: [ ]
# Whether to disable the cool-down period between each reforge
disableCoolDown: false
# Whether to disable the reforging delay, making re-forging complete instantly
disableDelay: false
# The chance to fail reforging an item, which only repairs the item a tiny bit or not at all (0-100) # The chance to fail reforging an item, which only repairs the item a tiny bit or not at all (0-100)
failReforgeChance: 10 # Default = 10% failReforgeChance: 10 # Default = 10%