Jump to content

Updating a Mod - How to do it correctly?


Mister__Magister

Recommended Posts

(Almost) every method that took 3 integers takes an instance of BlockPos. IBlockAccess#getBlock is now IBlockAcces#getBlockState, which should call most methods on that you previously called on the Block instance.

  • Like 1

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/

Link to comment
Share on other sites

Thanks for your reply, larsgerrits!

 

While that is indeed very helpful, there are also many other errors, other than just BlockPos. How do I find out what the solutions to those are? Even more interesting to me is how you found out that every method that took 3 integers takes an instance of BlockPos. If I find out how you found it, I can do it for all future mod updates, as well as the other errors in this version.

Link to comment
Share on other sites

Whenever something changes, you should go look at how something in vanilla which does it a lot like yours, and looking at which what the methods changed into.

 

For example, if you went and looked into the fence code, you can see how it detect blocks around them for its connections. This is when you see it now uses IBlockAccess#getBlockState with a BlockPos argument, instead of IBlockAccess#getBlock with 3 integers.

 

Also, learn how to use your IDE. For example, every 3 integer parameter were changed into a BlockPos parameter, you can use your IDE to override those methods, and it will automatically insert the correct method signature for you. And you can use your IDE for more stuff which will help you update.

 

The more updates you go through, the better you'll get at finding how to update your code, and combining that with asking questions on this forum, will get you a long way.

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/

Link to comment
Share on other sites

First: When overriding any method, always use an @Override annotation so later version changes will flag mismatches. If you haven't already invested heavily in your update to this ancient code, then you should go back to the original and annotate every override. Then update the annotated code instead.

 

Also: Definitely learn how to get the most mileage out of your "editor" (IDE = Integrated Development Environment, which is editor + precompiler + compiler + linker + debugger). For instance, in Eclipse for Java, you should be able to highlight any identifier (class, method or object) and right-click for a context menu of things you can do to learn more. In this way, you can teleport throughout the Forge version of the Minecraft code learning what these methods need.

 

 

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

Link to comment
Share on other sites

23 hours ago, Mister__Magister said:

Here's an example of two lines of code that are showing up as red:

How do I find what the problem here is?

 

The problem there is that block and metadata information is now encapsulated inside an IBlockState object.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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.