diff --git a/src/main/java/com/simibubi/create/Create.java b/src/main/java/com/simibubi/create/Create.java index df053dbbe..afeb6f55b 100644 --- a/src/main/java/com/simibubi/create/Create.java +++ b/src/main/java/com/simibubi/create/Create.java @@ -2,6 +2,8 @@ package com.simibubi.create; 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.Logger; @@ -88,6 +90,8 @@ public class Create { modEventBus.addListener(Create::init); 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(ContainerType.class, AllContainerTypes::register); modEventBus.addGenericListener(ParticleType.class, AllParticleTypes::register); diff --git a/src/main/java/com/simibubi/create/foundation/worldgen/AllWorldFeatures.java b/src/main/java/com/simibubi/create/foundation/worldgen/AllWorldFeatures.java index 3ab6d676a..be79d1157 100644 --- a/src/main/java/com/simibubi/create/foundation/worldgen/AllWorldFeatures.java +++ b/src/main/java/com/simibubi/create/foundation/worldgen/AllWorldFeatures.java @@ -14,9 +14,11 @@ import net.minecraft.util.registry.WorldGenRegistries; import net.minecraft.world.biome.Biome.Category; import net.minecraft.world.biome.Biomes; 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.event.RegistryEvent; import net.minecraftforge.event.world.BiomeLoadingEvent; -import net.minecraftforge.registries.ForgeRegistries; public class AllWorldFeatures { @@ -57,10 +59,10 @@ public class AllWorldFeatures { public static final int forcedUpdateVersion = 2; public static void registerFeatures() { - ForgeRegistries.FEATURES.register(ConfigDrivenOreFeature.INSTANCE); - ForgeRegistries.DECORATORS.register(ConfigDrivenDecorator.INSTANCE); + // ForgeRegistries.FEATURES.register(ConfigDrivenOreFeature.INSTANCE); + // ForgeRegistries.DECORATORS.register(ConfigDrivenDecorator.INSTANCE); entries.entrySet() - .forEach((entry) -> { + .forEach(entry -> { Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, Create.ID + "_" + entry.getKey(), entry.getValue() .getFeature()); @@ -90,4 +92,11 @@ public class AllWorldFeatures { public static void register() {} + public static void registerOreFeatures(RegistryEvent.Register> event) { + event.getRegistry().register(ConfigDrivenOreFeature.INSTANCE); + } + + public static void registerDecoratorFeatures(RegistryEvent.Register> event) { + event.getRegistry().register(ConfigDrivenDecorator.INSTANCE); + } }