So a little background I have been working with this for a while trying to troubleshoot this with print out's to see if it is called
I will provide the code below to show where I am at with ore gen, it seem's like it is being called but I cannot find the ore generated in the world
It is showing my sys print out in the console
import net.minecraft.world.gen.placement.Placement;
import net.minecraft.world.gen.placement.TopSolidRangeConfig;
import net.minecraftforge.common.world.BiomeGenerationSettingsBuilder;
import net.minecraftforge.event.world.BiomeLoadingEvent;
public class OreGeneration {
public static void generateOres(BiomeLoadingEvent event) {
if(!(event.getCategory().equals(Biome.Category.NETHER) || !(event.getCategory().equals(Biome.Category.THEEND)))) {
generateOre(event.getGeneration(), OreFeatureConfig.FillerBlockType.NATURAL_STONE, ModBlocks.YELLOW_ORE.get().defaultBlockState(), 5, 5, 70, 10000);
System.out.println("Ore Generation Called for spongebob");
}
}
private static void generateOre(BiomeGenerationSettingsBuilder settings, RuleTest fillerType, BlockState stateContainer,
int veinSize, int minHeight, int maxHeight, int amount) {
settings.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Feature.ORE.configured(new OreFeatureConfig(fillerType, stateContainer, veinSize))
.decorated(Placement.RANGE.configured(new TopSolidRangeConfig(minHeight, 0, maxHeight)))
.squared().count(amount).range(64));
System.out.println("Ore Generation Called for spongebob ore generated");
}
}
Next class is where the Mod event bus is called
package com.example.examplemod;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import com.example.examplemod.registry.Registration;
import com.example.examplemod.world.OreGeneration;
import net.minecraft.block.Blocks;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.EventPriority;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
// The value here should match an entry in the META-INF/mods.toml file
@Mod("spongebob")
public class TestMod
{
public static final String MOD_ID = "spongebob";
// Directly reference a log4j logger.
private static final Logger LOGGER = LogManager.getLogger();
public TestMod() {
Registration.register();
// Register the setup method for modloading
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup);
MinecraftForge.EVENT_BUS.addListener(OreGeneration::generateOres);
// Register ourselves for server and other game events we are interested in
MinecraftForge.EVENT_BUS.register(this);
}
private void setup(final FMLCommonSetupEvent event)
{
// some print code
LOGGER.info("HELLO FROM PREINIT");
LOGGER.info("DIRT BLOCK >> {}", Blocks.DIRT.getRegistryName());
}
}
Please assist, I will love you forever
Update:
I am going to attach where they are getting printed out in the console