This commit is contained in:
gnembon committed 2020-08-15 02:30:25 -03:00
1 parent 988344762b
commit 92dc89087c
3 files changed
+11 -12

No files matched your search

+1 -1
View File
@@ -5,7 +5,7 @@ org.gradle.jvmargs=-Xmx1G
# check these on https://fabricmc.net/use # check these on https://fabricmc.net/use
# or better: https://modmuss50.me/fabric.html # or better: https://modmuss50.me/fabric.html
minecraft_version=1.16.2 minecraft_version=1.16.2
yarn_mappings=1.16.2+build.1 yarn_mappings=1.16.2+build.12
loader_version=0.9.1+build.205 loader_version=0.9.1+build.205
# Mod Properties # Mod Properties
@@ -18,8 +18,8 @@ import net.minecraft.util.registry.BuiltinRegistries;
import net.minecraft.util.registry.Registry; import net.minecraft.util.registry.Registry;
import net.minecraft.util.registry.RegistryKey; import net.minecraft.util.registry.RegistryKey;
import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.Biomes; import net.minecraft.world.biome.BiomeKeys;
import net.minecraft.world.biome.BuiltInBiomes; import net.minecraft.world.biome.BuiltinBiomes;
import net.minecraft.world.biome.source.BiomeAccess; import net.minecraft.world.biome.source.BiomeAccess;
import net.minecraft.world.gen.ChunkRandom; import net.minecraft.world.gen.ChunkRandom;
import net.minecraft.world.gen.chunk.ChunkGenerator; import net.minecraft.world.gen.chunk.ChunkGenerator;
@@ -54,7 +54,7 @@ public class FeatureGenerator
{ {
return ((StructureFeatureInterface)structureFeature.feature).plopAnywhere( return ((StructureFeatureInterface)structureFeature.feature).plopAnywhere(
world, pos, world.getChunkManager().getChunkGenerator(), world, pos, world.getChunkManager().getChunkGenerator(),
false, world.getRegistryManager().get(Registry.BIOME_KEY).method_31140(BuiltInBiomes.PLAINS), structureFeature.config); false, world.getRegistryManager().get(Registry.BIOME_KEY).get(BiomeKeys.PLAINS), structureFeature.config);
} }
@@ -91,7 +91,7 @@ public class FeatureGenerator
{ {
return ((StructureFeatureInterface)structureFeature.feature).plopAnywhere( return ((StructureFeatureInterface)structureFeature.feature).plopAnywhere(
world, pos, world.getChunkManager().getChunkGenerator(), world, pos, world.getChunkManager().getChunkGenerator(),
true, Biomes.PLAINS, structureFeature.config); true, BuiltinBiomes.PLAINS, structureFeature.config);
} }
@FunctionalInterface @FunctionalInterface
@@ -130,7 +130,7 @@ public class FeatureGenerator
} }
private static Thing setupCustomStructure(StructureFeature structure, FeatureConfig conf, RegistryKey<Biome> biome, boolean wireOnly) private static Thing setupCustomStructure(StructureFeature structure, FeatureConfig conf, RegistryKey<Biome> biome, boolean wireOnly)
{ {
return (w, p) -> ((StructureFeatureInterface)structure).plopAnywhere(w, p, w.getChunkManager().getChunkGenerator(), wireOnly, w.getRegistryManager().get(Registry.BIOME_KEY).method_31140(biome), conf); return (w, p) -> ((StructureFeatureInterface)structure).plopAnywhere(w, p, w.getChunkManager().getChunkGenerator(), wireOnly, w.getRegistryManager().get(Registry.BIOME_KEY).get(biome), conf);
} }
public static Boolean spawn(String name, ServerWorld world, BlockPos pos) public static Boolean spawn(String name, ServerWorld world, BlockPos pos)
@@ -154,7 +154,7 @@ public class FeatureGenerator
{ {
long seed = world.getSeed(); long seed = world.getSeed();
ChunkGenerator generator = world.getChunkManager().getChunkGenerator(); ChunkGenerator generator = world.getChunkManager().getChunkGenerator();
StructureConfig params = generator.getConfig().getForType(structure); StructureConfig params = generator.getStructuresConfig().getForType(structure);
if (!generator.getBiomeSource().hasStructureFeature(structure)) if (!generator.getBiomeSource().hasStructureFeature(structure))
return null; return null;
BiomeAccess biomeAccess = world.getBiomeAccess().withSource(generator.getBiomeSource()); BiomeAccess biomeAccess = world.getBiomeAccess().withSource(generator.getBiomeSource());
@@ -198,7 +198,7 @@ public class FeatureGenerator
), ),
StructurePool.Projection.RIGID StructurePool.Projection.RIGID
), 6), ), 6),
BuiltInBiomes.NETHER_WASTES BiomeKeys.NETHER_WASTES
)); ));
put("bastion_remnant_hoglin_stable", spawnCustomStructure( put("bastion_remnant_hoglin_stable", spawnCustomStructure(
StructureFeature.BASTION_REMNANT, StructureFeature.BASTION_REMNANT,
@@ -210,7 +210,7 @@ public class FeatureGenerator
), ),
StructurePool.Projection.RIGID StructurePool.Projection.RIGID
), 6), ), 6),
BuiltInBiomes.NETHER_WASTES BiomeKeys.NETHER_WASTES
)); ));
put("bastion_remnant_treasure", spawnCustomStructure( put("bastion_remnant_treasure", spawnCustomStructure(
StructureFeature.BASTION_REMNANT, StructureFeature.BASTION_REMNANT,
@@ -222,7 +222,7 @@ public class FeatureGenerator
), ),
StructurePool.Projection.RIGID StructurePool.Projection.RIGID
), 6), ), 6),
BuiltInBiomes.NETHER_WASTES BiomeKeys.NETHER_WASTES
)); ));
put("bastion_remnant_bridge", spawnCustomStructure( put("bastion_remnant_bridge", spawnCustomStructure(
StructureFeature.BASTION_REMNANT, StructureFeature.BASTION_REMNANT,
@@ -234,7 +234,7 @@ public class FeatureGenerator
), ),
StructurePool.Projection.RIGID StructurePool.Projection.RIGID
), 6), ), 6),
BuiltInBiomes.NETHER_WASTES BiomeKeys.NETHER_WASTES
)); ));
}}; }};
@@ -8,7 +8,6 @@ import net.minecraft.block.SaplingBlock;
import net.minecraft.server.world.ServerWorld; import net.minecraft.server.world.ServerWorld;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.Biomes;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.Inject;