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

Simplify world blacklist loading #4638

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Warriorrrr
Copy link
Contributor

Mainly just a bit of refactoring, this PR makes world blacklist loading a lot simpler/better readable.

Also adds isWorldBlacklisted(String) which isn't used anywhere, but potentially useful for anyone hooking into mcMMO.

Copy link
Contributor

@TheBusyBiscuit TheBusyBiscuit left a comment

Choose a reason for hiding this comment

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

Some nitpickings.

I highly urge you to look into that Locale issue though.
This can lead to a lot of unexpected results and issues down the line if it gets overlooked.

If you need any documents outlining this particular issue, I'd recommend you to give this a read: https://wiki.sei.cmu.edu/confluence/display/java/STR02-J.+Specify+an+appropriate+locale+when+comparing+locale-dependent+data

Copy link
Contributor

@TheBusyBiscuit TheBusyBiscuit 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 addressing the concerns I mentioned, seems like you missed one line though


while((currentLine = reader.readLine()) != null)
if (!currentLine.isEmpty())
blacklist.add(currentLine.toLowerCase());
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
blacklist.add(currentLine.toLowerCase());
blacklist.add(currentLine.toLowerCase(Locale.ROOT));

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.

None yet

2 participants