Adds more unfinished code for parsing and tab-completing advanced cost
All checks were successful
EpicKnarvik97/Blacksmith/pipeline/head This commit looks good
All checks were successful
EpicKnarvik97/Blacksmith/pipeline/head This commit looks good
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
package net.knarcraft.blacksmith.property;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* The type of costs applicable to an advanced cost configuration
|
||||
*/
|
||||
public enum CostType {
|
||||
|
||||
/**
|
||||
* A monetary cost from an economy plugin
|
||||
*/
|
||||
ECONOMY,
|
||||
|
||||
/**
|
||||
* A permission requirement, rather than a cost
|
||||
*/
|
||||
PERMISSION,
|
||||
|
||||
/**
|
||||
* In-game experience levels
|
||||
*/
|
||||
EXP,
|
||||
|
||||
/**
|
||||
* A specific item is consumed
|
||||
*/
|
||||
ITEM,
|
||||
;
|
||||
|
||||
/**
|
||||
* Parses a text string denoting a cost type
|
||||
*
|
||||
* @param input <p>The input to parse</p>
|
||||
* @return <p>The parsed cost type, or null if not matched</p>
|
||||
*/
|
||||
@Nullable
|
||||
public static CostType parse(@NotNull String input) {
|
||||
String normalized = input.trim().toUpperCase();
|
||||
for (CostType costType : CostType.values()) {
|
||||
if (normalized.equals(costType.name())) {
|
||||
return costType;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user