Posted November 15, 20168 yr 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: https://github.com/needoriginalname/infinityguantlet/blob/master/src/main/java/com/needoriginalname/infinitygauntlet/dimension/SpaceGemTeleporter.java 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: https://github.com/needoriginalname/infinityguantlet/blob/master/src/main/java/com/needoriginalname/infinitygauntlet/items/GemStates/StateSpaceGem.java which tells my tick handler to do the "doAction" action on the next tick utilizing the teleporter in lines 48-54 on this class: https://github.com/needoriginalname/infinityguantlet/blob/master/src/main/java/com/needoriginalname/infinitygauntlet/util/nodes/TransferPlayerNode.java
November 15, 20168 yr Could the target BlockPos have a y co-ordinate that's higher than the top of the nether?
November 15, 20168 yr Author While that wasn't the cause, I think I fixed. Because when checking to see if it would ever check a spot above the world's height in placeInExistingPortal, I noticed that one of the while loops would always be false on a valid spot. I don't know how that fixed the hanging, but somehow it did.
November 15, 20168 yr 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 Currently updating my Mod to 1.10.2 https://bitbucket.org/hugo_the_dwarf/riseoftristram2016/src?at=master
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.