Jump to content

[1.10.2] | setSoundType() access


valentin4311

Recommended Posts

[/embed]

  • Hello everyone,
     
    So here is my problem I'm trying to update my mod to 1.10.2 however I'm stuck with <block>.setSoundType which is protected.
     
    I searched on internet to find any answer and I found Reflection and Access Transformer. I don't want to create a new class for each block so what should I use ?
    • I tried to use Access Transformers but I failed to and I didn't find any examples  :-\
    • I don't know much things on reflection and I don't know if I can use it and keep this style : Block myBlock = new Block(...).setSoundType(...)

 

Here is what I tried with Access transformers by following Forge Wiki (Which is for 1.7.10)

 

 

 

I created a file named candycraftmod_at.cfg in project root folder

I changed build.gradle and added these following lines at the end

jar
{
    manifest
{
       attributes 'FMLAT': 'candycraftmod_at.cfg'
}
}

I relaunched gradlew setupDecompWorkspace

 

-> Not Working, still protected

 

 

 

What do you suggest ?  ???

 

Thanks in advance

(Sorry if my english is not perfect :P)

Link to comment
Share on other sites

Then just utilize your own blocks to handle that.(Single class would be sufficient)

Simplest way would be override the setSoundType method with public, but it's definitely unclean way.

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

Link to comment
Share on other sites

Yeah I considered doing that. However I don't know why setSoundType is the only protected method that doesn't have an access modifier in merged_at.cfg.

Like in 1.7.10 or 1.8 (Don't remember which one exactly) setStepSound has been patched to public.

 

So should I consider this is going to be patched or this is not a bug and I should do as you said ?

 

Link to comment
Share on other sites

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.