Jump to content

[SOLVED?][1.6.4][Coremod] Need help with error during transformation


Recommended Posts

Posted

I guess I solved the problem, just remove "ClassWriter.COMPUTE_FRAMES" when creating ClassWriter object and the error rooted from that line disappears. There are other problems left but I'll make another post as the cause(s) are quite different from this situation. (I think they are about how Forge load the mod and JAR structure)

 

=========================================

 

Hello, I'm making a coremod that replace current title screen (GuiMainMenu) with my own (GuiCustomMainMenu) by changing a line of code in net.minecraft.client.Minecraft#startNewGame() to my own version.

 

From

  Quote
this.displayGuiScreen(new GuiMainMenu());

To

  Quote
this.displayGuiScreen(new GuiCustomMainMenu());

 

It works fine when I run my coremod in eclipse but there's bunch of errors when running from the game. From the log, it seems that Forge cannot find "Minecraft.class", which are obfuscated to "atv" in 1.6.4. It also says that no class "avc" which actually exist in the game jar file (as of 1.6.4). My error log and transformer class are shown below. Any help is welcome.

Thanks in advance.

 

EDIT: forgot to mention that one of the exception is caused by the line:

  Quote
ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS | ClassWriter.COMPUTE_FRAMES);

 

Error log

 

  Reveal hidden contents

 

 

Transformer class

 

  Reveal hidden contents

 

 

I'm not English speaker, forgive me for any language mistake :)

Posted

The reason why it says the class "avc" or "Minecraft" doesn't exist is simple. It's the fact that something went wrong during the transformation of the class, so the class is improperly loaded. It would help a lot if you managed to get a print of the exception that is caught during the transformation.

 

However, I advise you to not completely replace GuiMainMenu. I'm very sure Forge modifies this part of minecraft, either by doing what you are doing, or it's patching the vanilla class. You should also patch the vanilla class to avoid conflicts. If it turns out to be a forge class, patch that one instead.

Posted

Okay, I've tried printing out stack trace in case that transformation fails and got no more info. I also forgot to mention that one of the exception is caused by the line:

  Quote
ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS | ClassWriter.COMPUTE_FRAMES);

So it should be that no error occurs during transformation.

 

Also, I didn't replace any class. If you read my code, what I've done is method patching (actually just change 1 line of code).

 

Anyway, thanks for your reply

I'm not English speaker, forgive me for any language mistake :)

Posted

You could also use the RenderGameOverlayEvent and then check if it is the GuiMainMenu class and then cancel the rendering and then render your own menu

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Posted

That's an interesting workaround. I'll give it a try! However, I still need some explanations of the error since I'll be using more of method patching to edit some classes.

I'm not English speaker, forgive me for any language mistake :)

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.