3
0
Fork 0

Fixed region material bug

This commit is contained in:
thomas 2021-10-16 15:49:27 +02:00
parent 56fe93cc4e
commit 539411ffec

View file

@ -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());