Jump to content

Recommended Posts

Posted (edited)

I am updating my mod from 1.7.10 --> 1.12 and I am getting an error in my Item registry class. I could not find the error on the common problems list, but sorry if it is a common error. The error is:

net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from Prehistoric Eclipse (prehistoriceclipse)
Caused by: java.lang.IncompatibleClassChangeError: com.geometrically.prehistoricEclipse.items.PEItems and com.geometrically.prehistoricEclipse.items.PEItems$RegistrationHandler disagree on InnerClasses attribute
Full Crash log:

---- Minecraft Crash Report ----
// This is a token for 1 free hug. Redeem at your nearest Mojangsta: [~~HUG~~]

Time: 2/28/18 8:57 PM
Description: There was a severe problem during mod loading that has caused the game to fail

net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from Prehistoric Eclipse (prehistoriceclipse)
Caused by: java.lang.IncompatibleClassChangeError: com.geometrically.prehistoricEclipse.items.PEItems and com.geometrically.prehistoricEclipse.items.PEItems$RegistrationHandler disagree on InnerClasses attribute
	at java.lang.Class.getDeclaringClass0(Native Method)
	at java.lang.Class.getDeclaringClass(Class.java:1235)
	at java.lang.Class.getEnclosingClass(Class.java:1277)
	at java.lang.Class.getSimpleBinaryName(Class.java:1443)
	at java.lang.Class.getSimpleName(Class.java:1309)
	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.getUniqueName(ASMEventHandler.java:174)
	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.createWrapper(ASMEventHandler.java:114)
	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.<init>(ASMEventHandler.java:63)
	at net.minecraftforge.fml.common.eventhandler.EventBus.register(EventBus.java:130)
	at net.minecraftforge.fml.common.eventhandler.EventBus.register(EventBus.java:111)
	at net.minecraftforge.fml.common.AutomaticEventSubscriber.inject(AutomaticEventSubscriber.java:82)
	at net.minecraftforge.fml.common.FMLModContainer.constructMod(FMLModContainer.java:594)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91)
	at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)
	at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)
	at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)
	at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71)
	at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116)
	at com.google.common.eventbus.EventBus.post(EventBus.java:217)
	at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:252)
	at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:230)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91)
	at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)
	at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)
	at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)
	at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71)
	at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116)
	at com.google.common.eventbus.EventBus.post(EventBus.java:217)
	at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:147)
	at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:570)
	at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:227)
	at net.minecraft.client.Minecraft.init(Minecraft.java:508)
	at net.minecraft.client.Minecraft.run(Minecraft.java:416)
	at net.minecraft.client.main.Main.main(Main.java:118)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
	at GradleStart.main(GradleStart.java:26)


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

-- System Details --
Details:
	Minecraft Version: 1.12
	Operating System: Windows 10 (amd64) version 10.0
	Java Version: 1.8.0_121, Oracle Corporation
	Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
	Memory: 195571392 bytes (186 MB) / 591921152 bytes (564 MB) up to 1860698112 bytes (1774 MB)
	JVM Flags: 0 total; 
	IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
	FML: MCP 9.40 Powered by Forge 14.21.1.2443 6 mods loaded, 6 mods active
	States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
	UC	minecraft{1.12} [Minecraft] (minecraft.jar) 
	UC	mcp{9.19} [Minecraft Coder Pack] (minecraft.jar) 
	UC	FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.12-14.21.1.2443.jar) 
	UC	forge{14.21.1.2443} [Minecraft Forge] (forgeSrc-1.12-14.21.1.2443.jar) 
	UE	prehistoriceclipse{beta 3 :D} [Prehistoric Eclipse] (Prehistoric Eclipse 1.12) 
	UC	obsidian_api{1.0.0} [Obsidian API] (ObsidianAPI-1.0.0-deobf.jar) 
	Loaded coremods (and transformers): 
	GL info: ' Vendor: 'Intel' Version: '4.3.0 - Build 20.19.15.4474' Renderer: 'Intel(R) HD Graphics 4600'

PEItems.java:

public class PEItems {
 //   public static ItemArmor.ArmorMaterial monoArmour = EnumHelper.addArmorMaterial("monoArmour", 1000, new int[]{3,8,6,4}, 30);
    //Items
    public static Item dakoClaw;
    public static Item dakoFeather;
    public static Item dakoMeat;
    public static Item dakoBeef;
    public static Item dakoSkull;
    public static Item hunterBow;
    public static Item dakoArrow;

