Jump to content

Recommended Posts

Posted

Not sure where I'm going wrong here, could someone help me out? I think it has something to do with the registry but I don't know what.

 

Main.java:
 

package com.chromakey.devsdream;

import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.event.server.FMLServerStartingEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

@Mod("devsdream")

public class Main {

    public static final String modid = "devsdream";
    private static final Logger logger = LogManager.getLogger(modid);
    public static Main instance;
    public Main() {
        instance = this;
        FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup);
        FMLJavaModLoadingContext.get().getModEventBus().addListener(this::clientRegistries);
        MinecraftForge.EVENT_BUS.register(this);
    }

    private void setup(final FMLCommonSetupEvent event) {
      logger.info("Common setup complete");
    }

    private void clientRegistries(final FMLClientSetupEvent event) {
      logger.info("Successfully set up clientRegistries");
    }

    @Mod.EventBusSubscriber(bus= Mod.EventBusSubscriber.Bus.MOD)
    public static class events {
      
        @SubscribeEvent
        public static void registerBlocks(final RegistryEvent.Register<Block> event) {
          event.getRegistry().registerAll(
            BlockList.blank_slate_stone = new Block(Block.Properties.create(Material.ROCK).sound(SoundType.STONE)).setRegistryName(new ResourceLocation(modid, "blank_slate_stone"))
          );
          logger.info("Successfully registered blocks");
        }

        @SubscribeEvent
        public static void registerItems(final RegistryEvent.Register<Item> event) {
          event.getRegistry().registerAll(
            ItemList.blank_slate_stone = new BlockItem(BlockList.blank_slate_stone, new Item.Properties().maxStackSize(64)).setRegistryName(new ResourceLocation(modid, "blank_slate_stone"))
          );
          logger.info("Successfully registered items");
        }

        @SubscribeEvent
        public static void onServerStart(final FMLServerStartingEvent event) {
          logger.info("Successfully set up server start");
          event.getCommandDispatcher();
        }
    }
}

Log:
 

[26Jun2020 11:33:43.506] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher running: args [--gameDir, ., --launchTarget, fmluserdevclient, --fml.mcpVersion, 20200625.160719, --fml.mcVersion, 1.16.1, --fml.forgeGroup, net.minecraftforge, --fml.forgeVersion, 32.0.16, --version, MOD_DEV, --assetIndex, 1.16, --assetsDir, C:\Users\willi\.gradle\caches\forge_gradle\assets, --username, Dev, --accessToken, ????????, --userProperties, {}]
[26Jun2020 11:33:43.518] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher 5.1.0+69+master.79f13f7 starting: java version 14.0.1 by AdoptOpenJDK
[26Jun2020 11:33:44.225] [main/INFO] [net.minecraftforge.fml.loading.FixSSL/CORE]: Added Lets Encrypt root certificates as additional trust
[26Jun2020 11:33:46.301] [main/INFO] [STDERR/]: [jdk.nashorn.api.scripting.NashornScriptEngine:<init>:143]: Warning: Nashorn engine is planned to be removed from a future JDK release
[26Jun2020 11:33:47.416] [main/INFO] [cpw.mods.modlauncher.LaunchServiceHandler/MODLAUNCHER]: Launching target 'fmluserdevclient' with arguments [--version, MOD_DEV, --gameDir, ., --assetsDir, C:\Users\willi\.gradle\caches\forge_gradle\assets, --assetIndex, 1.16, --username, Dev, --accessToken, ????????, --userProperties, {}]
[26Jun2020 11:33:58.103] [pool-3-thread-1/FATAL] [net.minecraftforge.common.asm.RuntimeEnumExtender/]: Enum has create method with no matching constructor:
  Enum: Lnet/minecraft/entity/EntityClassification;
  Candidate: (Ljava/lang/String;Ljava/lang/String;IZZ)Lnet/minecraft/entity/EntityClassification;
  Target: (Ljava/lang/String;ILjava/lang/String;IZZ)V
        : (Ljava/lang/String;ILjava/lang/String;IZZI)V

[26Jun2020 11:33:59.708] [Render thread/INFO] [com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService/]: Environment: authHost='https://authserver.mojang.com', accountsHost='https://api.mojang.com', sessionHost='https://sessionserver.mojang.com', name='PROD'
[26Jun2020 11:33:59.716] [Render thread/INFO] [net.minecraft.client.Minecraft/]: Setting user: Dev
[26Jun2020 11:34:02.612] [Render thread/INFO] [STDOUT/]: [net.minecraft.util.registry.Bootstrap:printToSYSOUT:127]: ---- Minecraft Crash Report ----
// Why did you do that?

Time: 6/26/20, 11:34 AM
Description: Initializing game

