mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-17 06:11:24 +00:00
make registry return optional for get operations
This commit is contained in:
+2
-4
@@ -38,10 +38,8 @@ public class PaletteConfigType implements ConfigType<PaletteTemplate, Palette> {
|
||||
if(((String) c).startsWith("BLOCK:"))
|
||||
return new PaletteImpl.Singleton(
|
||||
platform.getWorldHandle().createBlockData(((String) c).substring(6))); // Return single palette for BLOCK: shortcut.
|
||||
Palette obj = registry.get((String) c);
|
||||
if(obj == null)
|
||||
throw new LoadException("No such " + t.getType().getTypeName() + " matching \"" + c + "\" was found in this registry.");
|
||||
return obj;
|
||||
return registry.get((String) c).orElseThrow(() -> new LoadException(
|
||||
"No such " + t.getType().getTypeName() + " matching \"" + c + "\" was found in this registry."));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user