mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-17 13:49:57 +00:00
convert a bunch of stuff to new APIs
This commit is contained in:
@@ -42,7 +42,7 @@ public class AllayPlatform extends AbstractPlatform {
|
||||
boolean succeed = loadConfigPacks();
|
||||
|
||||
GENERATOR_WRAPPERS.forEach(wrapper -> {
|
||||
getConfigRegistry().get(wrapper.getConfigPack().getRegistryKey()).ifPresent(pack -> {
|
||||
getConfigRegistry().get(wrapper.getConfigPack().getRegistryKey()).consume(pack -> {
|
||||
wrapper.setConfigPack(pack);
|
||||
var dimension = wrapper.getAllayWorldGenerator().getDimension();
|
||||
TerraAllayPlugin.instance.getPluginLogger().info(
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.dfsek.terra.allay.generator;
|
||||
|
||||
import com.dfsek.terra.api.util.function.FunctionUtils;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import org.allaymc.api.utils.AllayStringUtils;
|
||||
import org.allaymc.api.world.biome.BiomeType;
|
||||
@@ -24,6 +26,8 @@ import com.dfsek.terra.api.world.chunk.generation.stage.GenerationStage;
|
||||
import com.dfsek.terra.api.world.chunk.generation.util.GeneratorWrapper;
|
||||
import com.dfsek.terra.api.world.info.WorldProperties;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
|
||||
/**
|
||||
* @author daoge_cmd
|
||||
@@ -91,14 +95,16 @@ public class AllayGeneratorWrapper implements GeneratorWrapper {
|
||||
return TerraAllayPlugin.platform
|
||||
.getConfigRegistry()
|
||||
.getByID(packId)
|
||||
.orElseThrow(() -> new IllegalArgumentException("Cant find terra config pack named " + packId));
|
||||
.collectThrow(
|
||||
left -> new IllegalArgumentException("Cant find terra config pack named " + packId + ": " + left));
|
||||
}
|
||||
|
||||
protected static ConfigPack getConfigPackByMeta(String metaPackId, DimensionInfo dimensionInfo) {
|
||||
return TerraAllayPlugin.platform
|
||||
.getMetaConfigRegistry()
|
||||
.getByID(metaPackId)
|
||||
.orElseThrow(() -> new IllegalArgumentException("Cant find terra meta pack named " + metaPackId))
|
||||
.collectThrow(
|
||||
left -> new IllegalArgumentException("Cant find terra meta pack named " + metaPackId + ": " + left))
|
||||
.packs()
|
||||
.get(Mapping.dimensionIdBeToJe(dimensionInfo.toString()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user