[FABRIC] Crash when using a Ticker to join a server too early (Screen cannot be NULL)
NextRaven10 opened this issue · 5 comments
Describe the bug
When I add a Ticker to my main menu that checks if a variable is true and if my server is online and then joins the server using my serverip variable
To Reproduce
I will use the $ sign to indicate a variable
Steps to reproduce the behavior (e.g.):
- Create a new Instance of Minecraft 1.20.1 with the following mods: Cloth Config API; Drippy Loading Screen; Entity Culling; Fabric API; FancyMenu; FerriteCore; ImmediatelyFast; Indium; Iris Shaders; Konkrete; Lithium; Melody; Mod Menu; ModernFix; Sodium; Sodium Extra; (I am not sure if you need these mods to reproduce the bug, its just the mods I have installed when it crashes)
- Add the Variables: $autojoinserver:false & $serverip:modpack.nextraven.de
- In the main menu: Open the Editor of the Layout and add a new ticker that checks if the $autojoinserver variable is true and that checks if the server with the ip of $serverip is online. If both true it joins the server with the ip of $serverip
- Add a Button to toggle the $autojoinserver variable
- Crash when you leave the Editor or when you press the button (seems to be random)
Expected behavior
That when I start the game, $autojoinserver is true and my server is online that I would automatically join the server
but instead it crashes :(
Game Log
Here is the link: https://mclo.gs/NtYfgHM
Screenshots
If screenshots would help to explain the issue, please include these.
Basic Informations (please complete the following information):
- OS: Windows 10
- FancyMenu Version: 3.2.3-1.20.1-fabric
- Forge/Fabric Version: 0.16.5
- Minecraft Version: 1.20.1
- Active Mods Cloth Config API; Drippy Loading Screen; Entity Culling; Fabric API; FancyMenu; FerriteCore; ImmediatelyFast; Indium; Iris Shaders; Konkrete; Lithium; Melody; Mod Menu; ModernFix; Sodium; Sodium Extra;
The issue seems to be related to Fabric's API, but that error shouldn't happen anymore. I thought I fixed that. Could be related to another mod OR the way you try to join the server is somehow bugged. Can you join the server with a normal button or does that also causes the game to crash?
Yes, I can join a server when I just press a button that joins it
Lautsprecher (High Definition Audio Device)
Good old Lautsprecher of the fellow Deutsche Kartoffel :D
The issue seems to be related to Fabric's API, but that error shouldn't happen anymore. I thought I fixed that. Could be related to another mod OR the way you try to join the server is somehow bugged. Can you join the server with a normal button or does that also causes the game to crash?
//Edit: Oh I think I know what's happening. Your Ticker element joins the server the moment the Title screen opens, right? Yeah well, I think at that point the Fabric API has not finished doing its thing yet, so it thinks the screen is NULL instead of the Title screen. I don't know if I can fix that tbh.
Yes, the good old Deutsche Kartoffel xD
So it just isn´t possible? Or is there another way I can make the user join a server when a variable is true?
Yes, the good old Deutsche Kartoffel xD
So it just isn´t possible? Or is there another way I can make the user join a server when a variable is true?
You could possibly do it by making a timer that makes the client join to the server slightly later.