java.lang.NoClassDefFoundError: Could not initialize class net.minecraft.util.registry.Registry
	at net.minecraft.item.ItemStack.lambda$static$3(ItemStack.java:77) ~[forge-1.16.1-32.0.16_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading}
	at com.mojang.serialization.codecs.RecordCodecBuilder.create(RecordCodecBuilder.java:72) ~[datafixerupper-3.0.25.jar:?] {}
	at net.minecraft.item.ItemStack.<clinit>(ItemStack.java:76) ~[forge-1.16.1-32.0.16_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading}
	at net.minecraft.client.settings.HotbarSnapshot.<init>(HotbarSnapshot.java:15) ~[forge-1.16.1-32.0.16_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.settings.CreativeSettings.<init>(CreativeSettings.java:28) ~[forge-1.16.1-32.0.16_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.Minecraft.<init>(Minecraft.java:400) ~[forge-1.16.1-32.0.16_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.client.main.Main.main(Main.java:149) ~[forge-1.16.1-32.0.16_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {}
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?] {}
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {}
	at java.lang.reflect.Method.invoke(Method.java:564) ~[?:?] {}
	at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55) ~[forge-1.16.1-32.0.16_mapped_snapshot_20200514-1.16-recomp.jar:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-5.1.0.jar:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-5.1.0.jar:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-5.1.0.jar:?] {}
	at cpw.mods.modlauncher.Launcher.run(Launcher.java:81) [modlauncher-5.1.0.jar:?] {}
	at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) [modlauncher-5.1.0.jar:?] {}
	at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:105) [forge-1.16.1-32.0.16_mapped_snapshot_20200514-1.16-recomp.jar:?] {}


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Thread: Render thread
Stacktrace:
	at net.minecraft.item.ItemStack.lambda$static$3(ItemStack.java:77)
	at com.mojang.serialization.codecs.RecordCodecBuilder.create(RecordCodecBuilder.java:72)
	at net.minecraft.item.ItemStack.<clinit>(ItemStack.java:76)
	at net.minecraft.client.settings.HotbarSnapshot.<init>(HotbarSnapshot.java:15)
	at net.minecraft.client.settings.CreativeSettings.<init>(CreativeSettings.java:28)
	at net.minecraft.client.Minecraft.<init>(Minecraft.java:400)

-- Initialization --
Details:
Stacktrace:
	at net.minecraft.client.main.Main.main(Main.java:149)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55)
	at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37)
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54)
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72)
	at cpw.mods.modlauncher.Launcher.run(Launcher.java:81)
	at cpw.mods.modlauncher.Launcher.main(Launcher.java:65)
	at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:105)

-- System Details --
Details:
	Minecraft Version: 1.16.1
	Minecraft Version ID: 1.16.1
	Operating System: Windows 10 (amd64) version 10.0
	Java Version: 14.0.1, AdoptOpenJDK
	Java VM Version: OpenJDK 64-Bit Server VM (mixed mode, sharing), AdoptOpenJDK
	Memory: 174375336 bytes (166 MB) / 315621376 bytes (301 MB) up to 3158310912 bytes (3012 MB)
	CPUs: 8
	JVM Flags: 1 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump
	Launched Version: MOD_DEV
	Backend library: LWJGL version 3.2.2 build 10
	Backend API: NO CONTEXT
	GL Caps: 
	Using VBOs: Yes
	Is Modded: Definitely; Client brand changed to 'forge'
	Type: Client (map_client.txt)
	CPU: <unknown>
[26Jun2020 11:34:02.643] [Render thread/INFO] [STDOUT/]: [net.minecraft.util.registry.Bootstrap:printToSYSOUT:127]: #@!@# Game crashed! Crash report saved to: #@!@# C:\Users\willi\Downloads\forge-1.16.1-32.0.16-mdk\run\.\crash-reports\crash-2020-06-26_11.34.02-client.txt

Crash report:
 

---- Minecraft Crash Report ----
// Uh... Did I do that?

Time: 6/26/20, 11:34 AM
Description: Initializing game

