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

Reset offline players on next spawn #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lukas-licek
Copy link

No description provided.

@fitfrost4

This comment was marked as spam.

Copy link
Owner

@qixils qixils left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution!

Comment on lines -350 to -354
@EventHandler(priority = EventPriority.LOWEST)
public void onPlayerRespawn(PlayerRespawnEvent event) {
Location destination = event.getRespawnLocation();
if (destination.getWorld().getKey().equals(REAL_OVERWORLD_KEY))
event.setRespawnLocation(fakeOverworld().getSpawnLocation());
Copy link
Owner

Choose a reason for hiding this comment

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

?

player.getEnderChest().clear();
player.setLevel(0);
player.setExp(0);
player.teleport(new Location(world, 0, 100, 0));
Copy link
Owner

Choose a reason for hiding this comment

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

world here is only used for their final destination, which is overridden by the new usage, so might as well just pass in the Location directly instead of the World. Could do the same for gamemode as well but that involves much less resources so not as worried about it.

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.

3 participants