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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • You will find the crash-report or log in your minecraft directory (crash-report or logs folder)
    • Use a modpack which is using these 2 mods as working base:   https://www.curseforge.com/minecraft/modpacks/life-in-the-village-3
    • inicie un mundo donde instale Croptopia y Farmer's Delight, entonces instale el addon Croptopia Delight pero no funciona. es la version 1.18.2
    • Hello all. I'm currently grappling with the updateShape method in a custom class extending Block.  My code currently looks like this: The conditionals in CheckState are there to switch blockstate properties, which is working fine, as it functions correctly every time in getStateForPlacement.  The problem I'm running into is that when I update a state, the blocks seem to call CheckState with the position of the block which was changed updated last.  If I build a wall I can see the same change propagate across. My question thus is this: is updateShape sending its return to the neighbouring block?  Is each block not independently executing the updateShape method, thus inserting its own current position?  The first statement appears to be true, and the second false (each block is not independently executing the method). I have tried to fix this by saving the block's own position to a variable myPos at inception, and then feeding this in as CheckState(myPos) but this causes a worse outcome, where all blocks take the update of the first modified block, rather than just their neighbour.  This raises more questions than it answers, obviously: how is a different instance's variable propagating here?  I also tried changing it so that CheckState did not take a BlockPos, but had myPos built into the body - same problem. I have previously looked at neighbourUpdate and onNeighbourUpdate, but could not find a way to get this to work at all.  One post on here about updatePostPlacement and other methods has proven itself long superceded.  All other sources on the net seem to be out of date. Many thanks in advance for any help you might offer me, it's been several days now of trying to get this work and several weeks of generally trying to get round this roadblock.  - Sandermall
    • sorry, I might be stupid, but how do I open it? because the only options I have are too X out, copy it, which doesn't work and send crash report, which doesn't show it to me, also, sorry for taking so long.
  • Topics

×
×
  • Create New...

Important Information

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