Jump to content

Recommended Posts

Posted (edited)

To give you all some context, I'm just a beginner to the Forge Modding API and I'm also new to the Gradle build management tool (I'm used to Maven).

 

A lot examples online refer to the IBlockState interface, but the 'net.minecraft.block.state' doesn't seem to exist in my project's dependencies. Also do people just override the deprecated methods from the Block class (i.e. getRenderType, getShape, getCollisionShape ...) or what?

 

I'm using the latest version of forge for minecraft 1.15.2 - 31.1.27. The reason I'm not using the recommended version (31.1.0) is because when I import the build.gradle file I get this error message:

  Quote

Could not find net.minecraftforge:forge:1.15.2-31.1.0_mapped_snapshot_20190719-1.14.3.

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
 

Expand  

I also attached a screenshot of my code just in case.

Evan Greenstein

 

 

Screen Shot 2020-03-20 at 10.59.33 PM.png

Edited by Rezanance
Forgot to mention version of forge being used
Posted

If you must follow a tutorial, please follow McJTY's tutorial as it is the least terrible one currently.

This is my Forum Signature, I am currently attempting to transform it into a small guide for fixing easier issues using spoiler blocks to keep things tidy.

 

As the most common issue I feel I should put this outside the main bulk:

The only official source for Forge is https://files.minecraftforge.net, and the only site I trust for getting mods is CurseForge.

If you use any site other than these, please take a look at the StopModReposts project and install their browser extension, I would also advise running a virus scan.

 

For players asking for assistance with Forge please expand the spoiler below and read the appropriate section(s) in its/their entirety.

  Reveal hidden contents

 

Posted

Please recognize what version of Minecraft you are using before asking about a class. Some classes have been removed, others have been redone, and finally (in your case) some classes have been renamed. The easiest thing to do would've been to open up a source version with IBlockState (e.g. 1.12.2) and then looked at your current version (1.15.2) and then finding what has changed. In this case, a quick look would have told you IBlockState was renamed to BlockState.

 

Second, the Block class methods are usually deprecated since they only check for that specific block. The BlockState class has the same methods without deprecation since they can check for multiple states of that block. Implementing and overriding deprecated methods are usually okay since most are reused in the BlockState. However, when we are calling those methods we should stick to using the BlockState function calls over the Block function calls. Deprecated methods usually are obsolete for similar reasons.

 

Finally, the error message is probably because you most likely did not generate the specific files required for the workspace you are using. Although, you should use the latest versions since they do have some necessary updates that might fix some bugs you run into later on.

  • Like 1
Posted (edited)
  On 3/21/2020 at 4:41 AM, ChampionAsh5357 said:

Please recognize what version of Minecraft you are using before asking about a class. Some classes have been removed, others have been redone, and finally (in your case) some classes have been renamed. The easiest thing to do would've been to open up a source version with IBlockState (e.g. 1.12.2) and then looked at your current version (1.15.2) and then finding what has changed. In this case, a quick look would have told you IBlockState was renamed to BlockState.

 

Second, the Block class methods are usually deprecated since they only check for that specific block. The BlockState class has the same methods without deprecation since they can check for multiple states of that block. Implementing and overriding deprecated methods are usually okay since most are reused in the BlockState. However, when we are calling those methods we should stick to using the BlockState function calls over the Block function calls. Deprecated methods usually are obsolete for similar reasons.

 

Finally, the error message is probably because you most likely did not generate the specific files required for the workspace you are using. Although, you should use the latest versions since they do have some necessary updates that might fix some bugs you run into later on.

Expand  

Thank you so much for taking the time to answer my question! It really helped! However I read online though that the setupDecompWorkspace gradle executable doesn't exist anymore. What do you mean by generating the specific files? What gradle command do I use to accomplish that?

Edited by Rezanance
Posted
  On 3/21/2020 at 2:31 PM, Rezanance said:

What do you mean by generating the specific files? What gradle command do I use to accomplish that?

Expand  

In your IDE under "referenced files" you will find the vanilla and forge source files.

  • Like 1

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.

Posted
  On 3/21/2020 at 3:11 PM, Draco18s said:

In your IDE under "referenced files" you will find the vanilla and forge source files.

Expand  

So you're saying that I don't have to do anything to generate them? They're already there right? I'm sort of confused haha

Posted

Sort of, if you ran the setup command already, then yes. If no, then you need to run the setup command.

  • Like 1

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.

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.