forked from MagicBane/Server
More parser work.
This commit is contained in:
@@ -3047,4 +3047,12 @@ public class Enum {
|
||||
NoDrop,
|
||||
Rare;
|
||||
}
|
||||
|
||||
public enum ItemUseFlags {
|
||||
USE_SELF,
|
||||
USE_TARGET,
|
||||
EMPTY_DESTROY,
|
||||
EMPTY_NEWITEM;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -48,6 +48,8 @@ public class ItemTemplate {
|
||||
public float item_bulk_factor;
|
||||
public float item_defense_rating;
|
||||
public EnumSet<Enum.ItemFlags> item_flags = EnumSet.noneOf(Enum.ItemFlags.class);
|
||||
public EnumSet<Enum.ItemUseFlags> item_use_flags = EnumSet.noneOf(Enum.ItemUseFlags.class);
|
||||
public int item_initial_charges;
|
||||
|
||||
public ItemTemplate(JSONObject jsonObject) {
|
||||
|
||||
@@ -136,5 +138,14 @@ public class ItemTemplate {
|
||||
for (Object o : itemflags)
|
||||
item_flags.add(Enum.ItemFlags.valueOf((String) o));
|
||||
|
||||
JSONArray itemUseflags = (JSONArray) jsonObject.get("item_use_flags");
|
||||
|
||||
if (itemUseflags.isEmpty() == false)
|
||||
for (Object o : itemUseflags)
|
||||
item_use_flags.add(Enum.ItemUseFlags.valueOf((String) o));
|
||||
|
||||
item_initial_charges = ((Long) jsonObject.get("item_initial_charges")).intValue();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user