Fixed region material bug
This commit is contained in:
parent
56fe93cc4e
commit
539411ffec
1 changed files with 6 additions and 1 deletions
|
@ -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());
|
||||
|
|
Reference in a new issue