From d99d37807746c56b22dfa503340ab592414a6564 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Thu, 19 Nov 2020 09:10:32 +0100 Subject: [PATCH] Add Item Legacy Support --- SpigotCore_Main/src/de/steamwar/inventory/SWItem.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SpigotCore_Main/src/de/steamwar/inventory/SWItem.java b/SpigotCore_Main/src/de/steamwar/inventory/SWItem.java index f75b0b2..8d4636d 100644 --- a/SpigotCore_Main/src/de/steamwar/inventory/SWItem.java +++ b/SpigotCore_Main/src/de/steamwar/inventory/SWItem.java @@ -154,7 +154,11 @@ public class SWItem { item = new SWItem(Material.valueOf(itemJson.get("material").getAsString()), itemJson.get("title").getAsString()); } }catch (IllegalArgumentException e) { - item = new SWItem(Material.STONE, itemJson.get("title").getAsString()); + 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()); + } } if(itemJson.has("skullOwner")) { item = SWItem.getPlayerSkull(itemJson.get("skullOwner").getAsString());