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

Add commands and storage #8

Merged
merged 2 commits into from Jan 11, 2020
Merged

Add commands and storage #8

merged 2 commits into from Jan 11, 2020

Conversation

sgdc3
Copy link
Contributor

@sgdc3 sgdc3 commented Jan 8, 2020

No description provided.

Copy link
Member

@tastybento tastybento left a 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());
Copy link
Member

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.

Copy link
Contributor Author

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);
Copy link
Member

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()));

Copy link
Contributor Author

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

@sgdc3
Copy link
Contributor Author

sgdc3 commented Jan 10, 2020

I'm currently running it on my server without issues

@tastybento tastybento merged commit 6c5406b into BentoBoxWorld:master Jan 11, 2020
@tastybento
Copy link
Member

Thanks!

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