java.lang.NoClassDefFoundError: Could not initialize class net.minecraft.util.registry.Registry
	at net.minecraft.item.ItemStack.lambda$static$3(ItemStack.java:77) ~[forge-1.16.1-32.0.16_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading}
	at com.mojang.serialization.codecs.RecordCodecBuilder.create(RecordCodecBuilder.java:72) ~[datafixerupper-3.0.25.jar:?] {}
	at net.minecraft.item.ItemStack.<clinit>(ItemStack.java:76) ~[forge-1.16.1-32.0.16_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading}
	at net.minecraft.client.settings.HotbarSnapshot.<init>(HotbarSnapshot.java:15) ~[forge-1.16.1-32.0.16_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.settings.CreativeSettings.<init>(CreativeSettings.java:28) ~[forge-1.16.1-32.0.16_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.Minecraft.<init>(Minecraft.java:400) ~[forge-1.16.1-32.0.16_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.client.main.Main.main(Main.java:149) ~[forge-1.16.1-32.0.16_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {}
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?] {}
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {}
	at java.lang.reflect.Method.invoke(Method.java:564) ~[?:?] {}
	at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55) ~[forge-1.16.1-32.0.16_mapped_snapshot_20200514-1.16-recomp.jar:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-5.1.0.jar:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-5.1.0.jar:?] {}
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-5.1.0.jar:?] {}
	at cpw.mods.modlauncher.Launcher.run(Launcher.java:81) [modlauncher-5.1.0.jar:?] {}
	at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) [modlauncher-5.1.0.jar:?] {}
	at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:105) [forge-1.16.1-32.0.16_mapped_snapshot_20200514-1.16-recomp.jar:?] {}


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Thread: Render thread
Stacktrace:
	at net.minecraft.item.ItemStack.lambda$static$3(ItemStack.java:77)
	at com.mojang.serialization.codecs.RecordCodecBuilder.create(RecordCodecBuilder.java:72)
	at net.minecraft.item.ItemStack.<clinit>(ItemStack.java:76)
	at net.minecraft.client.settings.HotbarSnapshot.<init>(HotbarSnapshot.java:15)
	at net.minecraft.client.settings.CreativeSettings.<init>(CreativeSettings.java:28)
	at net.minecraft.client.Minecraft.<init>(Minecraft.java:400)

-- Initialization --
Details:
Stacktrace:
	at net.minecraft.client.main.Main.main(Main.java:149)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55)
	at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37)
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54)
	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72)
	at cpw.mods.modlauncher.Launcher.run(Launcher.java:81)
	at cpw.mods.modlauncher.Launcher.main(Launcher.java:65)
	at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:105)

-- System Details --
Details:
	Minecraft Version: 1.16.1
	Minecraft Version ID: 1.16.1
	Operating System: Windows 10 (amd64) version 10.0
	Java Version: 14.0.1, AdoptOpenJDK
	Java VM Version: OpenJDK 64-Bit Server VM (mixed mode, sharing), AdoptOpenJDK
	Memory: 174375336 bytes (166 MB) / 315621376 bytes (301 MB) up to 3158310912 bytes (3012 MB)
	CPUs: 8
	JVM Flags: 1 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump
	Launched Version: MOD_DEV
	Backend library: LWJGL version 3.2.2 build 10
	Backend API: NO CONTEXT
	GL Caps: 
	Using VBOs: Yes
	Is Modded: Definitely; Client brand changed to 'forge'
	Type: Client (map_client.txt)
	CPU: <unknown>

 

Posted
  On 6/26/2020 at 3:37 PM, ChromaKey81 said:

java.lang.NoClassDefFoundError: Could not initialize class net.minecraft.util.registry.Registry at net.minecraft.item.ItemStack.lambda$static$3(ItemStack.java:77) ~[forge-1.16.1-32.0.16_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading} at com.mojang.serialization.codecs.RecordCodecBuilder.create(RecordCodecBuilder.java:72) ~[datafixerupper-3.0.25.jar:?] {}

Expand  

Learn to lead your error logs. I have highlighted the class, method, and line where the error occurred.

You have not shown this code.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

I think my error might be caused by forge 1.16.1 simply not working, I've seen similar reports about the net.minecraft.util.registry.Registry not initializing on this version. I'll switch over to 1.15.2 and see what happens.

Posted
  On 6/26/2020 at 3:52 PM, Draco18s said:

com.mojang.serialization.codecs.RecordCodecBuilder.create(RecordCodecBuilder.java:72)

Expand  

 

  On 6/26/2020 at 3:37 PM, ChromaKey81 said:

at com.mojang.serialization.codecs.RecordCodecBuilder.create(RecordCodecBuilder.java:72) ~[datafixerupper-3.0.25.jar:?] {}

at net.minecraft.item.ItemStack.<clinit>(ItemStack.java:76) ~[forge-1.16.1-32.0.16_mapped_snapshot_20200514-1.16-recomp.jar:?] {re:classloading}

Expand  

Looking at the crash logs more carefully, it really doesn't seem that @ChromaKey81's code is at fault here.

Posted (edited)
  On 6/26/2020 at 4:02 PM, ChromaKey81 said:

I think my error might be caused by forge 1.16.1 simply not working, I've seen similar reports about the net.minecraft.util.registry.Registry not initializing on this version. I'll switch over to 1.15.2 and see what happens.

Expand  

Just switched to the latest Forge version for 1.15.2 and I'm not getting a crash anymore. Now I'm getting a build error described at https://forums.minecraftforge.net/topic/87410-need-help-with-the-modstoml-file/

Edited by ChromaKey81
Posted
  On 6/26/2020 at 4:27 PM, sciwhiz12 said:

 

Looking at the crash logs more carefully, it really doesn't seem that @ChromaKey81's code is at fault here.

Expand  

Oops, you're right. 

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.