    public static Item monoHelmet;
    public static Item monoChestplate;
    public static Item monoLeggings;
    public static Item monoBoots;

    public static void init(){

        dakoClaw = new ItemDakotaraptorClaw();
        dakoFeather = new ItemDakotaraptorFeather();
        dakoMeat = new ItemDakotaraptorMeat();
        dakoBeef = new ItemDakotaraptorMeatCooked();
        dakoSkull = new ItemDakotaraptorSkull();
        hunterBow = new ItemHunterBow();
        dakoArrow = new ItemDakotaraptorArrow();

       /* monoHelmet = new ItemMonolophosaurusArmor(monoArmour, 0, 0, "MonolophosaurusHelmet", "prehistoriceclipse:monolophosaurus_helmet");
        monoChestplate = new ItemMonolophosaurusArmor(monoArmour, 0, 1, "MonolophosaurusChestplate", "prehistoriceclipse:monolophosaurus_chestplate");
        monoLeggings = new ItemMonolophosaurusArmor(monoArmour, 0, 2, "MonolophosaurusLeggings", "prehistoriceclipse:monolophosaurus_leggings");
        monoBoots = new ItemMonolophosaurusArmor(monoArmour, 0, 3, "MonolophosaurusBoots", "prehistoriceclipse:monolophosaurus_boots");
        registerItemRecipes();*/
    }
    public static void registerItemRecipes(){
        //Smelting
     /*   GameRegistry.addSmelting(dakoMeat, new ItemStack(dakoBeef), 0.35F);
        //Crafting
        GameRegistry.addShapedRecipe(new ItemStack(dakoArrow), " L ", " S ", " F ", 'F', dakoFeather, 'S', Items.STICK, 'L', Items.flint);
        GameRegistry.addShapedRecipe(new ItemStack(hunterBow), " SV", "B V", " SV", 'V', Blocks.VINE, 'S', Items.STICK, 'B', Items.BONE);*/
    }
   public static void registerRenders(){
      registerRender(dakoClaw);
      registerRender(dakoMeat);
      registerRender(dakoFeather);
      registerRender(dakoBeef);
      registerRender(dakoSkull);
      registerRender(hunterBow);
      registerRender(dakoArrow);

      registerRender(monoHelmet);
      registerRender(monoChestplate);
      registerRender(monoLeggings);
      registerRender(monoBoots);
   }
   public static void register(){
      registerItem(dakoClaw);
      registerItem(dakoMeat);
      registerItem(dakoFeather);
      registerItem(dakoBeef);
      registerItem(dakoSkull);
      registerItem(hunterBow);
      registerItem(dakoArrow);

      registerItem(monoHelmet);
      registerItem(monoChestplate);
      registerItem(monoLeggings);
      registerItem(monoBoots);
   }
   private static void registerItem(Item item){
       ForgeRegistries.ITEMS.register(item);
   }
   private static void registerRender(Item item)
   {
      ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation( "prehistoriceclipse:" + item.getUnlocalizedName().substring(5), "inventory"));
   }
}

What's the problem? Thanks for helping!

Edited by Geometrically
Posted
33 minutes ago, Geometrically said:

private static void registerRender(Item item) {
    ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation( "prehistoriceclipse:" + item.getUnlocalizedName().substring(5), "inventory"));
}

 

I can tell you that this code cannot be here. ModelLoader is client-side only.

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 (edited)

Do not use ForgeRegistries for registration. It is only for iterating over.

Forge freezes the BLOCK & ITEM registries during the life-cycle, meaning you cannot edit them after the life-cycle reaches that point.
Use the Register<IForgeRegistryEntry> Events instead. It was made specifically to register these objects.

 

Never use the unlocalized name for anything other than localizing it. It has nothing to do with what the item is.
Use IForgeRegistryEntry::getRegistryName. It has already been formatted to modid:name for you, no need for manually concatenating the modid, nor using the whole substring mess.

Edited by Matryoshika

Also previously known as eAndPi.

"Pi, is there a station coming up where we can board your train of thought?" -Kronnn

Published Mods: Underworld

Handy links: Vic_'s Forge events Own WIP Tutorials.

Posted (edited)

I believe there is a ghost class that isn't shown in the files or the IDE but is still there. I tried deleting the class and it still crashed with the same exact error. How would I fix that?

 

Fixed the crash:

There was a remaining file in the out.production folder. Deleting the project stuff in it fixed the problem with the ghost file. Thanks and I will use the suggestions.

Edited by Geometrically

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.