Ok, so, I'm trying to create a new ore and generate it in the world, but, for some reason, the Minecraft is crashing everytime.
OreGeneration:
package mod.stardev.mod1.world;
import mod.stardev.mod1.lists.blocksList;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.GenerationStage;
import net.minecraft.world.gen.feature.Feature;
import net.minecraft.world.gen.feature.OreFeatureConfig;
import net.minecraft.world.gen.placement.CountRangeConfig;
import net.minecraft.world.gen.placement.Placement;
import net.minecraftforge.registries.ForgeRegistries;
public class OreGeneration {
public static void setupOreGeneration() {
for (Biome biome : ForgeRegistries.BIOMES) {
biome.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Biome.createDecoratedFeature(Feature.ORE, new OreFeatureConfig(OreFeatureConfig.FillerBlockType.NATURAL_STONE, blocksList.tutorial_ore.getDefaultState(), oregenConfig.tutorial_chance.get()), Placement.COUNT_RANGE, new CountRangeConfig(10, 20, 0, 100)));
}
}
}
oregenConfig:
package mod.stardev.mod1.world;
import net.minecraftforge.common.ForgeConfigSpec;
public class oregenConfig {
public static ForgeConfigSpec.IntValue tutorial_chance;
public static ForgeConfigSpec.BooleanValue generate_overworld;
public static void init(ForgeConfigSpec.Builder server, ForgeConfigSpec.Builder client) {
server.comment("Oregen Config");
tutorial_chance = server
.comment("Maximum number of ore veins of the tutorial ore that can spawn in one chunk.")
.defineInRange("oregen.tutorial_chance", 20, 1, 1000000);
generate_overworld = server
.comment("Decide if you want the tutorial ore to spawn in the overworld")
.define("oregen.generate_overworld", true);
}
}
Main:
package mod.stardev.mod1;
import mod.stardev.mod1.lists.armorMaterialList;
import mod.stardev.mod1.lists.blocksList;
import mod.stardev.mod1.lists.itemsList;
import mod.stardev.mod1.lists.toolMaterialList;
import mod.stardev.mod1.world.OreGeneration;
import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.inventory.EquipmentSlotType;
import net.minecraft.item.*;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@Mod(tutorialmod.MODID)
public final class tutorialmod {
public static final String MODID = "tutorialmod";
public static final Logger LOGGER = LogManager.getLogger(MODID);
public static final ItemGroup tutorial = new tutorialItemGroup();
public tutorialmod() {
OreGeneration.setupOreGeneration();
LOGGER.info("Hello from TutorialMod.");
}
@Mod.EventBusSubscriber(modid = tutorialmod.MODID, bus = Mod.EventBusSubscriber.Bus.MOD)
public static class ModEventSubscriber {
@SubscribeEvent
public static void onRegisterItens(RegistryEvent.Register<Item> event) {
event.getRegistry().registerAll(
itemsList.tutorial_item = new Item(new Item.Properties().group(tutorial)).setRegistryName(location("tutorial_item")),
itemsList.tutorial_axe = new AxeItem(toolMaterialList.tutorial, -1.0f, 6.0f, new Item.Properties().group(tutorial)).setRegistryName(location("tutorial_axe")),
itemsList.tutorial_pickaxe = new PickaxeItem(toolMaterialList.tutorial, -1, 6.0f, new Item.Properties().group(tutorial)).setRegistryName(location("tutorial_pickaxe")),
itemsList.tutorial_shovel = new ShovelItem(toolMaterialList.tutorial, -1.0f, 6.0f, new Item.Properties().group(tutorial)).setRegistryName(location("tutorial_shovel")),
itemsList.tutorial_hoe = new HoeItem(toolMaterialList.tutorial, 6.0f, new Item.Properties().group(tutorial)).setRegistryName(location("tutorial_hoe")),
itemsList.tutorial_sword = new SwordItem(toolMaterialList.tutorial, 3, 6.0f, new Item.Properties().group(tutorial)).setRegistryName(location("tutorial_sword")),
itemsList.tutorial_helmet = new ArmorItem(armorMaterialList.tutorial, EquipmentSlotType.HEAD, new Item.Properties().group(tutorial)).setRegistryName(location("tutorial_helmet")),
itemsList.tutorial_chestplate = new ArmorItem(armorMaterialList.tutorial, EquipmentSlotType.CHEST, new Item.Properties().group(tutorial)).setRegistryName(location("tutorial_chestplate")),
itemsList.tutorial_legging = new ArmorItem(armorMaterialList.tutorial, EquipmentSlotType.LEGS, new Item.Properties().group(tutorial)).setRegistryName(location("tutorial_legging")),
itemsList.tutorial_boots = new ArmorItem(armorMaterialList.tutorial, EquipmentSlotType.FEET, new Item.Properties().group(tutorial)).setRegistryName(location("tutorial_boots")),
itemsList.tutorial_block = new BlockItem(blocksList.tutorial_block, new Item.Properties().group(tutorial)).setRegistryName(blocksList.tutorial_block.getRegistryName()),
itemsList.tutorial_ore = new BlockItem(blocksList.tutorial_ore, new Item.Properties().group(tutorial)).setRegistryName(blocksList.tutorial_ore.getRegistryName())
);
LOGGER.info("Items Registered");
}
@SubscribeEvent
public static void onRegisterBlocks(RegistryEvent.Register<Block> event) {
event.getRegistry().registerAll(
blocksList.tutorial_block = new Block(Block.Properties.create(Material.IRON).hardnessAndResistance(2.0F, 3.0F).lightValue(10).sound(SoundType.METAL)).setRegistryName(location("tutorial_block")),
blocksList.tutorial_ore = new Block(Block.Properties.create(Material.ROCK).hardnessAndResistance(2.0F, 3.0F).lightValue(10).sound(SoundType.METAL)).setRegistryName(location("tutorial_ore"))
);
LOGGER.info("Blocks Registered");
}
public static ResourceLocation location(String name) {
return new ResourceLocation(MODID, name);
}
}
}
Log:
[10jul2020 16:26:15.251] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher running: args [--gameDir, ., --launchTarget, fmluserdevclient, --fml.mcpVersion, 20190829.143755, --fml.mcVersion, 1.14.4, --fml.forgeGroup, net.minecraftforge, --fml.forgeVersion, 28.2.0, --version, MOD_DEV, --assetIndex, 1.14, --assetsDir, C:\Users\ferna\.gradle\caches\forge_gradle\assets, --username, Dev, --accessToken, ❄❄❄❄❄❄❄❄, --userProperties, {}]
[10jul2020 16:26:15.254] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher 4.1.0+62+5bfa59b starting: java version 1.8.0_251 by Oracle Corporation
[10jul2020 16:26:15.760] [main/INFO] [net.minecraftforge.fml.loading.FixSSL/CORE]: Added Lets Encrypt root certificates as additional trust
[10jul2020 16:26:16.663] [main/INFO] [cpw.mods.modlauncher.LaunchServiceHandler/MODLAUNCHER]: Launching target 'fmluserdevclient' with arguments [--version, MOD_DEV, --gameDir, ., --assetsDir, C:\Users\ferna\.gradle\caches\forge_gradle\assets, --assetIndex, 1.14, --username, Dev, --accessToken, ❄❄❄❄❄❄❄❄, --userProperties, {}]
[10jul2020 16:26:18.468] [Client thread/INFO] [net.minecraft.client.Minecraft/]: Setting user: Dev
[10jul2020 16:26:29.512] [Client thread/WARN] [net.minecraft.client.GameSettings/]: Skipping bad option: lastServer:
[10jul2020 16:26:29.534] [Client thread/INFO] [net.minecraft.client.Minecraft/]: LWJGL Version: 3.2.2 build 10
[10jul2020 16:26:30.364] [modloading-worker-9/INFO] [net.minecraftforge.common.ForgeMod/FORGEMOD]: Forge mod loading, version 28.2.0, for MC 1.14.4 with MCP 20190829.143755
[10jul2020 16:26:30.364] [modloading-worker-9/INFO] [net.minecraftforge.common.MinecraftForge/FORGE]: MinecraftForge v28.2.0 Initialized
[10jul2020 16:26:30.366] [modloading-worker-2/ERROR] [net.minecraftforge.fml.javafmlmod.FMLModContainer/LOADING]: Failed to create mod instance. ModID: tutorialmod, class mod.stardev.mod1.tutorialmod
java.lang.NullPointerException: null
at mod.stardev.mod1.world.OreGeneration.setupOreGeneration(OreGeneration.java:16) ~[?:?]
at mod.stardev.mod1.tutorialmod.<init>(tutorialmod.java:29) ~[?:?]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_251]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_251]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_251]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_251]
at java.lang.Class.newInstance(Class.java:442) ~[?:1.8.0_251]
at net.minecraftforge.fml.javafmlmod.FMLModContainer.constructMod(FMLModContainer.java:131) ~[?:28.2]
at java.util.function.Consumer.lambda$andThen$0(Consumer.java:65) ~[?:1.8.0_251]
at java.util.function.Consumer.lambda$andThen$0(Consumer.java:65) ~[?:1.8.0_251]
at net.minecraftforge.fml.ModContainer.transitionState(ModContainer.java:112) ~[?:?]
at net.minecraftforge.fml.ModList.lambda$null$10(ModList.java:134) ~[?:?]
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) [?:1.8.0_251]
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382) [?:1.8.0_251]
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) [?:1.8.0_251]
at java.util.stream.ForEachOps$ForEachTask.compute(ForEachOps.java:291) [?:1.8.0_251]
at java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:731) [?:1.8.0_251]
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) [?:1.8.0_251]
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) [?:1.8.0_251]
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) [?:1.8.0_251]
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157) [?:1.8.0_251]
[10jul2020 16:26:30.511] [Client thread/FATAL] [net.minecraftforge.fml.ModLoader/LOADING]: Failed to complete lifecycle event CONSTRUCT, 1 errors found
[10jul2020 16:26:30.511] [Client thread/FATAL] [net.minecraftforge.eventbus.EventBus/EVENTBUS]: EventBus 0 shutting down - future events will not be posted.
java.lang.Exception: stacktrace
at net.minecraftforge.eventbus.EventBus.shutdown(EventBus.java:278) ~[eventbus-1.0.0-service.jar:?]
at net.minecraftforge.fml.client.ClientModLoader.lambda$createRunnableWithCatch$5(ClientModLoader.java:115) ~[forge-1.14.4-28.2.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?]
at net.minecraftforge.fml.client.ClientModLoader.begin(ClientModLoader.java:97) ~[forge-1.14.4-28.2.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?]
at net.minecraft.client.Minecraft.init(Minecraft.java:457) ~[forge-1.14.4-28.2.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:365) ~[forge-1.14.4-28.2.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?]
at net.minecraft.client.main.Main.main(Main.java:128) ~[forge-1.14.4-28.2.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_251]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_251]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_251]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_251]
at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55) ~[forge-1.14.4-28.2.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?]
at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-4.1.0.jar:?]
at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-4.1.0.jar:?]
at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-4.1.0.jar:?]
at cpw.mods.modlauncher.Launcher.run(Launcher.java:81) [modlauncher-4.1.0.jar:?]
at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) [modlauncher-4.1.0.jar:?]
at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:102) [forge-1.14.4-28.2.0_mapped_snapshot_20190719-1.14.3-recomp.jar:?]
[10jul2020 16:26:33.370] [Client thread/INFO] [com.mojang.text2speech.NarratorWindows/]: Narrator library for x64 successfully loaded
[10jul2020 16:26:33.577] [Server-Worker-1/ERROR] [net.minecraftforge.fml.ModLoader/LOADING]: Skipping lifecycle event SETUP, 1 errors found.
[10jul2020 16:26:33.577] [Server-Worker-1/FATAL] [net.minecraftforge.fml.ModLoader/LOADING]: Failed to complete lifecycle event SETUP, 1 errors found
[10jul2020 16:26:33.577] [Server-Worker-1/FATAL] [net.minecraftforge.eventbus.EventBus/EVENTBUS]: EventBus 0 shutting down - future events will not be posted.
java.lang.Exception: stacktrace
at net.minecraftforge.eventbus.EventBus.shutdown(EventBus.java:278) ~[eventbus-1.0.0-service.jar:?]
at net.minecraftforge.fml.client.ClientModLoader.lambda$createRunnableWithCatch$5(ClientModLoader.java:115) ~[?:?]
at net.minecraftforge.fml.client.ClientModLoader.startModLoading(ClientModLoader.java:123) ~[?:?]
at net.minecraftforge.fml.client.ClientModLoader.lambda$onreload$3(ClientModLoader.java:105) ~[?:?]
at net.minecraftforge.fml.client.ClientModLoader.lambda$createRunnableWithCatch$5(ClientModLoader.java:113) ~[?:?]
at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1640) [?:1.8.0_251]
at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1632) [?:1.8.0_251]
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) [?:1.8.0_251]
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) [?:1.8.0_251]
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) [?:1.8.0_251]
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157) [?:1.8.0_251]
[10jul2020 16:26:33.579] [Thread-1/FATAL] [net.minecraftforge.common.ForgeConfig/CORE]: Forge config just got changed on the file system!
[10jul2020 16:26:36.932] [Server-Worker-7/ERROR] [net.minecraftforge.fml.ModLoader/LOADING]: Skipping lifecycle event ENQUEUE_IMC, 1 errors found.
[10jul2020 16:26:36.948] [Server-Worker-7/FATAL] [net.minecraftforge.fml.ModLoader/LOADING]: Failed to complete lifecycle event ENQUEUE_IMC, 1 errors found
[10jul2020 16:26:36.948] [Server-Worker-7/FATAL] [net.minecraftforge.eventbus.EventBus/EVENTBUS]: EventBus 0 shutting down - future events will not be posted.
java.lang.Exception: stacktrace
at net.minecraftforge.eventbus.EventBus.shutdown(EventBus.java:278) ~[eventbus-1.0.0-service.jar:?]
at net.minecraftforge.fml.client.ClientModLoader.lambda$createRunnableWithCatch$5(ClientModLoader.java:115) ~[?:?]
at net.minecraftforge.fml.client.ClientModLoader.finishModLoading(ClientModLoader.java:136) ~[?:?]
at net.minecraftforge.fml.client.ClientModLoader.lambda$onreload$4(ClientModLoader.java:107) ~[?:?]
at java.util.concurrent.CompletableFuture.uniRun(CompletableFuture.java:719) [?:1.8.0_251]
at java.util.concurrent.CompletableFuture$UniRun.tryFire(CompletableFuture.java:701) [?:1.8.0_251]
at java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:457) [?:1.8.0_251]
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) [?:1.8.0_251]
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) [?:1.8.0_251]
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) [?:1.8.0_251]
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157) [?:1.8.0_251]
[10jul2020 16:26:36.968] [Client thread/WARN] [net.minecraft.client.GameSettings/]: Skipping bad option: lastServer:
[10jul2020 16:26:38.620] [Client thread/INFO] [net.minecraft.client.audio.SoundSystem/]: OpenAL initialized.
[10jul2020 16:26:38.622] [Client thread/INFO] [net.minecraft.client.audio.SoundEngine/SOUNDS]: Sound engine started
[10jul2020 16:26:39.192] [Client thread/INFO] [net.minecraft.client.renderer.texture.AtlasTexture/]: Created: 512x512 textures-atlas
[10jul2020 16:26:39.997] [Client thread/INFO] [net.minecraft.client.renderer.texture.AtlasTexture/]: Created: 256x256 textures/particle-atlas
[10jul2020 16:26:40.013] [Client thread/INFO] [net.minecraft.client.renderer.texture.AtlasTexture/]: Created: 256x256 textures/painting-atlas
[10jul2020 16:26:40.015] [Client thread/INFO] [net.minecraft.client.renderer.texture.AtlasTexture/]: Created: 128x128 textures/mob_effect-atlas