Jump to content

Recommended Posts

Posted

In an attempt to make a better looking world, I have taken unto myself the task of overriding the lightmap that is coded into the game. However, this seems more difficult than I initially believed. My biggest problem is that I just don't know where to initialize my class without Minecraft not being able to find it. I am currently initializing it in my Client Proxy, but when I run it it is unable to find the enableLightMap() method for some reason. 

 

  Reveal hidden contents

Any help whatsoever would be appreciated. I've scoured the web for answers but to no avail.

Help me Forge Forums, you are my only hope!

Posted

There was a thread in 2013 about resizing the lightmap to make colored light. Maybe that can help you: 

Also, you probably have to pass in an instance of the EntityRender to ReflectionHelper#findMethod. The EntityRenderer instance is located in Minecraft#entityRenderer.

 

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
  On 6/15/2017 at 5:25 PM, larsgerrits said:

There was a thread in 2013 about resizing the lightmap to make colored light. Maybe that can help you: 

Also, you probably have to pass in an instance of the EntityRender to ReflectionHelper#findMethod. The EntityRenderer instance is located in Minecraft#entityRenderer.

 

Expand  

Thanks for the link. However, since very little about the problem I'm having is explained, which is why I passed it the first time I saw it, I have to keep looking. Adding in the entityRenderer instance will help later, but for some reason it still can't find the method.

This crash report may or may not help.

Thanks for helping larsgerrits. I didn't expect to get a reply so fast!

  Reveal hidden contents

 

Posted
  On 6/15/2017 at 5:43 PM, CommanderNeville said:

Caused by: java.lang.NoSuchMethodException: net.minecraft.client.renderer.EntityRenderer.field_110922_T()

Expand  

The error has a SRG name, and you asked about a deobfuscated method name. Is there some deobfuscation/reobfuscation mismatching going on? How and where are you running your mod? Did you compile your mod by  running gradlew build, or did you export your mod using Eclipse?

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

Posted
  On 6/15/2017 at 7:10 PM, jeffryfisher said:

The error has a SRG name, and you asked about a deobfuscated method name. Is there some deobfuscation/reobfuscation mismatching going on? How and where are you running your mod? Did you compile your mod by  running gradlew build, or did you export your mod using Eclipse?

Expand  

The mod has not yet been exported and is running in gradlew build. The reason for the SRG name is that I read somewhere that in order to properly register the method you needed both the SRG and the method name.

Just to make sure I'm not doing something stupid, the method should be registered in the Client Proxy, right?

Posted
  On 6/15/2017 at 5:43 PM, CommanderNeville said:

Caused by: java.lang.NoSuchMethodException: net.minecraft.client.renderer.EntityRenderer.field_110922_T()
    at java.lang.Class.getDeclaredMethod(Unknown Source) ~[?:1.8.0_121]
    at net.minecraftforge.fml.relauncher.ReflectionHelper.findMethod(ReflectionHelper.java:180) ~[forgeSrc-1.10.2-12.18.3.2316.jar:?]
    at com.commander.mgln.entity.ModLightMap.<clinit>(ModLightMap.java:21) ~[ModLightMap.class:?]

Expand  

 

The error says you're asking for a method named field_110922_T, but the code you posted doesn't use this name. Did an old version of your code use this name?

 

Try rebuilding the mod in your IDE to ensure it's using the latest version.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted
  On 6/16/2017 at 6:26 AM, Choonster said:

 

The error says you're asking for a method named field_110922_T, but the code you posted doesn't use this name. Did an old version of your code use this name?

 

Try rebuilding the mod in your IDE to ensure it's using the latest version.

Expand  

Sorry about that. I realized a mistake I made and switched the method name but forgot to update the original post. The actual name is "func_180436_i". Upon replacing the incorrect field name (How did I miss that?) it comes through with the same error. I've checked in two places for the correct name of the method (SRG) and come through with the same function name. Right now I'm working on rebuilding my IDE.

 

Thank you Choonster, jeffryfisher, and larsgerrits for the help so far!

Posted

Please post the latest version of your code and the latest FML log (logs/fml-client-latest.log in the game directory).

 

It's not the direct cause of the error, but you're passing a ResourceLocation to EntityRenderer#enableLightmap (when you invoke it via the Method) even though the method doesn't have any parameters. EntityRenderer#enableLightmap is also a public method, so there's no need to invoke it via reflection.

 

When you do use reflection, mark the field containing the Field/Method object as final.

  • Like 2

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted

Okay, sorry about the delay, but in response to your post I have reworked a few things to reflect some research I've done. Instead of reflecting it (as it is public) I've simply overridden EntityRenderer#enableLightmap. Whether or not this works I have been unable to ascertain due to my ignorance of how to register this class. A crash report is not included as I haven't dared to mess with registering it yet. Again, thank you for all the help.

  Reveal hidden contents
  On 6/16/2017 at 12:04 PM, Choonster said:

Please post the latest version of your code and the latest FML log (logs/fml-client-latest.log in the game directory).

 

It's not the direct cause of the error, but you're passing a ResourceLocation to EntityRenderer#enableLightmap (when you invoke it via the Method) even though the method doesn't have any parameters. EntityRenderer#enableLightmap is also a public method, so there's no need to invoke it via reflection.

 

When you do use reflection, mark the field containing the Field/Method object as final.

Expand  

 

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.