mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2025-07-18 02:22:32 +00:00
WIP Dim opts
This commit is contained in:
parent
db1e924246
commit
e11a235386
@ -19,6 +19,13 @@ package com.dfsek.terra.mod;
|
||||
|
||||
import ca.solostudios.strata.Versions;
|
||||
import ca.solostudios.strata.version.Version;
|
||||
|
||||
import com.dfsek.terra.api.config.ConfigPack;
|
||||
|
||||
import com.dfsek.terra.mod.config.VanillaWorldProperties;
|
||||
|
||||
import com.dfsek.terra.mod.util.MinecraftUtil;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@ -45,11 +52,20 @@ public abstract class MinecraftAddon implements BaseAddon {
|
||||
@Override
|
||||
public void initialize() {
|
||||
modPlatform.getEventManager()
|
||||
.getHandler(FunctionalEventHandler.class)
|
||||
.register(this, ConfigPackPreLoadEvent.class)
|
||||
.then(event -> event.getPack().getContext().put(event.loadTemplate(new PreLoadCompatibilityOptions())))
|
||||
.global();
|
||||
|
||||
.getHandler(FunctionalEventHandler.class)
|
||||
.register(this, ConfigurationLoadEvent.class)
|
||||
.then(event -> {
|
||||
if(event.is(ConfigPack.class)) {
|
||||
event.getLoadedObject(ConfigPack.class).getContext().put(event.load(new VanillaWorldProperties()));
|
||||
}
|
||||
})
|
||||
.global();
|
||||
modPlatform.getEventManager()
|
||||
.getHandler(FunctionalEventHandler.class)
|
||||
.register(this, ConfigPackPreLoadEvent.class)
|
||||
.then(event -> event.getPack().getContext().put(event.loadTemplate(new PreLoadCompatibilityOptions())))
|
||||
.global();
|
||||
|
||||
modPlatform.getEventManager()
|
||||
.getHandler(FunctionalEventHandler.class)
|
||||
.register(this, ConfigPackPostLoadEvent.class)
|
||||
|
@ -0,0 +1,38 @@
|
||||
package com.dfsek.terra.mod.config;
|
||||
|
||||
import com.dfsek.tectonic.api.config.template.annotations.Default;
|
||||
import com.dfsek.tectonic.api.config.template.annotations.Value;
|
||||
|
||||
import com.dfsek.tectonic.api.config.template.object.ObjectTemplate;
|
||||
|
||||
import com.dfsek.terra.api.util.ConstantRange;
|
||||
import com.dfsek.terra.api.util.Range;
|
||||
|
||||
import com.dfsek.terra.mod.implmentation.TerraIntProvider;
|
||||
|
||||
import net.minecraft.world.dimension.DimensionType.MonsterSettings;
|
||||
|
||||
|
||||
public class MonsterSettingsTemplate implements ObjectTemplate<MonsterSettings> {
|
||||
@Value("piglin-safe")
|
||||
@Default
|
||||
private Boolean piglinSafe = false;
|
||||
|
||||
@Value("has-raids")
|
||||
@Default
|
||||
private Boolean hasRaids = false;
|
||||
|
||||
@Value("monster-spawn-light")
|
||||
@Default
|
||||
private Range monsterSpawnLight = new ConstantRange(0, 1);
|
||||
|
||||
@Value("monster-spawn-block-light-limit")
|
||||
@Default
|
||||
private int monsterSpawnBlockLightLimit = 0;
|
||||
|
||||
|
||||
@Override
|
||||
public MonsterSettings get() {
|
||||
return new MonsterSettings(piglinSafe, hasRaids, new TerraIntProvider(monsterSpawnLight), monsterSpawnBlockLightLimit);
|
||||
}
|
||||
}
|
@ -0,0 +1,141 @@
|
||||
package com.dfsek.terra.mod.config;
|
||||
|
||||
import com.dfsek.tectonic.api.config.template.ConfigTemplate;
|
||||
import com.dfsek.tectonic.api.config.template.annotations.Default;
|
||||
import com.dfsek.tectonic.api.config.template.annotations.Value;
|
||||
|
||||
import com.dfsek.terra.mod.implmentation.TerraIntProvider;
|
||||
|
||||
import net.minecraft.client.gl.Uniform;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.intprovider.IntProvider;
|
||||
import net.minecraft.util.math.intprovider.IntProviderType;
|
||||
import net.minecraft.util.math.random.Random;
|
||||
import net.minecraft.world.dimension.DimensionType.MonsterSettings;
|
||||
|
||||
import com.dfsek.terra.api.properties.Properties;
|
||||
import com.dfsek.terra.api.util.ConstantRange;
|
||||
import com.dfsek.terra.api.util.Range;
|
||||
|
||||
|
||||
public class VanillaWorldProperties implements ConfigTemplate, Properties {
|
||||
@Value("minecraft.fixed-time")
|
||||
@Default
|
||||
private Long fixedTime = null;
|
||||
|
||||
@Value("minecraft.has-sky-light")
|
||||
@Default
|
||||
private Boolean hasSkyLight = false;
|
||||
|
||||
@Value("minecraft.has-ceiling")
|
||||
@Default
|
||||
private Boolean hasCeiling = false;
|
||||
|
||||
@Value("minecraft.ultra-warm")
|
||||
@Default
|
||||
private Boolean ultraWarm = false;
|
||||
|
||||
@Value("minecraft.natural")
|
||||
@Default
|
||||
private Boolean natural = false;
|
||||
|
||||
@Value("minecraft.coordinate-scale")
|
||||
@Default
|
||||
private Double coordinateScale = 1.0E-5d;
|
||||
|
||||
@Value("minecraft.bed-works")
|
||||
@Default
|
||||
private Boolean bedWorks = false;
|
||||
|
||||
@Value("minecraft.respawn-anchor-works")
|
||||
@Default
|
||||
private Boolean respawnAnchorWorks = false;
|
||||
|
||||
@Value("minecraft.height")
|
||||
@Default
|
||||
private Range height = new ConstantRange(0, 16);
|
||||
|
||||
@Value("minecraft.height.logical")
|
||||
@Default
|
||||
private Integer logicalHeight = 0;
|
||||
|
||||
@Value("minecraft.infiniburn")
|
||||
@Default
|
||||
private Identifier infiniburn = new Identifier("");
|
||||
|
||||
@Value("minecraft.effects")
|
||||
@Default
|
||||
private Identifier effects = new Identifier("");
|
||||
|
||||
@Value("minecraft.ambient-light")
|
||||
@Default
|
||||
private Float ambientLight = Float.MAX_VALUE;
|
||||
|
||||
@Value("minecraft.monster-settings")
|
||||
@Default
|
||||
private MonsterSettings monsterSettings = new MonsterSettings(false, false, new TerraIntProvider(new ConstantRange(0, 1)), 0);
|
||||
|
||||
@Value("minecraft.sealevel")
|
||||
@Default
|
||||
private Integer sealevel = 0;
|
||||
|
||||
public Long getFixedTime() {
|
||||
return fixedTime;
|
||||
}
|
||||
|
||||
public Boolean getHasSkyLight() {
|
||||
return hasSkyLight;
|
||||
}
|
||||
|
||||
public Boolean getHasCeiling() {
|
||||
return hasCeiling;
|
||||
}
|
||||
|
||||
public Boolean getUltraWarm() {
|
||||
return ultraWarm;
|
||||
}
|
||||
|
||||
public Boolean getNatural() {
|
||||
return natural;
|
||||
}
|
||||
|
||||
public Double getCoordinateScale() {
|
||||
return coordinateScale;
|
||||
}
|
||||
|
||||
public Boolean getBedWorks() {
|
||||
return bedWorks;
|
||||
}
|
||||
|
||||
public Boolean getRespawnAnchorWorks() {
|
||||
return respawnAnchorWorks;
|
||||
}
|
||||
|
||||
public Range getHeight() {
|
||||
return height;
|
||||
}
|
||||
|
||||
public Integer getLogicalHeight() {
|
||||
return logicalHeight;
|
||||
}
|
||||
|
||||
public Identifier getInfiniburn() {
|
||||
return infiniburn;
|
||||
}
|
||||
|
||||
public Identifier getEffects() {
|
||||
return effects;
|
||||
}
|
||||
|
||||
public Float getAmbientLight() {
|
||||
return ambientLight;
|
||||
}
|
||||
|
||||
public MonsterSettings getMonsterSettings() {
|
||||
return monsterSettings;
|
||||
}
|
||||
|
||||
public Integer getSealevel() {
|
||||
return sealevel;
|
||||
}
|
||||
}
|
@ -1,5 +1,10 @@
|
||||
package com.dfsek.terra.mod.data;
|
||||
|
||||
import com.dfsek.terra.api.util.ConstantRange;
|
||||
import com.dfsek.terra.api.util.Range;
|
||||
|
||||
import com.dfsek.terra.mod.implmentation.TerraIntProvider;
|
||||
|
||||
import com.mojang.serialization.Codec;
|
||||
import com.mojang.serialization.codecs.RecordCodecBuilder;
|
||||
import net.minecraft.world.gen.chunk.ChunkGeneratorSettings;
|
||||
@ -54,4 +59,9 @@ public final class Codecs {
|
||||
).apply(instance, instance.stable(
|
||||
MinecraftChunkGeneratorWrapper::new))
|
||||
);
|
||||
|
||||
public static final Codec<TerraIntProvider> TERRA_CONSTANT_RANGE_INT_PROVIDER_TYPE = RecordCodecBuilder.create(range -> range.group(
|
||||
Codec.INT.fieldOf("min").stable().forGetter(TerraIntProvider::getMin),
|
||||
Codec.INT.fieldOf("max").stable().forGetter(TerraIntProvider::getMax)).apply(range, range.stable((min, max) -> new TerraIntProvider(new ConstantRange(
|
||||
min, max)))));
|
||||
}
|
||||
|
@ -17,6 +17,9 @@
|
||||
|
||||
package com.dfsek.terra.mod.generation;
|
||||
|
||||
import com.dfsek.terra.mod.config.VanillaBiomeProperties;
|
||||
import com.dfsek.terra.mod.config.VanillaWorldProperties;
|
||||
|
||||
import com.mojang.serialization.Codec;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
@ -72,6 +75,8 @@ public class MinecraftChunkGeneratorWrapper extends net.minecraft.world.gen.chun
|
||||
private final RegistryEntry<ChunkGeneratorSettings> settings;
|
||||
private ChunkGenerator delegate;
|
||||
private ConfigPack pack;
|
||||
|
||||
private VanillaWorldProperties vanillaWorldProperties;
|
||||
|
||||
public MinecraftChunkGeneratorWrapper(TerraBiomeSource biomeSource, ConfigPack configPack,
|
||||
RegistryEntry<ChunkGeneratorSettings> settingsSupplier) {
|
||||
@ -82,6 +87,11 @@ public class MinecraftChunkGeneratorWrapper extends net.minecraft.world.gen.chun
|
||||
this.delegate = pack.getGeneratorProvider().newInstance(pack);
|
||||
logger.info("Loading world with config pack {}", pack.getID());
|
||||
this.biomeSource = biomeSource;
|
||||
if (pack.getContext().has(VanillaBiomeProperties.class)) {
|
||||
vanillaWorldProperties = pack.getContext().get(VanillaWorldProperties.class);
|
||||
} else {
|
||||
vanillaWorldProperties = new VanillaWorldProperties();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -107,7 +117,7 @@ public class MinecraftChunkGeneratorWrapper extends net.minecraft.world.gen.chun
|
||||
|
||||
@Override
|
||||
public int getWorldHeight() {
|
||||
return settings.value().generationShapeConfig().height();
|
||||
return vanillaWorldProperties.getHeight().getMax();
|
||||
}
|
||||
|
||||
|
||||
@ -167,12 +177,12 @@ public class MinecraftChunkGeneratorWrapper extends net.minecraft.world.gen.chun
|
||||
|
||||
@Override
|
||||
public int getSeaLevel() {
|
||||
return settings.value().seaLevel();
|
||||
return vanillaWorldProperties.getSealevel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMinimumY() {
|
||||
return settings.value().generationShapeConfig().minimumY();
|
||||
return vanillaWorldProperties.getHeight().getMin();
|
||||
}
|
||||
|
||||
|
||||
@ -202,7 +212,7 @@ public class MinecraftChunkGeneratorWrapper extends net.minecraft.world.gen.chun
|
||||
|
||||
@Override
|
||||
public void getDebugHudText(List<String> text, NoiseConfig noiseConfig, BlockPos pos) {
|
||||
|
||||
// no op
|
||||
}
|
||||
|
||||
public ConfigPack getPack() {
|
||||
@ -213,7 +223,13 @@ public class MinecraftChunkGeneratorWrapper extends net.minecraft.world.gen.chun
|
||||
this.pack = pack;
|
||||
this.delegate = pack.getGeneratorProvider().newInstance(pack);
|
||||
biomeSource.setPack(pack);
|
||||
|
||||
|
||||
if (pack.getContext().has(VanillaBiomeProperties.class)) {
|
||||
vanillaWorldProperties = pack.getContext().get(VanillaWorldProperties.class);
|
||||
} else {
|
||||
vanillaWorldProperties = new VanillaWorldProperties();
|
||||
}
|
||||
|
||||
logger.debug("Loading world with config pack {}", pack.getID());
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,43 @@
|
||||
package com.dfsek.terra.mod.implmentation;
|
||||
|
||||
import com.dfsek.terra.api.util.Range;
|
||||
|
||||
import com.dfsek.terra.mod.util.MinecraftAdapter;
|
||||
|
||||
import net.minecraft.util.math.intprovider.IntProvider;
|
||||
import net.minecraft.util.math.intprovider.IntProviderType;
|
||||
import net.minecraft.util.math.random.Random;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
public class TerraIntProvider extends IntProvider {
|
||||
public static final Map<Class, IntProviderType> TERRA_RANGE_TYPE_TO_INT_PROVIDER_TYPE = new HashMap<>();
|
||||
|
||||
public Range delegate;
|
||||
|
||||
public TerraIntProvider(Range delegate) {
|
||||
this.delegate = delegate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int get(Random random) {
|
||||
return delegate.get(MinecraftAdapter.adapt(random));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMin() {
|
||||
return delegate.getMin();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMax() {
|
||||
return delegate.getMax();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IntProviderType<?> getType() {
|
||||
return TERRA_RANGE_TYPE_TO_INT_PROVIDER_TYPE.get(delegate.getClass());
|
||||
}
|
||||
}
|
@ -3,6 +3,8 @@ package com.dfsek.terra.mod.mixin.lifecycle;
|
||||
import net.minecraft.registry.DynamicRegistryManager;
|
||||
import net.minecraft.registry.Registry;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
import com.dfsek.terra.mod.util.MinecraftUtil;
|
||||
|
||||
import net.minecraft.server.DataPackContents;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
|
@ -0,0 +1,62 @@
|
||||
package com.dfsek.terra.mod.util;
|
||||
|
||||
import com.dfsek.terra.api.config.ConfigPack;
|
||||
import com.dfsek.terra.mod.config.VanillaBiomeProperties;
|
||||
import com.dfsek.terra.mod.config.VanillaWorldProperties;
|
||||
|
||||
import net.minecraft.tag.TagKey;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.registry.BuiltinRegistries;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import net.minecraft.util.registry.RegistryKey;
|
||||
import net.minecraft.world.dimension.DimensionOptions;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
|
||||
import java.util.OptionalLong;
|
||||
|
||||
|
||||
public class DimensionUtil {
|
||||
protected static RegistryKey<DimensionType> registerDimension(Identifier identifier,
|
||||
DimensionType dimension) {
|
||||
BuiltinRegistries.add(BuiltinRegistries.DIMENSION_TYPE,
|
||||
registerKey(identifier)
|
||||
.getValue(),
|
||||
dimension);
|
||||
return getDimensionKey(identifier);
|
||||
}
|
||||
|
||||
public static RegistryKey<DimensionOptions> registerKey(Identifier identifier) {
|
||||
return RegistryKey.of(Registry.DIMENSION_KEY, identifier);
|
||||
}
|
||||
public static RegistryKey<DimensionType> getDimensionKey(Identifier identifier) {
|
||||
return BuiltinRegistries.DIMENSION_TYPE.getKey(BuiltinRegistries.DIMENSION_TYPE.get(identifier)).orElseThrow();
|
||||
}
|
||||
|
||||
protected static RegistryKey<DimensionType> registerDimension(ConfigPack pack) {
|
||||
VanillaWorldProperties vanillaWorldProperties;
|
||||
if (pack.getContext().has(VanillaBiomeProperties.class)) {
|
||||
vanillaWorldProperties = pack.getContext().get(VanillaWorldProperties.class);
|
||||
} else {
|
||||
vanillaWorldProperties = new VanillaWorldProperties();
|
||||
}
|
||||
|
||||
DimensionType overworldDimensionType = new DimensionType(
|
||||
vanillaWorldProperties.getFixedTime() == null ? OptionalLong.empty() : OptionalLong.of(vanillaWorldProperties.getFixedTime()),
|
||||
vanillaWorldProperties.getHasSkyLight(),
|
||||
vanillaWorldProperties.getHasCeiling(),
|
||||
vanillaWorldProperties.getUltraWarm(),
|
||||
vanillaWorldProperties.getNatural(),
|
||||
vanillaWorldProperties.getCoordinateScale(),
|
||||
vanillaWorldProperties.getBedWorks(),
|
||||
vanillaWorldProperties.getRespawnAnchorWorks(),
|
||||
vanillaWorldProperties.getHeight().getMin(),
|
||||
vanillaWorldProperties.getHeight().getMax(),
|
||||
vanillaWorldProperties.getLogicalHeight(),
|
||||
TagKey.of(Registry.BLOCK_KEY, vanillaWorldProperties.getInfiniburn()),
|
||||
vanillaWorldProperties.getEffects(),
|
||||
vanillaWorldProperties.getAmbientLight(),
|
||||
vanillaWorldProperties.getMonsterSettings());
|
||||
|
||||
return registerDimension(new Identifier("terra", pack.getID().toLowerCase()), overworldDimensionType);
|
||||
}
|
||||
}
|
@ -1,5 +1,10 @@
|
||||
package com.dfsek.terra.mod.util;
|
||||
|
||||
import com.dfsek.terra.api.util.ConstantRange;
|
||||
import com.dfsek.terra.mod.data.Codecs;
|
||||
|
||||
import com.dfsek.terra.mod.implmentation.TerraIntProvider;
|
||||
|
||||
import net.minecraft.block.entity.LootableContainerBlockEntity;
|
||||
import net.minecraft.block.entity.MobSpawnerBlockEntity;
|
||||
import net.minecraft.block.entity.SignBlockEntity;
|
||||
@ -10,10 +15,16 @@ import net.minecraft.registry.RegistryKeys;
|
||||
import net.minecraft.registry.entry.RegistryEntry;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.intprovider.ConstantIntProvider;
|
||||
import net.minecraft.util.math.intprovider.IntProviderType;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import net.minecraft.util.registry.RegistryEntry;
|
||||
import net.minecraft.util.registry.RegistryKey;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.biome.Biome.Builder;
|
||||
import net.minecraft.world.biome.BiomeEffects;
|
||||
import net.minecraft.world.biome.BiomeEffects.GrassColorModifier;
|
||||
import net.minecraft.world.biome.GenerationSettings;
|
||||
import net.minecraft.world.gen.feature.ConfiguredFeature;
|
||||
import org.slf4j.Logger;
|
||||
@ -92,6 +103,14 @@ public final class MinecraftUtil {
|
||||
return Map.copyOf(TERRA_BIOME_MAP);
|
||||
}
|
||||
|
||||
|
||||
public static void registerIntProviderTypes() {
|
||||
IntProviderType<TerraIntProvider> CONSTANT = IntProviderType.register("terra:constant_range",
|
||||
Codecs.TERRA_CONSTANT_RANGE_INT_PROVIDER_TYPE);
|
||||
|
||||
TerraIntProvider.TERRA_RANGE_TYPE_TO_INT_PROVIDER_TYPE.put(ConstantRange.class, CONSTANT);
|
||||
}
|
||||
|
||||
public static RegistryKey<Biome> registerKey(Identifier identifier) {
|
||||
return RegistryKey.of(RegistryKeys.BIOME, identifier);
|
||||
}
|
||||
|
@ -4,7 +4,17 @@ import net.minecraft.registry.Registry;
|
||||
import net.minecraft.registry.RegistryKey;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
import net.minecraft.registry.entry.RegistryEntry;
|
||||
import net.minecraft.client.gui.screen.CustomizeBuffetLevelScreen;
|
||||
import net.minecraft.client.gui.screen.CustomizeFlatLevelScreen;
|
||||
import net.minecraft.client.gui.screen.world.LevelScreenProvider;
|
||||
import net.minecraft.structure.StructureSet;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.noise.DoublePerlinNoiseSampler.NoiseParameters;
|
||||
import net.minecraft.util.registry.BuiltinRegistries;
|
||||
import net.minecraft.util.registry.DynamicRegistryManager;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import net.minecraft.util.registry.RegistryEntry;
|
||||
import net.minecraft.util.registry.RegistryKey;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.dimension.DimensionOptions;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
@ -37,8 +47,11 @@ import net.minecraft.world.dimension.DimensionOptions;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
import net.minecraft.world.dimension.DimensionTypes;
|
||||
import net.minecraft.world.gen.WorldPreset;
|
||||
import net.minecraft.world.gen.WorldPresets;
|
||||
import net.minecraft.world.gen.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.gen.chunk.ChunkGeneratorSettings;
|
||||
import net.minecraft.world.gen.chunk.FlatChunkGenerator;
|
||||
import net.minecraft.world.gen.chunk.FlatChunkGeneratorConfig;
|
||||
import net.minecraft.world.gen.chunk.NoiseChunkGenerator;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -47,6 +60,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
import com.dfsek.terra.api.config.ConfigPack;
|
||||
import com.dfsek.terra.api.util.generic.pair.Pair;
|
||||
@ -60,6 +74,10 @@ import com.dfsek.terra.mod.generation.TerraBiomeSource;
|
||||
public class PresetUtil {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(PresetUtil.class);
|
||||
private static final List<Identifier> PRESETS = new ArrayList<>();
|
||||
|
||||
public static RegistryKey<WorldPreset> getPresetKey(Identifier identifier) {
|
||||
return RegistryKey.of(Registry.WORLD_PRESET_KEY, identifier);
|
||||
}
|
||||
|
||||
public static Pair<Identifier, WorldPreset> createDefault(ConfigPack pack, ModPlatform platform) {
|
||||
Registry<DimensionType> dimensionTypeRegistry = platform.dimensionTypeRegistry();
|
||||
|
@ -2,6 +2,8 @@ package com.dfsek.terra.lifecycle.util;
|
||||
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.registry.Registry;
|
||||
import com.dfsek.terra.mod.util.MinecraftUtil;
|
||||
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
import com.dfsek.terra.mod.data.Codecs;
|
||||
@ -13,6 +15,7 @@ public final class RegistryUtil {
|
||||
}
|
||||
|
||||
public static void register() {
|
||||
MinecraftUtil.registerIntProviderTypes();
|
||||
Registry.register(Registries.CHUNK_GENERATOR, new Identifier("terra:terra"), Codecs.MINECRAFT_CHUNK_GENERATOR_WRAPPER);
|
||||
Registry.register(Registries.BIOME_SOURCE, new Identifier("terra:terra"), Codecs.TERRA_BIOME_SOURCE);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user