Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

[/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)

But if you do something like:

 

public MyBlock(Material materialIn, String name) {
	super(materialIn, name);
	this.setSoundType(SoundType.CLOTH);

}

 

It works. Even been protected.

  • Author

I agree with you, the problem is that I have a lot of blocks and I don't think It's a good Idea to add more classes just to have a constructor with one method in it. (And by the way having to use more parameters in this constructor)

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.

  • Author

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 ?

 

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.