-
-
Notifications
You must be signed in to change notification settings - Fork 867
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
base: master
Are you sure you want to change the base?
Simplify world blacklist loading #4638
Conversation
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.
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
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.
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()); |
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.
blacklist.add(currentLine.toLowerCase()); | |
blacklist.add(currentLine.toLowerCase(Locale.ROOT)); |
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.