Fixes several bugs and problems
Fixes getting the name of enchantments Fixes inconsistencies in material and enchantment name-checking Allows using "null" or "-1" to unset per-material or per-enchantment configuration options Fixes a bug where basePrice was set to a material name instead of the price for the material being displayed Adds missing tab-completion for material/enchantment costs Prevents inconsistencies in deciding if a value is null
This commit is contained in:
@ -13,6 +13,17 @@ public final class InputParsingHelper {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets whether the input is an "empty" value treated as null
|
||||
*
|
||||
* @param input <p>The input to check</p>
|
||||
* @return <p>True if the value is empty</p>
|
||||
*/
|
||||
public static boolean isEmpty(String input) {
|
||||
return input == null || input.equalsIgnoreCase("null") || input.equals("\"\"") ||
|
||||
input.trim().isEmpty() || input.equals("-1");
|
||||
}
|
||||
|
||||
/**
|
||||
* Tries to find the material matching the given input string
|
||||
*
|
||||
|
Reference in New Issue
Block a user