Advanced Portals

Advanced Portals

307k Downloads

getting stuck in loop of portals

smmmadden opened this issue ยท 21 comments

commented

I've got a set of portals to get from the default "TheHub" World to other worlds and they work fine. However, trying to return to the prior world puts us inside the portal block area and then any movement we get teleported back to the one we cam from. Is there a way to specify that when the server command of /worldname is done, that we return to the spawn point of that world and not the last location? This is using the latest version of 0.12.6 with BungeeCord/Spigot 1.12 builds.

commented

Thing is players all have different loading speeds. I will need to think about how to detect people actually loaded or whatever. I could possibly add a freeze value it tracks until it gets a move event though im not sure if the server would move them if they are frozen but in mid air from jumping into a portal.

I could also possibly add a different cooldown value for the two events. E.g. a general one then a world loading cooldown which is configurable.

That or I could also possibly make it add time to a cooldown for certain triggers if the player ends up near a portal (I think this may be best however I will need to recode the cooldown system a bit to allow the rearrangement of data)

commented

that is very true. Perhaps nothing needs to change with the cool down, but to detect (if possible) if a player has gone through one portal and ended up in the middle of another for a target world and if so move the player outside of the portal (1 or 2 blocks). If that could be done, then servers with a mandatory cool down before going through another portal or those with no cool down, it would still behave the same since the player going through a portal won't end up in the frame of another portal. In that case, any movement bounces the player back to the the source world they came from.

As an example, I set the cool down to 0 (disabled) and any mouse movement will send me back and forth between the worlds. :-) In both cases - I'm still inside the frame of the portal when I should be at least one block outside of it.
image
The one below is a two block high, one block deep air portal with quartz_block frame. The Hub above is 3 blocks wide / 4 blocks high using water. Same behavior with air/portal/water.
image

commented

Ive added a listener which will add a cooldown on world changes.

The attached zip contains the new listener. If it doesn't work I can change it to be based on teleport events.
Portal world fix (possibly).zip

commented

Just tested it out and it seems to have a delay in activating the end point portal but does pause enough to not get tp'd back to the previous world. I counted the time from entering the portal to materializing in the next and it was about 17 seconds of a blank screen (no text/color/nothing) then I materialized and can move out of the portal so I don't get tp'd back. So that appears to have a 2-3 second pause which is just enough. So it's almost there. :-)

commented

To fix that just go into the config and change the portal cooldown time. Its all based off that ;)

commented

the portal cool down is only set to 3 seconds - are you saying it should be zero?

commented

No im saying raise it to like 10

commented

I set all the worlds to 10, but having to wait 10 seconds before going thru seems a bit extreme. You know how players want everything in microseconds :-)

It did allow me to not be trapped in one portal and being sent back to where I was, so that part looks good. Just need to get the timing worked out.

commented

Wait so you are saying they are actually in the portal and not just right next to it?

If so if they are loading they wont be activating the move event making it protect them (if i remember correctly).

I could include the inportal varable making it not activate till they leave it to rejoin. If this is the issue you are facing it will fix it every time.

Edit: I will test this in a little or tomorrow morning :) I am sure i know what this is if so.

commented

yes, exactly the what I'm seeing as I travel through portals. I am in the middle and don't actually travel straight through. So I travel to the second portal and with 0 wait, it bounces me back to the first leaving me unable to get to that world unless of course I increase the cooldown time :-(

commented

Sorry I became busy with some family buisiness, I will be testing it as soon as possible.

commented

no problem, hope everything is okay

commented

Nothing serious, its just my parents wanted me to go help with some stuff xD

commented

I could set a metadata tag or create a hashmap of times and locations to check on a player logout. That should sort it.

Would be best to do leaveloc: as the tag or leavedesti:

commented

I think I figured out how to not get stuck in a portal going from world to world. I set the PortalCooldown to 7 and the ThrowbackAmount to 1. This allows me to move the player one block out of the portal which is all that we need to do when going through them all the time. Otherwise, a lower cool down (or none at all) would tp them back and forth. So if any change was done, I would vote on adding 1 block to the destination coordinates. If someone creates a portal wider than 1 block, they would need to increase the ThrowbackAmount accordingly. Does that match with the original use case you created for it?

commented

Sorta, the stuff was mostly added so people wouldnt spam portals like bungee ones as well as if they joined inside a portal they would be able to walk through it until they exit it. Also the easiest way to reliably do this would be an exit location for bukkit.

commented

I was hoping that setting would have done it every time but it doesn't. The problem is with the entry and exits of portals. The entry point a player walks thru and gets to the exit point but when the player arrives, they arrive on the target portal inside the portal and they have to walk out of it to avoid getting dragged back to where they were and dragged back and forth until the player hits the right key strokes or can get a command in to get out.

Is there any way to detect the nearest safe blocks (X+1 and/or Z+1) or (X-1 and/or Z-1) to have that the exit location? I constantly get stuck in a loop when going thru the portals but I can do a /server to teleport without getting trapped. Even if it were configurable in the portals.yml during the creation of the portal, that may do it. This could allow the admin or player creating the portal to select the exit spot of the target portal. Does that make sense or doable?

commented

Ok revisiting this issue the way I am going to get around this is a player has to move after a grace period for the cooldown to start. I will make that period configurable

commented

sorry, I had to move on to using other portal options. So I'm no longer using this resource.

commented

This wasnt continued for you someone else was having the issue

commented

I will open a new one