Catch charged Crossbow state, fixes #1927

This commit is contained in:
PikaMug 2022-04-14 15:09:00 -04:00
parent d3c3b1d6c9
commit b7282cbada
1 changed files with 7 additions and 1 deletions

View File

@ -330,6 +330,11 @@ public class ItemUtil {
stored.put(Enchantment.getByName(keyval[0]), Integer.valueOf(keyval[1]));
}
}
} else if (arg.startsWith("charged")) {
final int dash = arg.lastIndexOf('-');
final String key = arg.substring(0, dash);
final String value = arg.substring(dash + 1);
extra.put(key, Boolean.valueOf(value));
} else if (arg.contains("-")) {
final int dash = arg.lastIndexOf('-');
final String key = arg.substring(0, dash);
@ -508,7 +513,8 @@ public class ItemUtil {
/**
* Essentially the reverse of ItemMeta.serialize()
*
* @param itemMetaClass key/value map of metadata
* @param itemMetaClass metadata class
* @param args key/value map of metadata
* @return ItemMeta
*/
public static ItemMeta deserializeItemMeta(final Class<? extends ItemMeta> itemMetaClass, final Map<String, Object> args) {