Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix portal hack not triggering #386

Merged
merged 2 commits into from
May 1, 2024
Merged

Fix portal hack not triggering #386

merged 2 commits into from
May 1, 2024

Conversation

okx-code
Copy link
Contributor

If you are falling really fast, you will be falling multiple blocks per second, and could possibly pass straight through an end portal. This fix changes the hack to use an event triggered earlier to detect if a player passes through an end portal.

If you are falling really fast, you will be falling multiple blocks per second, and could possibly pass straight through an end portal. This fix changes the hack to use an event triggered earlier to detect if a player passes through an end portal.
Copy link
Contributor

badge

Build Successful! You can find a link to the downloadable artifact below.

Name Link
Commit 12ba7dc
Logs https://github.com/CivMC/Civ/actions/runs/8398628066
Download https://github.com/CivMC/Civ/suites/22025258680/artifacts/

Comment on lines +64 to 72
public void onTick(ServerTickEndEvent event) {
for (Map.Entry<Player, Location> entry : teleports.entrySet()) {
entry.getKey().teleport(entry.getValue(), PlayerTeleportEvent.TeleportCause.END_PORTAL);
if (entry.getValue().getWorld().getName().equals(targetWorld)) {
spawnExit(entry.getValue());
}
}
teleports.clear();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it ever possible that this event can be fired simultaneously, such as during low TPS? If so I could imagine it causing some problems, and potentially more players falling through portals than before.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Simultaneously with what? It runs at the end of a tick.

@RedDevel2 RedDevel2 merged commit 01cb330 into main May 1, 2024
2 checks passed
@RedDevel2 RedDevel2 deleted the fix-portals branch May 3, 2024 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants