-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Conversation
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.
Build Successful! You can find a link to the downloadable artifact below.
|
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(); | ||
} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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.