mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-02-16 10:30:42 +00:00
update minecraft data config templates
This commit is contained in:
@@ -5,10 +5,7 @@ import com.dfsek.tectonic.api.depth.DepthTracker;
|
||||
import com.dfsek.tectonic.api.exception.LoadException;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.SpawnGroup;
|
||||
import net.minecraft.registry.BuiltinRegistries;
|
||||
import net.minecraft.registry.DynamicRegistryManager;
|
||||
import net.minecraft.registry.Registry;
|
||||
import net.minecraft.registry.RegistryKey;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.sound.BiomeAdditionsSound;
|
||||
@@ -61,7 +58,7 @@ public abstract class ModPlatform extends AbstractPlatform {
|
||||
|
||||
public void registerWorldTypes(BiConsumer<Identifier, WorldPreset> registerFunction) {
|
||||
getRawConfigRegistry()
|
||||
.forEach(pack -> PresetUtil.createDefault(pack).apply(registerFunction));
|
||||
.forEach(pack -> PresetUtil.createDefault(pack, getMinecraftRegistry()).apply(registerFunction));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -98,7 +95,7 @@ public abstract class ModPlatform extends AbstractPlatform {
|
||||
|
||||
private ProtoPlatformBiome parseBiome(String id, DepthTracker tracker) throws LoadException {
|
||||
Identifier identifier = Identifier.tryParse(id);
|
||||
if(getMinecraftRegistry(RegistryKeys.BIOME).get(identifier) == null) throw new LoadException("Invalid Biome ID: " + identifier, tracker); // failure.
|
||||
if(getMinecraftRegistry().get(RegistryKeys.BIOME).get(identifier) == null) throw new LoadException("Invalid Biome ID: " + identifier, tracker); // failure.
|
||||
return new ProtoPlatformBiome(identifier);
|
||||
}
|
||||
|
||||
@@ -109,7 +106,7 @@ public abstract class ModPlatform extends AbstractPlatform {
|
||||
|
||||
protected abstract BaseAddon getPlatformAddon();
|
||||
|
||||
public abstract <T> Registry<T> getMinecraftRegistry(RegistryKey<? extends Registry<? extends T>> key);
|
||||
public abstract DynamicRegistryManager getMinecraftRegistry();
|
||||
|
||||
@Override
|
||||
public @NotNull WorldHandle getWorldHandle() {
|
||||
|
||||
@@ -3,6 +3,7 @@ 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 net.minecraft.registry.Registries;
|
||||
import net.minecraft.sound.BiomeAdditionsSound;
|
||||
import net.minecraft.sound.SoundEvent;
|
||||
|
||||
@@ -21,7 +22,7 @@ public class BiomeAdditionsSoundTemplate implements ObjectTemplate<BiomeAddition
|
||||
if(sound == null || soundChance == null) {
|
||||
return null;
|
||||
} else {
|
||||
return new BiomeAdditionsSound(sound, soundChance);
|
||||
return new BiomeAdditionsSound(Registries.SOUND_EVENT.getEntry(sound), soundChance);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ 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 net.minecraft.registry.Registries;
|
||||
import net.minecraft.sound.BiomeMoodSound;
|
||||
import net.minecraft.sound.SoundEvent;
|
||||
|
||||
@@ -29,7 +30,7 @@ public class BiomeMoodSoundTemplate implements ObjectTemplate<BiomeMoodSound> {
|
||||
if(sound == null || soundCultivationTicks == null || soundSpawnRange == null || soundExtraDistance == null) {
|
||||
return null;
|
||||
} else {
|
||||
return new BiomeMoodSound(sound, soundCultivationTicks, soundSpawnRange, soundExtraDistance);
|
||||
return new BiomeMoodSound(Registries.SOUND_EVENT.getEntry(sound), soundCultivationTicks, soundSpawnRange, soundExtraDistance);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.dfsek.tectonic.api.config.template.object.ObjectTemplate;
|
||||
import com.mojang.brigadier.StringReader;
|
||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||
import net.minecraft.command.argument.ParticleEffectArgumentType;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.world.biome.BiomeParticleConfig;
|
||||
|
||||
|
||||
@@ -25,7 +26,7 @@ public class BiomeParticleConfigTemplate implements ObjectTemplate<BiomeParticle
|
||||
}
|
||||
|
||||
try {
|
||||
return new BiomeParticleConfig(ParticleEffectArgumentType.readParameters(new StringReader(particle)), probability);
|
||||
return new BiomeParticleConfig(ParticleEffectArgumentType.readParameters(new StringReader(particle), Registries.PARTICLE_TYPE.getReadOnlyWrapper()), probability);
|
||||
} catch(CommandSyntaxException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ 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 net.minecraft.entity.EntityType;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.registry.Registry;
|
||||
|
||||
@@ -15,6 +16,6 @@ public class EntityTypeTemplate implements ObjectTemplate<EntityType<?>> {
|
||||
|
||||
@Override
|
||||
public EntityType<?> get() {
|
||||
return Registry.ENTITY_TYPE.get(id);
|
||||
return Registries.ENTITY_TYPE.get(id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ 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 net.minecraft.registry.Registries;
|
||||
import net.minecraft.sound.MusicSound;
|
||||
import net.minecraft.sound.SoundEvent;
|
||||
|
||||
@@ -29,7 +30,7 @@ public class MusicSoundTemplate implements ObjectTemplate<MusicSound> {
|
||||
if(sound == null || minDelay == null || maxDelay == null || replaceCurrentMusic == null) {
|
||||
return null;
|
||||
} else {
|
||||
return new MusicSound(sound, minDelay, maxDelay, replaceCurrentMusic);
|
||||
return new MusicSound(Registries.SOUND_EVENT.getEntry(sound), minDelay, maxDelay, replaceCurrentMusic);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,9 +21,9 @@ public class SoundEventTemplate implements ObjectTemplate<SoundEvent> {
|
||||
if(id == null) {
|
||||
return null;
|
||||
} else if(distanceToTravel == null) {
|
||||
return new SoundEvent(id);
|
||||
return SoundEvent.of(id);
|
||||
} else {
|
||||
return new SoundEvent(id, distanceToTravel);
|
||||
return SoundEvent.of(id, distanceToTravel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ 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 net.minecraft.registry.Registries;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.registry.Registry;
|
||||
import net.minecraft.village.VillagerType;
|
||||
@@ -15,6 +16,6 @@ public class VillagerTypeTemplate implements ObjectTemplate<VillagerType> {
|
||||
|
||||
@Override
|
||||
public VillagerType get() {
|
||||
return Registry.VILLAGER_TYPE.get(id);
|
||||
return Registries.VILLAGER_TYPE.get(id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,9 @@ import com.mojang.brigadier.StringReader;
|
||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||
import net.minecraft.command.CommandRegistryAccess;
|
||||
import net.minecraft.command.argument.ItemStackArgumentType;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.registry.RegistryKey;
|
||||
import net.minecraft.registry.RegistryWrapper;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.registry.Registry;
|
||||
|
||||
@@ -38,8 +41,12 @@ public class MinecraftItemHandle implements ItemHandle {
|
||||
@Override
|
||||
public Item createItem(String data) {
|
||||
try {
|
||||
return (Item) new ItemStackArgumentType(new CommandRegistryAccess(
|
||||
CommonPlatform.get().getServer().getRegistryManager())).parse(new StringReader(data)).getItem();
|
||||
return (Item) new ItemStackArgumentType(new CommandRegistryAccess() {
|
||||
@Override
|
||||
public <T> RegistryWrapper<T> createWrapper(RegistryKey<? extends Registry<T>> registryRef) {
|
||||
return CommonPlatform.get().getServer().getRegistryManager().getWrapperOrThrow(registryRef);
|
||||
}
|
||||
}).parse(new StringReader(data)).getItem();
|
||||
} catch(CommandSyntaxException e) {
|
||||
throw new IllegalArgumentException("Invalid item data \"" + data + "\"", e);
|
||||
}
|
||||
@@ -47,11 +54,11 @@ public class MinecraftItemHandle implements ItemHandle {
|
||||
|
||||
@Override
|
||||
public Enchantment getEnchantment(String id) {
|
||||
return (Enchantment) (Registry.ENCHANTMENT.get(Identifier.tryParse(id)));
|
||||
return (Enchantment) (Registries.ENCHANTMENT.get(Identifier.tryParse(id)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Enchantment> getEnchantments() {
|
||||
return Registry.ENCHANTMENT.stream().map(enchantment -> (Enchantment) enchantment).collect(Collectors.toSet());
|
||||
return Registries.ENCHANTMENT.stream().map(enchantment -> (Enchantment) enchantment).collect(Collectors.toSet());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ package com.dfsek.terra.mod.handle;
|
||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.command.argument.BlockArgumentParser;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.registry.Registry;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -36,7 +37,7 @@ public class MinecraftWorldHandle implements WorldHandle {
|
||||
@Override
|
||||
public @NotNull BlockState createBlockState(@NotNull String data) {
|
||||
try {
|
||||
net.minecraft.block.BlockState state = BlockArgumentParser.block(Registry.BLOCK, data, true).blockState();
|
||||
net.minecraft.block.BlockState state = BlockArgumentParser.block(Registries.BLOCK.getReadOnlyWrapper(), data, true).blockState();
|
||||
if(state == null) throw new IllegalArgumentException("Invalid data: " + data);
|
||||
return (BlockState) state;
|
||||
} catch(CommandSyntaxException e) {
|
||||
@@ -53,6 +54,6 @@ public class MinecraftWorldHandle implements WorldHandle {
|
||||
public @NotNull EntityType getEntity(@NotNull String id) {
|
||||
Identifier identifier = Identifier.tryParse(id);
|
||||
if(identifier == null) identifier = Identifier.tryParse(id);
|
||||
return (EntityType) Registry.ENTITY_TYPE.get(identifier);
|
||||
return (EntityType) Registries.ENTITY_TYPE.get(identifier);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,9 +21,11 @@ import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.block.entity.BlockEntityType;
|
||||
import net.minecraft.block.entity.MobSpawnerBlockEntity;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.registry.Registry;
|
||||
import net.minecraft.util.math.random.Random;
|
||||
import net.minecraft.world.MobSpawnerLogic;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.spongepowered.asm.mixin.Implements;
|
||||
@@ -48,13 +50,16 @@ public abstract class MobSpawnerBlockEntityMixin extends BlockEntity {
|
||||
@Shadow
|
||||
public abstract MobSpawnerLogic getLogic();
|
||||
|
||||
@Shadow
|
||||
public abstract void setEntityType(net.minecraft.entity.EntityType<?> entityType, Random random);
|
||||
|
||||
public EntityType terra$getSpawnedType() {
|
||||
return (EntityType) Registry.ENTITY_TYPE.get(
|
||||
return (EntityType) Registries.ENTITY_TYPE.get(
|
||||
Identifier.tryParse(((MobSpawnerLogicAccessor) getLogic()).getSpawnEntry().getNbt().getString("id")));
|
||||
}
|
||||
|
||||
public void terra$setSpawnedType(@NotNull EntityType creatureType) {
|
||||
getLogic().setEntityId((net.minecraft.entity.EntityType<?>) creatureType);
|
||||
setEntityType((net.minecraft.entity.EntityType<?>) creatureType, world.getRandom());
|
||||
}
|
||||
|
||||
public int terra$getDelay() {
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.google.common.collect.ImmutableMap;
|
||||
import com.mojang.serialization.MapCodec;
|
||||
import net.minecraft.block.AbstractBlock.AbstractBlockState;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.state.State;
|
||||
import net.minecraft.registry.Registry;
|
||||
import org.spongepowered.asm.mixin.Implements;
|
||||
@@ -66,7 +67,7 @@ public abstract class BlockStateMixin extends State<Block, net.minecraft.block.B
|
||||
|
||||
@Intrinsic
|
||||
public String terra$getAsString(boolean properties) {
|
||||
StringBuilder data = new StringBuilder(Registry.BLOCK.getId(getBlock()).toString());
|
||||
StringBuilder data = new StringBuilder(Registries.BLOCK.getId(getBlock()).toString());
|
||||
if(properties && !getEntries().isEmpty()) {
|
||||
data.append('[');
|
||||
data.append(
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
package com.dfsek.terra.mod.mixin.implementations.terra.inventory.meta;
|
||||
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.registry.Registry;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
import org.spongepowered.asm.mixin.Implements;
|
||||
@@ -49,6 +50,6 @@ public abstract class EnchantmentMixin {
|
||||
}
|
||||
|
||||
public String terra$getID() {
|
||||
return Objects.requireNonNull(RegistryKeys.ENCHANTMENT.getId((Enchantment) (Object) this)).toString();
|
||||
return Objects.requireNonNull(Registries.ENCHANTMENT.getId((Enchantment) (Object) this)).toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ package com.dfsek.terra.mod.mixin.implementations.terra.inventory.meta;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.nbt.NbtList;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.registry.Registry;
|
||||
import org.spongepowered.asm.mixin.Implements;
|
||||
import org.spongepowered.asm.mixin.Interface;
|
||||
@@ -58,7 +59,7 @@ public abstract class ItemStackMetaMixin {
|
||||
|
||||
getEnchantments().forEach(enchantment -> {
|
||||
NbtCompound eTag = (NbtCompound) enchantment;
|
||||
map.put((Enchantment) Registry.ENCHANTMENT.get(eTag.getInt("id")), eTag.getInt("lvl"));
|
||||
map.put((Enchantment) Registries.ENCHANTMENT.get(eTag.getInt("id")), eTag.getInt("lvl"));
|
||||
});
|
||||
return map;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ public class DataPackContentsMixin {
|
||||
/*
|
||||
* #refresh populates all tags in the registries
|
||||
*/
|
||||
@Inject(method = "refresh(Lnet/minecraft/util/registry/DynamicRegistryManager;)V", at = @At("RETURN"))
|
||||
@Inject(method = "refresh(Lnet/minecraft/registry/DynamicRegistryManager;)V", at = @At("RETURN"))
|
||||
private void injectReload(DynamicRegistryManager dynamicRegistryManager, CallbackInfo ci) {
|
||||
TagUtil.registerWorldPresetTags(dynamicRegistryManager.get(RegistryKeys.WORLD_PRESET));
|
||||
|
||||
|
||||
@@ -134,7 +134,7 @@ public final class MinecraftUtil {
|
||||
if(vanillaBiomeProperties.getLoopSound() == null) {
|
||||
vanilla.getEffects().getLoopSound().ifPresent(effects::loopSound);
|
||||
} else {
|
||||
effects.loopSound(vanillaBiomeProperties.getLoopSound());
|
||||
effects.loopSound(Registries.SOUND_EVENT.getEntry(vanillaBiomeProperties.getLoopSound()));
|
||||
}
|
||||
|
||||
if(vanillaBiomeProperties.getMoodSound() == null) {
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
package com.dfsek.terra.mod.util;
|
||||
|
||||
import net.minecraft.command.CommandRegistryAccess;
|
||||
import net.minecraft.registry.BuiltinRegistries;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
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.registry.DynamicRegistryManager;
|
||||
import net.minecraft.registry.Registry;
|
||||
import net.minecraft.util.registry.RegistryEntry;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
import net.minecraft.registry.entry.RegistryEntry;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.biome.source.MultiNoiseBiomeSource;
|
||||
import net.minecraft.world.biome.source.TheEndBiomeSource;
|
||||
@@ -33,40 +29,38 @@ import com.dfsek.terra.mod.generation.MinecraftChunkGeneratorWrapper;
|
||||
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 Pair<Identifier, WorldPreset> createDefault(ConfigPack pack) {
|
||||
public static Pair<Identifier, WorldPreset> createDefault(ConfigPack pack, DynamicRegistryManager registryManager) {
|
||||
Registry<DimensionType> dimensionTypeRegistry = registryManager.get(RegistryKeys.DIMENSION_TYPE);
|
||||
Registry<ChunkGeneratorSettings> chunkGeneratorSettingsRegistry = registryManager.get(RegistryKeys.CHUNK_GENERATOR_SETTINGS);
|
||||
Registry<Biome> biomeRegistry = registryManager.get(RegistryKeys.BIOME);
|
||||
|
||||
|
||||
Registry<DimensionType> dimensionTypeRegistry = access.;
|
||||
Registry<ChunkGeneratorSettings> chunkGeneratorSettingsRegistry = BuiltinRegistries.CHUNK_GENERATOR_SETTINGS;
|
||||
Registry<StructureSet> structureSetRegistry = BuiltinRegistries.STRUCTURE_SET;
|
||||
Registry<NoiseParameters> noiseParametersRegistry = BuiltinRegistries.NOISE_PARAMETERS;
|
||||
Registry<Biome> biomeRegistry = BuiltinRegistries.BIOME;
|
||||
|
||||
RegistryEntry<DimensionType> theNetherDimensionType = dimensionTypeRegistry.getOrCreateEntry(DimensionTypes.THE_NETHER);
|
||||
RegistryEntry<DimensionType> theNetherDimensionType = dimensionTypeRegistry.getEntry(DimensionTypes.THE_NETHER).orElseThrow();
|
||||
RegistryEntry<ChunkGeneratorSettings>
|
||||
netherChunkGeneratorSettings = chunkGeneratorSettingsRegistry.getOrCreateEntry(ChunkGeneratorSettings.NETHER);
|
||||
netherChunkGeneratorSettings = chunkGeneratorSettingsRegistry.getEntry(ChunkGeneratorSettings.NETHER).orElseThrow();
|
||||
DimensionOptions netherDimensionOptions = new DimensionOptions(theNetherDimensionType,
|
||||
new NoiseChunkGenerator(structureSetRegistry,
|
||||
noiseParametersRegistry,
|
||||
MultiNoiseBiomeSource.Preset.NETHER.getBiomeSource(
|
||||
biomeRegistry),
|
||||
netherChunkGeneratorSettings));
|
||||
RegistryEntry<DimensionType> theEndDimensionType = dimensionTypeRegistry.getOrCreateEntry(DimensionTypes.THE_END);
|
||||
RegistryEntry<ChunkGeneratorSettings> endChunkGeneratorSettings = chunkGeneratorSettingsRegistry.getOrCreateEntry(
|
||||
ChunkGeneratorSettings.END);
|
||||
new NoiseChunkGenerator(
|
||||
MultiNoiseBiomeSource.Preset.NETHER.getBiomeSource(
|
||||
registryManager.createRegistryLookup()
|
||||
.getOrThrow(RegistryKeys.BIOME)),
|
||||
netherChunkGeneratorSettings));
|
||||
RegistryEntry<DimensionType> theEndDimensionType = dimensionTypeRegistry.getEntry(DimensionTypes.THE_END).orElseThrow();
|
||||
RegistryEntry<ChunkGeneratorSettings> endChunkGeneratorSettings = chunkGeneratorSettingsRegistry.getEntry(
|
||||
ChunkGeneratorSettings.END).orElseThrow();
|
||||
DimensionOptions endDimensionOptions = new DimensionOptions(theEndDimensionType,
|
||||
new NoiseChunkGenerator(structureSetRegistry, noiseParametersRegistry,
|
||||
new TheEndBiomeSource(biomeRegistry),
|
||||
endChunkGeneratorSettings));
|
||||
new NoiseChunkGenerator(
|
||||
TheEndBiomeSource.createVanilla(
|
||||
registryManager.createRegistryLookup()
|
||||
.getOrThrow(RegistryKeys.BIOME)),
|
||||
endChunkGeneratorSettings));
|
||||
|
||||
RegistryEntry<DimensionType> overworldDimensionType = dimensionTypeRegistry.getOrCreateEntry(DimensionTypes.OVERWORLD);
|
||||
RegistryEntry<DimensionType> overworldDimensionType = dimensionTypeRegistry.getEntry(DimensionTypes.OVERWORLD).orElseThrow();
|
||||
|
||||
RegistryEntry<ChunkGeneratorSettings> overworld = chunkGeneratorSettingsRegistry.getOrCreateEntry(ChunkGeneratorSettings.OVERWORLD);
|
||||
RegistryEntry<ChunkGeneratorSettings> overworld = chunkGeneratorSettingsRegistry.getEntry(ChunkGeneratorSettings.OVERWORLD)
|
||||
.orElseThrow();
|
||||
|
||||
Identifier generatorID = Identifier.of("terra", pack.getID().toLowerCase(Locale.ROOT) + "/" + pack.getNamespace().toLowerCase(
|
||||
Locale.ROOT));
|
||||
|
||||
@@ -4,8 +4,6 @@ import ca.solostudios.strata.Versions;
|
||||
import ca.solostudios.strata.parser.tokenizer.ParseException;
|
||||
import net.minecraft.MinecraftVersion;
|
||||
import net.minecraft.registry.DynamicRegistryManager;
|
||||
import net.minecraft.registry.Registry;
|
||||
import net.minecraft.registry.RegistryKey;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -99,8 +97,8 @@ public abstract class LifecyclePlatform extends ModPlatform {
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> Registry<T> getMinecraftRegistry(RegistryKey<? extends Registry<? extends T>> key) {
|
||||
return DYNAMIC_REGISTRY_MANAGER.get().get(key);
|
||||
public DynamicRegistryManager getMinecraftRegistry() {
|
||||
return DYNAMIC_REGISTRY_MANAGER.get();
|
||||
}
|
||||
|
||||
protected abstract Collection<BaseAddon> getPlatformMods();
|
||||
|
||||
Reference in New Issue
Block a user