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
Add commands and storage #8
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.
Looks fine. How much testing have you done?
public void run() { | ||
handler.saveObject(data); | ||
} | ||
}.runTaskAsynchronously(getPlugin()); |
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.
SaveObject is async so this wouldn't be required. Doesn't harm though.
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.
Nah, I'll remove it as it's a waste of resources
if (!data.isEnabled()) { | ||
return; | ||
} | ||
Island island = getPlugin().getIslands().getIslandAt(location).orElse(null); |
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.
You can also just do:
getPlugin().getIslands().getIslandAt(location).ifPresent(island -> worldBorderApi.setBorder(player, island.getProtectionRange() * 2, island.getCenter()));
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.
I know, I personally try to avoid optionals in simple scenarios
I'm currently running it on my server without issues |
Thanks! |
No description provided.