Jump to content

[Fixed]Custom Teleporter hangs in "Downloading Terrain" when using setblockstate


Recommended Posts

I am creating a mod, that allows a player to swap between the Overworld and the nether without the use or spawning of a nether portal. In the case that the mod can't find a spot to spawn the player at in the next world, it will create one by clearing out 3x2x3 air blocks and putting in a 3x3 cobblestone platform for them to land on.



However, for some unknown reason. When ever I try to setblockstate to air or cobblestone, the mod will hang at "downloading terrain". If I comment out the setblockstate, the mod will stop hanging. So the problem seems to occur when setblockstate is called.


Code of Teleporter code here:




Anyone have any idea, I been banging my head on this for the past few days.


My mod has it that it set a Deffered Action on line 92 here:



which tells my tick handler to do the "doAction" action on the next tick utilizing the teleporter in lines 48-54 on this class:




Link to comment
Share on other sites

Well if you never break out of a While loop, or the condition never becomes false (thus breaking naturally) that loop will run forever. And since your code ran on the main thread, you had created a lock as it would loop forever. Try to avoid using While loops if you can, and if you must or feel you must. Always ensure there is an exit strategy

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.

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.

  • Create New...

Important Information

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