mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-03 06:16:10 +00:00
fix-up
This commit is contained in:
@@ -1,10 +1,5 @@
|
||||
package com.dfsek.terra.addons.commands.structure;
|
||||
|
||||
import cloud.commandframework.ArgumentDescription;
|
||||
import cloud.commandframework.CommandManager;
|
||||
import cloud.commandframework.arguments.standard.EnumArgument;
|
||||
import cloud.commandframework.arguments.standard.LongArgument;
|
||||
import cloud.commandframework.context.CommandContext;
|
||||
|
||||
import java.util.random.RandomGenerator;
|
||||
import java.util.random.RandomGeneratorFactory;
|
||||
|
||||
@@ -42,12 +42,12 @@ public final class Codecs {
|
||||
.forGetter(TerraBiomeSource::getPack))
|
||||
.apply(instance, instance.stable(TerraBiomeSource::new)));
|
||||
|
||||
public static final Codec<ConstantRange> TERRA_CONSTANT_RANGE = RecordCodecBuilder.mapCodec(range -> range.group(
|
||||
public static final Codec<ConstantRange> TERRA_CONSTANT_RANGE = RecordCodecBuilder.create(range -> range.group(
|
||||
Codec.INT.fieldOf("min").stable().forGetter(ConstantRange::getMin),
|
||||
Codec.INT.fieldOf("max").stable().forGetter(ConstantRange::getMax)).apply(range, range.stable(ConstantRange::new)));
|
||||
|
||||
public static final Codec<GenerationSettings> TERRA_GENERATION_SETTINGS = RecordCodecBuilder
|
||||
.mapCodec(instance -> instance.group(
|
||||
.create(instance -> instance.group(
|
||||
TERRA_CONSTANT_RANGE.fieldOf("height").stable().forGetter(GenerationSettings::height),
|
||||
Codec.INT.fieldOf("sea_level").forGetter(GenerationSettings::sealevel),
|
||||
Codec.BOOL.fieldOf("mob_generation").forGetter(GenerationSettings::mobGeneration),
|
||||
@@ -55,8 +55,8 @@ public final class Codecs {
|
||||
.apply(instance, instance.stable(GenerationSettings::new)));
|
||||
|
||||
|
||||
public static final Codec<MinecraftChunkGeneratorWrapper> MINECRAFT_CHUNK_GENERATOR_WRAPPER = RecordCodecBuilder
|
||||
.create(
|
||||
public static final MapCodec<MinecraftChunkGeneratorWrapper> MINECRAFT_CHUNK_GENERATOR_WRAPPER = RecordCodecBuilder
|
||||
.mapCodec(
|
||||
instance -> instance.group(
|
||||
TERRA_BIOME_SOURCE.fieldOf("biome_source")
|
||||
.stable()
|
||||
@@ -71,7 +71,7 @@ public final class Codecs {
|
||||
MinecraftChunkGeneratorWrapper::new))
|
||||
);
|
||||
|
||||
public static final Codec<TerraIntProvider> TERRA_CONSTANT_RANGE_INT_PROVIDER_TYPE = RecordCodecBuilder.create(range -> range.group(
|
||||
public static final MapCodec<TerraIntProvider> TERRA_CONSTANT_RANGE_INT_PROVIDER_TYPE = RecordCodecBuilder.mapCodec(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(
|
||||
|
||||
@@ -92,7 +92,7 @@ public final class MinecraftUtil {
|
||||
RegistryKey<net.minecraft.world.biome.Biome> vanillaKey = ((ProtoPlatformBiome) biome.getPlatformBiome()).get(biomeRegistry);
|
||||
biomeRegistry.getOrEmpty(vanillaKey)
|
||||
.ifPresentOrElse(vanillaBiome -> {
|
||||
Identifier terraBiomeIdentifier = new Identifier("terra", MinecraftUtil.createBiomeID(pack, id));
|
||||
Identifier terraBiomeIdentifier = Identifier.of("terra", MinecraftUtil.createBiomeID(pack, id));
|
||||
biomeRegistry.getOrEmpty(terraBiomeIdentifier).ifPresentOrElse(
|
||||
terraBiome -> {
|
||||
List<ConfiguredFeature<?, ?>> flowerFeatures = List.copyOf(
|
||||
|
||||
@@ -93,7 +93,7 @@ public class PresetUtil {
|
||||
private static void insertCustom(ModPlatform platform, String key, ConfigPack pack, Registry<DimensionType> dimensionTypeRegistry,
|
||||
Registry<ChunkGeneratorSettings> chunkGeneratorSettingsRegistry,
|
||||
HashMap<RegistryKey<DimensionOptions>, DimensionOptions> dimensionMap) {
|
||||
Identifier demensionIdentifier = new Identifier(key);
|
||||
Identifier demensionIdentifier = Identifier.of(key);
|
||||
|
||||
VanillaWorldProperties vanillaWorldProperties;
|
||||
|
||||
@@ -103,13 +103,13 @@ public class PresetUtil {
|
||||
vanillaWorldProperties = new VanillaWorldProperties();
|
||||
}
|
||||
|
||||
DimensionType defaultDimension = dimensionTypeRegistry.get(new Identifier(vanillaWorldProperties.getVanillaDimension()));
|
||||
DimensionType defaultDimension = dimensionTypeRegistry.get(Identifier.of(vanillaWorldProperties.getVanillaDimension()));
|
||||
|
||||
assert defaultDimension != null;
|
||||
|
||||
DimensionType dimensionType = DimensionUtil.createDimension(vanillaWorldProperties, defaultDimension, platform);
|
||||
RegistryKey<DimensionType> dimensionTypeRegistryKey = MinecraftUtil.registerDimensionTypeKey(
|
||||
new Identifier("terra", pack.getID().toLowerCase(
|
||||
Identifier.of("terra", pack.getID().toLowerCase(
|
||||
Locale.ROOT)));
|
||||
|
||||
Registry.registerReference(dimensionTypeRegistry, dimensionTypeRegistryKey, dimensionType);
|
||||
@@ -119,7 +119,7 @@ public class PresetUtil {
|
||||
TerraBiomeSource biomeSource = new TerraBiomeSource(pack);
|
||||
|
||||
RegistryEntry<ChunkGeneratorSettings> defaultGeneratorSettings = chunkGeneratorSettingsRegistry.getEntry(
|
||||
chunkGeneratorSettingsRegistry.get(new Identifier(vanillaWorldProperties.getVanillaGeneration())));
|
||||
chunkGeneratorSettingsRegistry.get(Identifier.of(vanillaWorldProperties.getVanillaGeneration())));
|
||||
|
||||
GenerationSettings generatorSettings = new GenerationSettings(
|
||||
vanillaWorldProperties.getHeight() == null ? new ConstantRange(
|
||||
|
||||
Reference in New Issue
Block a user