Jump to content

[1.19.x] Any documentation or references at all for custom container screens? (AbstractContainerScreen class)


Recommended Posts

Posted (edited)

I haven't even got my mod off the ground yet, so I don't have a particular problem or unexpected behavior with my code. I'm brand new to modding with Forge, but I have written Java before for server mods and other purposes.

The official documentation for Forge seems to be less than incomplete. It covers maybe 10% of classes and topics with very little detail. Combine this with the seemingly drastic change in class names, method names, parameters, and processes between versions, and the result is that there seems to be not a single up-to-date guiding piece of information on the entire internet to show me how to do something as simple as create a custom container GUI.

I found one YouTube tutorial that at least showed me how to implement AbstractContainerMenu, but he has not yet released the next part, which shows how to link it to the custom GUI screen.

Does anyone know which steps are needed to implement this? It seems to require the renderBg abstract method, but how do you actually render the screen within this method and connect it with your Menu class?

Edit: in case anyone looks at my profile and sees a post from 2019, I still consider myself "new to forge" because I didn't really get into it back then. Just wanted to clear that up for the off chance that someone calls me a liar lol

Edited by Felix_2000
Posted

This is not a teaching forum. It is a support forum.

Use the minecraft source code to find examples close to what you want to do.

When you have specific problems/questions you can come back to this forum. But we are not going to write your mod for you.

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Posted

I guess I can see how this isn't topical and agree on that. I gotta say though, it sounds a bit of a stretch to say that you'd be "writing my mod for me" by providing basic documentation. I asked for tutorials too, but not as much for "teaching" as standing in place of the painfully lacking documentation.

Your suggestion to use Minecraft source code though has made me realize something I assumed incorrectly. I was thinking that a lot of these classes belonged to Forge API and not Minecraft itself (just my silly neglecting to look at package names and being used to Bukkit), in which case the lack of documentation would be unacceptable. That wouldn't really make sense for a modding tool to provide an interface into everything I suppose, but I am new to this whole thing and didn't consider it. So I guess we can't expect this community to document what isn't theirs.

Thanks for the indirect insight delivered by way of your somewhat passive aggressive reply. I think I know where to start now.

Posted
14 hours ago, warjort said:

This is not a teaching forum. It is a support forum.

Use the minecraft source code to find examples close to what you want to do.

When you have specific problems/questions you can come back to this forum. But we are not going to write your mod for you.

adding this as a reply because I could not for the life of me figure out how to quote/reply in the last message

Posted
20 hours ago, Felix_2000 said:

The official documentation for Forge seems to be less than incomplete. It covers maybe 10% of classes and topics with very little detail. Combine this with the seemingly drastic change in class names, method names, parameters, and processes between versions, and the result is that there seems to be not a single up-to-date guiding piece of information on the entire internet to show me how to do something as simple as create a custom container GUI.

Documentation is written by the community. Most classes in Forge are fully documented for their purpose as a public API; however, as Minecraft is obfuscated and separate code, as you have pointed out, it is typically left to the community to document these procedures. Forge does have the official docs and the community wiki; however, both of these sites are more or less community driven, the former with extra checks provided by members of the documentation team which have time to look over and verify the topics.

Currently, I am the main active member who contributes to these two sites as a maintainer of both, but I have not had a lot of time recently to add new pages as I typically like to conduct as much research as possible to make the documents robust enough for a basic understanding of the system. Additionally, it takes time when Forge updates between Minecraft versions that I need to review and reverify all the information again, which is a separate undertaking. I've spent the past few months slowly working on menus and screens actually, but trying to document the information for people without prior knowledge is difficult along with the quantity of information.

Ideally, more people could contribute such that I can take a more review-based role, but that depends on the community as well. If you're willing to contribute after getting an understanding for yourself, make a PR to the docs or make edits on the wiki, it would be more than helpful.

Posted
1 hour ago, ChampionAsh5357 said:

Documentation is written by the community. Most classes in Forge are fully documented for their purpose as a public API; however, as Minecraft is obfuscated and separate code, as you have pointed out, it is typically left to the community to document these procedures. Forge does have the official docs and the community wiki; however, both of these sites are more or less community driven, the former with extra checks provided by members of the documentation team which have time to look over and verify the topics.

