mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-15 21:31:05 +00:00
tryGet -> getFromID
This commit is contained in:
+1
-3
@@ -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));
|
||||
}
|
||||
|
||||
+1
-4
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user