Posted May 8, 201510 yr I'm wanting to create a custom WorldType (similar to BOP), but the WorldType class has only private constructors. What's the best way to get around this -- using Access Transformation, or Reflection? I've looked at BOP, and it seems to be using Access Transformation since the WorldType class has public constructors there. I understand how to use reflection for normal fields and methods, but I'm wondering how it could be used for a constructor since the super() call has to be the first line in the subclass's constructor. Thanks for your assistance! The best protection for all you meat-related data.
May 8, 201510 yr If you scroll to the Forge section in WorldType , you see Forge adds a constructor that only takes the name of the WorldType . You can use that. 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/
May 8, 201510 yr One question - why the heck do you need those constructors? Those 2 constructoors are internal ones that should NOT be touched. Only one you should be overriding is: /** * Creates a new world type, the ID is hidden and should not be referenced by modders. * It will automatically expand the underlying workdType array if there are no IDs left. * @param name */ public WorldType(String name) { this(getNextID(), name); } Edit: I didn't notice previous post ;o 1.7.10 is no longer supported by forge, you are on your own.
May 9, 201510 yr Author Thanks all. I didn't see that constructor because it was added by forge and "under the line" (i.e. at the bottom below the separator comment). I'm used to constructors being at the top of a class by convention, so I didn't look down there. I agree that is the one to use, now that I know it's there. The best protection for all you meat-related data.
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.