From d5327e3d26ae3a8ff578ae9af450d5bd586b8900 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sat, 25 Jan 2020 09:24:50 +0100 Subject: [PATCH] Fix NPE --- .../src/de/steamwar/schematicsystem/CheckSchemType_12.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SchematicSystem_12/src/de/steamwar/schematicsystem/CheckSchemType_12.java b/SchematicSystem_12/src/de/steamwar/schematicsystem/CheckSchemType_12.java index b853c1c..9d83358 100644 --- a/SchematicSystem_12/src/de/steamwar/schematicsystem/CheckSchemType_12.java +++ b/SchematicSystem_12/src/de/steamwar/schematicsystem/CheckSchemType_12.java @@ -148,7 +148,11 @@ class CheckSchemType_12 { continue; } - Material itemType = Material.getMaterial(item.getString("id").split(":")[1].toUpperCase().replace("SHOVEL", "SPADE")); + String materialName = item.getString("id"); + if(materialName.contains(":")) + materialName = materialName.split(":")[1]; + materialName = materialName.toUpperCase().replace("SHOVEL", "SPADE"); + Material itemType = Material.getMaterial(materialName); if(itemType == null && item.getString("id").equals("minecraft:fire_charge")) itemType = Material.FIREBALL; if(itemType == null) //Leere Slots