Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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

 

  • 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.

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

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.