Add Item Legacy Support
Dieser Commit ist enthalten in:
Ursprung
dbd0b4f4fe
Commit
d99d378077
@ -154,8 +154,12 @@ public class SWItem {
|
|||||||
item = new SWItem(Material.valueOf(itemJson.get("material").getAsString()), itemJson.get("title").getAsString());
|
item = new SWItem(Material.valueOf(itemJson.get("material").getAsString()), itemJson.get("title").getAsString());
|
||||||
}
|
}
|
||||||
}catch (IllegalArgumentException e) {
|
}catch (IllegalArgumentException e) {
|
||||||
|
try {
|
||||||
|
item = new SWItem(Material.valueOf(Material.LEGACY_PREFIX + itemJson.get("material").getAsString()), itemJson.get("title").getAsString());
|
||||||
|
}catch (IllegalArgumentException ex) {
|
||||||
item = new SWItem(Material.STONE, itemJson.get("title").getAsString());
|
item = new SWItem(Material.STONE, itemJson.get("title").getAsString());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if(itemJson.has("skullOwner")) {
|
if(itemJson.has("skullOwner")) {
|
||||||
item = SWItem.getPlayerSkull(itemJson.get("skullOwner").getAsString());
|
item = SWItem.getPlayerSkull(itemJson.get("skullOwner").getAsString());
|
||||||
item.setName(itemJson.get("title").getAsString());
|
item.setName(itemJson.get("title").getAsString());
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren