Jump to content

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


Felix_2000

Recommended Posts

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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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!

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • when I just started up the game, I had this one splash on the menu. then I joined a world. I left. but when I exited the world to menu, it said the exact same splash it showed that I started up the game! 😠 and it won't change until I restart the whole game all over again. and I am using my custom splash texture pack, but it was not like that before even when I had it enabled. ugh! what even am I doing wrong? my whole game is ruined!! https://mclo.gs/LRDITtP
    • before I updated my pack I made for paintings++ mod, i noticed and saw that only modded paintings and vanilla ones move one block each time I re-enter my world! is there something wrong? what the hell is even going on? why is there a ghost living in my house?! the modded paintings even phase through blocks which is super weird!! help! here is my painting mod list: Paintings++ Dark paintings Macaw's paintings Joy of painting Immersive paintings My custom paintings++ resource pack
    • Error: java.lang.NullPointerException: Cannot invoke "me.codexadrian.tempad.TempadClientConfig.renderBlur()" because the return value of "me.codexadrian.tempad.TempadClient.getClientConfig()" is null I keep having this error while trying to launch a modpack through the forge modloader, any suggestions? https://docs.google.com/document/d/1CRKUoSiu2e_mDvDTVYpIA5wqD3w-BsCycxBu1_vQ4OA/edit?usp=sharing Crash Report ^^^^
    • I'm trying to start a server with the latest installer, but running the run.bat file doesn't generate new files. It shows the following in the cmd prompt.
    • One of my players is suddenly unable to join a locally hosted MC Eternal server. We have been playing on this server for about 2-3 weeks now. I have tried erasing his player files and his reputation file, and now it just coughs up this and kicks him out: [User Authenticator #5/INFO] [minecraft/NetHandlerLoginServer]: UUID of player EthosTheGod is 7692d8db-02c3-424f-a4ab-0e4e259b106b [20:25:36] [User Authenticator #4/INFO] [minecraft/NetHandlerLoginServer]: UUID of player EthosTheGod is 7692d8db-02c3-424f-a4ab-0e4e259b106b [20:29:35] [Server thread/WARN] [minecraft/MinecraftServer]: Can't keep up! Did the system time change, or is the server overloaded? Running 575849ms behind, skipping 11516 tick(s) [20:29:35] [Server thread/INFO] [minecraft/NetHandlerLoginServer]: com.mojang.authlib.GameProfile@4a6c63f1[id=7692d8db-02c3-424f-a4ab-0e4e259b106b,name=EthosTheGod,properties={textures=[com.mojang.authlib.properties.Property@241ea89e]},legacy=false] (/IP.ADDRESS) lost connection: Disconnected [20:29:35] [Server thread/INFO] [minecraft/NetHandlerLoginServer]: com.mojang.authlib.GameProfile@6ab6c661[id=7692d8db-02c3-424f-a4ab-0e4e259b106b,name=EthosTheGod,properties={textures=[com.mojang.authlib.properties.Property@7f19aae3]},legacy=false] (/IP.ADDRESS) lost connection: Disconnected It just says "connection timed out" on his end. Any ideas?
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.