tryGet -> getFromID

This commit is contained in:
dfsek
2021-12-25 01:04:50 -07:00
parent 2b92e2e73b
commit e1a6cdb484
11 changed files with 23 additions and 33 deletions
@@ -4,8 +4,6 @@ import com.dfsek.tectonic.api.exception.LoadException;
import com.dfsek.tectonic.api.loader.ConfigLoader;
import com.dfsek.tectonic.api.loader.type.TypeLoader;
import com.dfsek.terra.api.registry.key.RegistryKey;
import org.jetbrains.annotations.NotNull;
import java.lang.reflect.AnnotatedType;
@@ -26,7 +24,7 @@ public class BiomeDelegateLoader implements TypeLoader<BiomeDelegate> {
public BiomeDelegate load(@NotNull AnnotatedType t, @NotNull Object c, @NotNull ConfigLoader loader) throws LoadException {
if(c.equals("SELF")) return BiomeDelegate.self();
return biomeRegistry
.tryGet((String) c)
.getFromID((String) c)
.map(BiomeDelegate::from)
.orElseGet(() -> BiomeDelegate.ephemeral((String) c));
}
@@ -9,13 +9,10 @@ package com.dfsek.terra.addons.terrascript.script.functions;
import com.dfsek.terra.addons.terrascript.script.StructureScript;
import com.dfsek.terra.api.registry.key.RegistryKey;
import net.jafama.FastMath;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Collection;
import java.util.List;
import java.util.Map;
@@ -71,7 +68,7 @@ public class StructureFunction implements Function<Boolean> {
String app = id.apply(implementationArguments, variableMap);
return registry.tryGet(app).map(script -> {
return registry.getFromID(app).map(script -> {
Rotation rotation1;
String rotString = rotations.get(arguments.getRandom().nextInt(rotations.size())).apply(implementationArguments, variableMap);
try {