Skip to content

Fix Legacy Portal Detection#584

Merged
benwoo1110 merged 5 commits into
mainfrom
fix_legacy_detection
May 11, 2021
Merged

Fix Legacy Portal Detection#584
benwoo1110 merged 5 commits into
mainfrom
fix_legacy_detection

Conversation

@nicegamer7

Copy link
Copy Markdown
Member

This PR fixes legacy portal detection. Although, it seems it wasn't used anywhere, it's important that it works properly for anyone who wants to use the API. I also made it so that the Player Move event handler only handles legacy portals, but this exposed a bug. It seems the player portal event handler doesn't work properly for normal portals. I tested this on 1.16.3.

@nicegamer7 nicegamer7 marked this pull request as ready for review October 13, 2020 17:15
@nicegamer7 nicegamer7 force-pushed the fix_legacy_detection branch from fecc0fb to 56355e1 Compare October 15, 2020 03:44
@nicegamer7 nicegamer7 marked this pull request as draft October 21, 2020 21:13
@nicegamer7

Copy link
Copy Markdown
Member Author

The above mentioned issue is fixed, but that exposed another bug which is fixed by #600. So, this is on hold until that fix is merged.

@nicegamer7 nicegamer7 marked this pull request as ready for review December 14, 2020 04:30
@nicegamer7

Copy link
Copy Markdown
Member Author

Here's a test build of this PR.

Multiverse-Portals-4.2.2-SNAPSHOT.jar.zip

@nicegamer7 nicegamer7 linked an issue Dec 14, 2020 that may be closed by this pull request
@benwoo1110

Copy link
Copy Markdown
Member

Actually, what is a "legacy" portal? Like portals made on an older version of Minecraft?

@nicegamer7

Copy link
Copy Markdown
Member Author

Dumptruckman and I talked about this. "Legacy" is a bad term, and we're gonna rename it in 5.0.0.

"Legacy" is any portal that isn't filled with the nether portal block. So, for example, a portal that is made of water is considered "Legacy".

@nicegamer7 nicegamer7 force-pushed the fix_legacy_detection branch from ebf3f48 to 5db19c1 Compare January 15, 2021 00:34
@benwoo1110

Copy link
Copy Markdown
Member

I tested a bit and this is definitely more robust in terms of detecting nether_portal type.

However, there is one change, portals with nether_portal fill will only teleport after the "wavy animation" instead of immediately. I also notice this animation only happen in survival, not creative (probably a client or server side thing)

I suggest having a boolean config option netherportalanimation. If this is false, we do the teleport at EntityPortalEnterEvent instead so the animation doesn't happen.

Now onto the bug relating to portalsdefaulttonether, where even if its false, the player is still teleported the default nether destination. This is due to pm.getPortal(event.getPlayer(), playerPortalLoc) returning only portals with permissions to access. So if no permission, it will return null and PlayerPortalEvent will never be cancelled.

@nicegamer7

Copy link
Copy Markdown
Member Author

About the animation, that's the vanilla behaviour (animation in survival, instant in creative). I don't think I've heard of anyone who wanted to change it, but I suppose an option wouldn't hurt.

@benwoo1110

Copy link
Copy Markdown
Member

Yea, but I think it's good to have an option to not have it even in survival mode - since that was the behaviour before this PR

@nicegamer7

Copy link
Copy Markdown
Member Author

I suppose so, yeah.

@nicegamer7

Copy link
Copy Markdown
Member Author

I'll work on the config option later today, unless you want to (I might be a bit slow).

@benwoo1110

Copy link
Copy Markdown
Member

Very busy with school, will review it when you add it 😄

@nicegamer7

Copy link
Copy Markdown
Member Author

I completely forgot this was MV Portals (I was thinking MV NetherPortals the whole time 🤦‍♂️). Now I understand why the config option would be nice lol.

@benwoo1110

Copy link
Copy Markdown
Member

HAHA yea I mix them up at times too

@benwoo1110 benwoo1110 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, config option will be done in a separate pr.

@benwoo1110 benwoo1110 merged commit db15ea9 into main May 11, 2021
@nicegamer7 nicegamer7 deleted the fix_legacy_detection branch May 11, 2021 16:18
@Phoenix616

Copy link
Copy Markdown

Looks good, config option will be done in a separate pr.

Is this still planed? I actually have some players being confused about portals no longer teleporting directly if it is using nether portal blocks. 👀

@nicegamer7

Copy link
Copy Markdown
Member Author

Yes, it's still planned. Albeit I did forget about it. Thanks for the reminder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Portal generating where I do not want it to

3 participants