Jump to content

Recommended Posts

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.

Posted

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

Posted

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.

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.