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

My mod in 1.2.5 extended the WorldType class just fine but now as I am trying to update to 1.3.1 I can't extend because WorldType is private.

 

1.3.1

private WorldType(int par1, String par2Str)
    {
        this(par1, par2Str, 0);
    }

    private WorldType(int par1, String par2Str, int par3)
    {

 

1.2.5

protected WorldType(int par1, String par2Str)
    {
        this(par1, par2Str, 0);
    }

    protected WorldType(int par1, String par2Str, int par3)
    {

 

Am I missing something or have I made nooby mistake? I can fix this by changing WorldType 1.3 to protected but its not an ideal fix. Any help would be appreciated.

  • Author

Reflection can always bypass private modifiers.

Hmm i'm not too sure how to use reflection. Could you please explain how i'd use it in my situation? (Please excuse the nooby response, i'm not as nooby as I come off as.)

The Minecraft.java api has helpers for it, look at those.  :)

 

Basically you can bypass the access restriction and get a direct pointer, then manipulate it as you wish.

 

You would need to use 'some' protected/public constructor though.

  • Author

Ahh I kinda see now, thanks. Forge would help a lot if it changed it from private to protected when it patched it (hint hint).

*nod of agreement*

If the method was protected, then it would be possible to add worldtypes.

width=300 height=100http://i.imgur.com/ivK3J.png[/img]

I'm a little surprised that I am still ranked as a "Forge Modder," having not posted a single mod since my animals mod... I have to complete Digging Deeper!, fast!

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.