From 539411ffec6ea59675a94c9f8f03e09b09d2f400 Mon Sep 17 00:00:00 2001 From: thomas Date: Sat, 16 Oct 2021 15:49:27 +0200 Subject: [PATCH] Fixed region material bug --- .../themepark/api/load/objects/StatusDataLoader.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/nl/iobyte/themepark/api/load/objects/StatusDataLoader.java b/src/main/java/nl/iobyte/themepark/api/load/objects/StatusDataLoader.java index b40204d..f348ecf 100644 --- a/src/main/java/nl/iobyte/themepark/api/load/objects/StatusDataLoader.java +++ b/src/main/java/nl/iobyte/themepark/api/load/objects/StatusDataLoader.java @@ -19,6 +19,7 @@ import org.bukkit.Location; import org.bukkit.configuration.ConfigurationSection; import java.util.HashMap; import java.util.Map; +import java.util.Optional; public class StatusDataLoader implements IDataLoader { @@ -93,7 +94,11 @@ public class StatusDataLoader implements IDataLoader { //Load regions for(String id : section.getKeys(false)) { - XMaterial material = XMaterial.matchXMaterial(manager.getString(StorageLocation.REGIONS, "regions."+id+".material")).orElse(XMaterial.NAME_TAG); + XMaterial material = XMaterial.matchXMaterial( + Optional.ofNullable( + manager.getString(StorageLocation.REGIONS, "regions."+id+".material") + ).orElse("NAME_TAG") + ).orElse(XMaterial.NAME_TAG); String name = manager.getString(StorageLocation.REGIONS, "regions."+id+".name"); Region region = new Region(id, name, material.parseMaterial());