Currently, I am the main active member who contributes to these two sites as a maintainer of both, but I have not had a lot of time recently to add new pages as I typically like to conduct as much research as possible to make the documents robust enough for a basic understanding of the system. Additionally, it takes time when Forge updates between Minecraft versions that I need to review and reverify all the information again, which is a separate undertaking. I've spent the past few months slowly working on menus and screens actually, but trying to document the information for people without prior knowledge is difficult along with the quantity of information.

Ideally, more people could contribute such that I can take a more review-based role, but that depends on the community as well. If you're willing to contribute after getting an understanding for yourself, make a PR to the docs or make edits on the wiki, it would be more than helpful.

That's very cool of you to be documenting this stuff. Yeah, I understand better now. I don't know why I was thinking that 100% of the things I interacted with were Forge API. Again, just my experience with Bukkit and other projects and having never actually modded a game client before. But it is also cool that the community is documenting the Minecraft code too (if I understood correctly). I've never contributed to anything public before, documentation or open source projects, but I certainly could, and I kind of want to. Maybe once I'm done playing around with Forge, I'll take you up on that.

Posted
On 10/10/2022 at 5:57 PM, ChampionAsh5357 said:

Documentation is written by the community. Most classes in Forge are fully documented for their purpose as a public API; however, as Minecraft is obfuscated and separate code, as you have pointed out, it is typically left to the community to document these procedures. Forge does have the official docs and the community wiki; however, both of these sites are more or less community driven, the former with extra checks provided by members of the documentation team which have time to look over and verify the topics.

Currently, I am the main active member who contributes to these two sites as a maintainer of both, but I have not had a lot of time recently to add new pages as I typically like to conduct as much research as possible to make the documents robust enough for a basic understanding of the system. Additionally, it takes time when Forge updates between Minecraft versions that I need to review and reverify all the information again, which is a separate undertaking. I've spent the past few months slowly working on menus and screens actually, but trying to document the information for people without prior knowledge is difficult along with the quantity of information.

Ideally, more people could contribute such that I can take a more review-based role, but that depends on the community as well. If you're willing to contribute after getting an understanding for yourself, make a PR to the docs or make edits on the wiki, it would be more than helpful.

Hey, sorry to hit you with another reply, but do you know any particular repo forge developers usually look at for Minecraft source code? I understand Minecraft isn't open source so it is probably decompiled, but I'm sure I could find several different repos, some better documented and put together than others, so I'm wondering if you know the best choice.

Posted
17 minutes ago, Felix_2000 said:

Hey, sorry to hit you with another reply, but do you know any particular repo forge developers usually look at for Minecraft source code?

It's fine. Though, I am unfortunately the worst person to ask. I tend to go through the vanilla source to figure out what's going on and work backwards to develop and improve it, only asking questions when there isn't a well defined path to backtrace. Typically, it's the same as programming any other work: think of a concept, develop the usecases, build them out, integrate them with the system you are working with. If I ever have loader specific questions, I typically ask here or on discord to receive answer.

That's not to say there isn't any good repositories for sources. I just typically don't look at them since everyone has their own programming style, some of which may be bad in modern versions in Minecraft.

Posted
7 minutes ago, ChampionAsh5357 said:

It's fine. Though, I am unfortunately the worst person to ask. I tend to go through the vanilla source to figure out what's going on and work backwards to develop and improve it, only asking questions when there isn't a well defined path to backtrace. Typically, it's the same as programming any other work: think of a concept, develop the usecases, build them out, integrate them with the system you are working with. If I ever have loader specific questions, I typically ask here or on discord to receive answer.

That's not to say there isn't any good repositories for sources. I just typically don't look at them since everyone has their own programming style, some of which may be bad in modern versions in Minecraft.

Yeah...I'm really just trying to spare myself having to decompile it myself. I'm not even sure how I would do that honestly. I worked with a Java decompiler before, but it generated errors when it decompiled. Not sure if that's normal. I'd spare myself the headache if I could. But I'll look for myself. Thanks!

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.