mirror of
https://github.com/songoda/UltimateKits.git
synced 2024-11-22 18:26:12 +01:00
Declare kit types.
This commit is contained in:
parent
e5e9a96211
commit
85011e0453
@ -22,6 +22,7 @@ import java.util.List;
|
||||
public class KitItem {
|
||||
|
||||
private KitContent content;
|
||||
private KitItemType type;
|
||||
private String displayName, displayLore = null;
|
||||
private Material displayItem = null;
|
||||
private double chance = 0;
|
||||
@ -46,11 +47,14 @@ public class KitItem {
|
||||
private void processContent(String line, ItemStack item) {
|
||||
if (line != null && line.startsWith(Settings.CURRENCY_SYMBOL.getString())) {
|
||||
this.content = new KitContentEconomy(Double.parseDouble(line.substring(1).trim()));
|
||||
this.type = KitItemType.ECONOMY;
|
||||
} else if (line != null && line.startsWith("/")) {
|
||||
this.content = new KitContentCommand(line.substring(1));
|
||||
this.type = KitItemType.COMMAND;
|
||||
} else {
|
||||
ItemStack itemStack = item == null ? UltimateKits.getInstance().getItemSerializer().deserializeItemStackFromJson(line) : item;
|
||||
this.content = itemStack != null ? new KitContentItem(itemStack) : null;
|
||||
this.type = KitItemType.ITEM;
|
||||
}
|
||||
}
|
||||
|
||||
@ -214,6 +218,10 @@ public class KitItem {
|
||||
return item;
|
||||
}
|
||||
|
||||
public KitItemType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "KitItem:{"
|
||||
|
@ -0,0 +1,7 @@
|
||||
package com.songoda.ultimatekits.kit;
|
||||
|
||||
public enum KitItemType {
|
||||
|
||||
ITEM, ECONOMY, COMMAND
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user