mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2025-07-03 16:35:50 +00:00
simplify biome tag injection
This commit is contained in:
parent
a4d87a428c
commit
43a84cca3d
@ -17,6 +17,11 @@
|
||||
|
||||
package com.dfsek.terra.fabric.generation;
|
||||
|
||||
import com.dfsek.terra.api.config.ConfigPack;
|
||||
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
||||
import com.dfsek.terra.fabric.data.Codecs;
|
||||
import com.dfsek.terra.fabric.util.ProtoPlatformBiome;
|
||||
|
||||
import com.mojang.serialization.Codec;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import net.minecraft.util.registry.RegistryEntry;
|
||||
@ -27,11 +32,6 @@ import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.stream.StreamSupport;
|
||||
|
||||
import com.dfsek.terra.api.config.ConfigPack;
|
||||
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
||||
import com.dfsek.terra.fabric.data.Codecs;
|
||||
import com.dfsek.terra.fabric.util.ProtoPlatformBiome;
|
||||
|
||||
|
||||
public class TerraBiomeSource extends BiomeSource {
|
||||
|
||||
@ -65,11 +65,12 @@ public class TerraBiomeSource extends BiomeSource {
|
||||
|
||||
@Override
|
||||
public RegistryEntry<net.minecraft.world.biome.Biome> getBiome(int biomeX, int biomeY, int biomeZ, MultiNoiseSampler noiseSampler) {
|
||||
return biomeRegistry.getOrCreateEntry(((ProtoPlatformBiome) pack
|
||||
.getBiomeProvider()
|
||||
.getBiome(biomeX << 2, biomeY << 2, biomeZ << 2, seed)
|
||||
.getPlatformBiome())
|
||||
.getDelegate());
|
||||
return biomeRegistry
|
||||
.entryOf(((ProtoPlatformBiome) pack
|
||||
.getBiomeProvider()
|
||||
.getBiome(biomeX << 2, biomeY << 2, biomeZ << 2, seed)
|
||||
.getPlatformBiome()).getDelegate()
|
||||
);
|
||||
}
|
||||
|
||||
public BiomeProvider getProvider() {
|
||||
|
@ -57,14 +57,7 @@ public final class TagUtil {
|
||||
.computeIfAbsent(
|
||||
tag,
|
||||
t -> new ArrayList<>())
|
||||
.add(FabricUtil
|
||||
.getEntry(
|
||||
registry,
|
||||
terra.getKey()
|
||||
.orElseThrow()
|
||||
.getValue())
|
||||
.orElseThrow()));
|
||||
|
||||
.add(terra));
|
||||
},
|
||||
() -> logger.error(
|
||||
"No such biome: {}",
|
||||
|
Loading…
x
Reference in New Issue
Block a user