Skip to content

server list ping determination bug fix#2831

Open
MC-Samuel wants to merge 4 commits into
DenizenScript:devfrom
MC-Samuel:PaperServerListPingEvent-fix
Open

server list ping determination bug fix#2831
MC-Samuel wants to merge 4 commits into
DenizenScript:devfrom
MC-Samuel:PaperServerListPingEvent-fix

Conversation

@MC-Samuel

Copy link
Copy Markdown
Contributor

Fixes a bug where the number of players on the server wouldn't update when changed with the EXCLUDE_PLAYERS determination.

Reported at https://discord.com/channels/315163488085475337/1522089160108675073

}
return false;
});
event.setNumPlayers(event.getNumPlayers() - counter.intValue());

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.

This looks good, but missing one check:
If a plugin modified the player count to something else already we don't want to mess with that, so should start by checking if NumPlayers is the same as listed.size(), and only decrease NumPlayers if it is.

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.

2 participants