kyrptonaught / customportalapi

Developer Api for creating custom portals to any dimension
MIT License
64 stars 22 forks source link

Wrong teleportation #16

Closed RobertSkalko closed 3 years ago

RobertSkalko commented 3 years ago

Playing on 0.0.1-beta25-1.16.

I used the lib to make a simple custom portal to my dimension, works fine most of the time but this time it teleported me and for some reason didn't set the player position correctly because I ended at same position from that dimension.

I was in -4000 something in my dimension, and same when I teleported back to overworld, which caused me to be stuck in rocks 4000 blocks away from base.

Now i'm almost sure this is the same unsolved bug I had ever since 1.15 even on forge. So hopefully you have better luck with fixing it.. The catch is it's random so I wasn't ever able to reproduce it.

There's a chance it might be some issue with my mod too, so you can close this if nobody else seems to have this issue after a while.

RobertSkalko commented 3 years ago

I have reproduced it, it seems to be caused by jumping while in the portal.

I also tested it on my smaller mod, which means it's less likely it's something caused by me.

No idea why the bug happens though.

kyrptonaught commented 3 years ago

Does this happen with nether portals and or custom portals going to the nether?

RobertSkalko commented 3 years ago

Didn't test, but it screws with my dimension with "coordinate_scale": 0.1,

RobertSkalko commented 3 years ago

Ok tested, reproduced instantly

kyrptonaught commented 3 years ago

Vanilla nether portals or just custom ones?

RobertSkalko commented 3 years ago

Vanilla ones work fine.

RobertSkalko commented 3 years ago

Were you able to reproduce it btw?

Jack-Papel commented 3 years ago

Got it in a video: https://drive.google.com/file/d/181kJ_HL3Gi6IqDt5hyTGuJdrYTjDqMgt/view?usp=sharing

The console printed this when travelling back though the portal as depicted in the video: [23:21:36] [Server thread/WARN] (Minecraft) Player485 moved wrongly!

Not sure if this is useful, but here's the seed: 369416271903697969

Jack-Papel commented 3 years ago

Here's a video with F3 open: https://drive.google.com/file/d/1mztkWn1pP7zfgKjGPnQF1FTuE2grkdwg/view?usp=sharing

Console: [23:34:46] [Server thread/WARN] (Minecraft) Can't keep up! Is the server overloaded? Running 3347ms or 66 ticks behind [23:35:20] [Server thread/WARN] (Minecraft) Player485 moved wrongly!

Same seed

kyrptonaught commented 3 years ago

Thanks for the information. If I can finally consistently reproduce this it'll make it a lot easier to track down the actual issue

Jack-Papel commented 3 years ago

It wasn't ever consistent, but it wouldn't take too much testing before getting it to happen

Jack-Papel commented 3 years ago

"Jumping around a bit" seemed to make it happen more often. Could be a coincidence.

RobertSkalko commented 3 years ago

I think it has to do with movement while in the portal. I got same issue with my custom teleports that don't use your api too, even though I literally use the vanilla teleport command.

I will try to apply a weird bandaid (add a delayed action that confirms if player is too far away from teleport position), and see if it works. The issue of course is that it's hard to reproduce so I have to wait till my players find out.

varinyc commented 3 years ago

On my end it seems to only occur on non-vanilla portals (I'm using the Aether mod), can involve any movement at all, but you get higher success in reproducing the issue if you're mid-action when the teleport commences (swing, jump, crouch, etc).

The erroneous destination is one of two places (that I have seen so far) -> The same exact coordinates you left from but in the new dimension -or- A brand new portal in a nearby location as if the two had become unpaired, creating an additional portal. The former happens a lot more often though.

I played with the new portal it created a bit and realized that my original overworld portal now links 7/10 times to the "same coords" location, under normal usage, and when I do get to the correct destination, my return trip goes to the newly created portal -- until I destroy it. After I destroy the extra portal, the return trip then will teleport me to a brand new "same coords" location of itself (independent of the previous "same coords" location, as my two original portals have different coordinates). Alternatively (after destroying the extra portal), my return trip will respawn that portal. The original two portals will not sync back up again. I have to destroy the extra portal, and destroy the destination portal, go home using a regular teleport command, and start fresh by going through my origin portal (which creates a brand new destination portal). Note: When I end up teleporting to a "same coordinates" location it is always without a generated portal.

The original issue is kind of random until you figure it out, but this extra stuff that happens afterwards is almost like clockwork, given a few teleports. Hope this information helps.

(Here is the server related logs, I don't know what these numbers are meant to represent, they aren't my coordinates)

[27.06 21:23:00] [Server] [Server thread/WARN]: varinyc moved wrongly!

[27.06 21:25:07] [Server] [Server thread/WARN]: varinyc moved too quickly! -9688.999804675579,26.0,-2981.0

[27.06 21:25:19] [Server] [Server thread/WARN]: varinyc moved too quickly! 9688.999951183796,-26.0,2981.0

[27.06 21:27:18] [Server] [Server thread/WARN]: varinyc moved too quickly! -9688.999804675579,26.0,-2981.0

[27.06 21:27:27] [Server] [Server thread/WARN]: varinyc moved too quickly! 9688.999951183796,-26.0,2981.0

[27.06 21:27:39] [Server] [Server thread/WARN]: varinyc moved too quickly! -9688.999804675579,26.0,-2981.0

Jack-Papel commented 3 years ago

^ My hypothesis for the "same coords" issue is that it teleports you before you've fully loaded into the dimension, meaning you don't actually change coordinates. Could be wrong, but might be a place to start.

kyrptonaught commented 3 years ago

Hey sorry for the delay, beta 41 should significantly improve this