Minecraft Version: 1.9 - 1.16+
Ever since the event was introduced in Forge for 1.9 (#2828) it has contained the following line:
This event is fired before and after a screenshot is taken
Lex saw no reason for the Pre/Post event of that so it was changed to only contain one event call:
And again, i'm still not even convinced that there needs to be a pre/post event to this. Not EVERY event needs a pre/post.
Yet the docs weren't updated by the guy to reflect the change, whether the latest 1.16.x branch or 1.9 since merge.
The doc line should be removed as misleading from all these branches:
This event is fired before the screenshot file was written (and therefore before a chat message appears) but after the screen buffer has been captured, so the event processors do receive the BufferedImage.
I thought I'd write up an issue instead of spamming 8 PRs for each branch (& a CLA uh-oh).
So there won't be a second event when the file is created? I just needed it! 😅
I wanted to convert the image directly at the source 😅
There are quite a few javadocs issues, I have always stated that I am crap with documentation.
I would suggest that if you care about javadocs, it may be worth getting a couple people together and doing a big sweep of cleaning/adding javadocs.
It may be the next omnibus branch?
Not your fault here, Lex, the guy forgot to fix the javadoc after implementing your request :)
I will consider to join you guys on Discord to contribute.
Now that @LotuxPunk came up with that again, I will comment on the problems with the event and code surrounding it. First, the flow:
take screen
func that returns the TextComponent that's put into chat (from the loop above)take screen
calls capture buffer
My idea was to re-schedule the screenshot, so it would capture less/more debug info rendered by my mod (chunk/region outlines etc.) It works. Yet due to the empty line appearing on the following screenshot I had to remove it manually from chat. Since MC's removeLine ( id )
doesn't just remove one line at key id
(at least in my ver, don't roll your eyes) I had to manually grab a ref to the chat history + recent messages Lists to remove them properly.
Regardless of how I do it and what for:
Idk what the guidance with Forge events is, but I think there should be actually 3 events/states:
take screen
called (to prevent the chat message or buffer capture on cancellation)@LotuxPunk with the current event hook: the idea is you modify the captured screen buffer as part of the event, not wait until its written to file.
Most helpful comment
Not your fault here, Lex, the guy forgot to fix the javadoc after implementing your request :)
I will consider to join you guys on Discord to contribute.
Now that @LotuxPunk came up with that again, I will comment on the problems with the event and code surrounding it. First, the flow:
take screen
func that returns the TextComponent that's put into chat (from the loop above)take screen
callscapture buffer
a. If event is not cancelled, TextComponent is returned and file saved
b. If event is cancelled, the buffer has already been captured, file not saved. Yet since that function returns a TextC - the best you can do is to return an empty text, empty line will appear in chat*
My idea was to re-schedule the screenshot, so it would capture less/more debug info rendered by my mod (chunk/region outlines etc.) It works. Yet due to the empty line appearing on the following screenshot I had to remove it manually from chat. Since MC's
removeLine ( id )
doesn't just remove one line at keyid
(at least in my ver, don't roll your eyes) I had to manually grab a ref to the chat history + recent messages Lists to remove them properly.Regardless of how I do it and what for:
Idk what the guidance with Forge events is, but I think there should be actually 3 events/states:
take screen
called (to prevent the chat message or buffer capture on cancellation)@LotuxPunk with the current event hook: the idea is you modify the captured screen buffer as part of the event, not wait until its written to file.