Try to make terraforged less angry against Create world gen

This commit is contained in:
grimmauld 2021-03-27 19:15:52 +01:00
parent fd98bd4976
commit bec6b1d414
2 changed files with 17 additions and 4 deletions

View file

@ -2,6 +2,8 @@ package com.simibubi.create;
import java.util.Random; import java.util.Random;
import net.minecraft.world.gen.feature.Feature;
import net.minecraft.world.gen.placement.Placement;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
@ -88,6 +90,8 @@ public class Create {
modEventBus.addListener(Create::init); modEventBus.addListener(Create::init);
MinecraftForge.EVENT_BUS.addListener(EventPriority.HIGH, Create::onBiomeLoad); MinecraftForge.EVENT_BUS.addListener(EventPriority.HIGH, Create::onBiomeLoad);
modEventBus.addGenericListener(Feature.class, AllWorldFeatures::registerOreFeatures);
modEventBus.addGenericListener(Placement.class, AllWorldFeatures::registerDecoratorFeatures);
modEventBus.addGenericListener(IRecipeSerializer.class, AllRecipeTypes::register); modEventBus.addGenericListener(IRecipeSerializer.class, AllRecipeTypes::register);
modEventBus.addGenericListener(ContainerType.class, AllContainerTypes::register); modEventBus.addGenericListener(ContainerType.class, AllContainerTypes::register);
modEventBus.addGenericListener(ParticleType.class, AllParticleTypes::register); modEventBus.addGenericListener(ParticleType.class, AllParticleTypes::register);

View file

@ -14,9 +14,11 @@ import net.minecraft.util.registry.WorldGenRegistries;
import net.minecraft.world.biome.Biome.Category; import net.minecraft.world.biome.Biome.Category;
import net.minecraft.world.biome.Biomes; import net.minecraft.world.biome.Biomes;
import net.minecraft.world.gen.GenerationStage; import net.minecraft.world.gen.GenerationStage;
import net.minecraft.world.gen.feature.Feature;
import net.minecraft.world.gen.placement.Placement;
import net.minecraftforge.common.ForgeConfigSpec; import net.minecraftforge.common.ForgeConfigSpec;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.event.world.BiomeLoadingEvent; import net.minecraftforge.event.world.BiomeLoadingEvent;
import net.minecraftforge.registries.ForgeRegistries;
public class AllWorldFeatures { public class AllWorldFeatures {
@ -57,10 +59,10 @@ public class AllWorldFeatures {
public static final int forcedUpdateVersion = 2; public static final int forcedUpdateVersion = 2;
public static void registerFeatures() { public static void registerFeatures() {
ForgeRegistries.FEATURES.register(ConfigDrivenOreFeature.INSTANCE); // ForgeRegistries.FEATURES.register(ConfigDrivenOreFeature.INSTANCE);
ForgeRegistries.DECORATORS.register(ConfigDrivenDecorator.INSTANCE); // ForgeRegistries.DECORATORS.register(ConfigDrivenDecorator.INSTANCE);
entries.entrySet() entries.entrySet()
.forEach((entry) -> { .forEach(entry -> {
Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, Create.ID + "_" + entry.getKey(), Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, Create.ID + "_" + entry.getKey(),
entry.getValue() entry.getValue()
.getFeature()); .getFeature());
@ -90,4 +92,11 @@ public class AllWorldFeatures {
public static void register() {} public static void register() {}
public static void registerOreFeatures(RegistryEvent.Register<Feature<?>> event) {
event.getRegistry().register(ConfigDrivenOreFeature.INSTANCE);
}
public static void registerDecoratorFeatures(RegistryEvent.Register<Placement<?>> event) {
event.getRegistry().register(ConfigDrivenDecorator.INSTANCE);
}
} }