Jump to content

import cannot be resolved


Demon Llama

Recommended Posts

Hi I'm new to minecraft programming. Working through a book called "Minecraft modding with Forge" and got stuck.

 

I'm not sure why I am unable to import these classes.

 

Why am I getting these errors? Thanks a bunch :)

min.png

Edited by Demon Llama
Link to comment
Share on other sites

Welcome!

A few important things. 
1) It's best if you use the code quotations tool in the forum or use Pastebin to show us the code. 
2) It's super helpful if you let us know what version you are running. It also does not work with me and the reason is there isn't a ChatComponentText in the Util's as far as I can see. Probably it was moved to a different name/function. 

 

My guess is that you'll need to find updated code for this particular portion. I see a "ChatAllowedCharacters" but thats it for chat under the Util's hierarchy. Sorry. Thats the best I can do for you :(. Hopefully someone smarter has a better idea!

  • Like 1
Link to comment
Share on other sites

3 minutes ago, olrustyeye said:

Welcome!

A few important things. 
1) It's best if you use the code quotations tool in the forum or use Pastebin to show us the code. 
2) It's super helpful if you let us know what version you are running. It also does not work with me and the reason is there isn't a ChatComponentText in the Util's as far as I can see. Probably it was moved to a different name/function. 

 

My guess is that you'll need to find updated code for this particular portion. I see a "ChatAllowedCharacters" but thats it for chat under the Util's hierarchy. Sorry. Thats the best I can do for you :(. Hopefully someone smarter has a better idea!

Awwww. Thanks though. And thanks for the forum tips :D

 

Where can I find a documentation list for the Minecraft/Forge methods, events, classes, etc?

 

Thanks again!

Link to comment
Share on other sites

17 minutes ago, Demon Llama said:

Awwww. Thanks though. And thanks for the forum tips :D

 

Where can I find a documentation list for the Minecraft/Forge methods, events, classes, etc?

 

Thanks again!

I wish there was more documentation. Sadly it's severly lacking. Not for forge's lack of trying but things change so much and few people actually want to go through the code and find things. 
That being said there is some pretty useful stuff here. 
https://mcforge.readthedocs.io/en/latest/
Nothing like what you're looking for but it's a good resource for what is there. 

Link to comment
Share on other sites

2 minutes ago, olrustyeye said:

I wish there was more documentation. Sadly it's severly lacking. Not for forge's lack of trying but things change so much and few people actually want to go through the code and find things. 
That being said there is some pretty useful stuff here. 
https://mcforge.readthedocs.io/en/latest/
Nothing like what you're looking for but it's a good resource for what is there. 

Ah thanks. I actually looked through all that and couldn't find enough info :/ 

Compared to bukkit, it's a lot less documentation. Darn I really wanted to work through this awesome book too D: 

Link to comment
Share on other sites

2 minutes ago, Demon Llama said:

Ah thanks. I actually looked through all that and couldn't find enough info :/ 

Compared to bukkit, it's a lot less documentation. Darn I really wanted to work through this awesome book too D: 

I modded minecraft back in 1.3 and 1.5. Fun fact I actually owned the One Stop Mod Shop way way long ago haha. Things have changed, but the syntax on the basic stuff like blocks are the same. Find what version the book is using and switch to that go through it and then all you'll need to do is update your syntax!

 

Link to comment
Share on other sites

2 minutes ago, olrustyeye said:

I modded minecraft back in 1.3 and 1.5. Fun fact I actually owned the One Stop Mod Shop way way long ago haha. Things have changed, but the syntax on the basic stuff like blocks are the same. Find what version the book is using and switch to that go through it and then all you'll need to do is update your syntax!

 

OMG !!!!!! Great idea. Why didn't I think to downgrade so I could complete the book ? Haha.

Okay I will do that :D 

I'm super happy now !

Now to figure out how to undo everything and downgrade the forge version O.o

Link to comment
Share on other sites

https://pastebin.com/t7wP7RW4

 

Okay I'm not sure how to downgrade :/

I redid the whole forge folder and workspace and everything.

But now when I run ./gradlew setupDecompWorkspace, the build always fails.

 

Could someone help me out with how to go about properly downgrading?

 

 

EDIT: fixed the problem. I just picked a different version of 1.8 and the set up worked fine :D

Edited by Demon Llama
fixed my problem
Link to comment
Share on other sites

"Chat" components were renamed to "Text" components in 1.9. ChatComponentText is now TextComponentString, EnumChatFormatting is now TextFormatting.

 

This issue tracker documents most renames in 1.8+.

 

You can also use MCPBot to find the current name of a field/method/parameter when you have its old name:

  • Use the findf/findm/findp commands with the old MCP (deobfuscated) name and the old Minecraft version to find the SRG (obfuscated) name.
  • Use the same command with the SRG name and the new Minecraft version (or omit the version argument for the current version) to find the current MCP name.
  • Alternatively, use the fh/mh/ph commands with the SRG name to display the name history instead of just the current name.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

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.