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

impl. Island Delete Event #736

Closed
wants to merge 2 commits into from
Closed

impl. Island Delete Event #736

wants to merge 2 commits into from

Conversation

lackoSK
Copy link

@lackoSK lackoSK commented Aug 21, 2023

No description provided.

@@ -208,6 +209,8 @@ public void deleteTeam(Island island, User user) {
IridiumSkyblock.getInstance().getDatabaseManager().getIslandTableManager().delete(island);

getMembersOnIsland(island).forEach(member -> PlayerUtils.teleportSpawn(member.getPlayer()));

Bukkit.getPluginManager().callEvent(new IslandDeleteEvent(island, user));
Copy link
Contributor

Choose a reason for hiding this comment

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

Should check the return value and not call the delete methods if the event is cancelled (hence calling it before like 209 with a if statement about the cancelled state

Bukkit.getPluginManager().callEvent(islandDeleteEvent);

if (islandDeleteEvent.isCancelled()) {
return;
Copy link
Member

Choose a reason for hiding this comment

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

might be worth modifying this method to return a boolean.

In Teams, https://github.com/Iridium-Development/IridiumTeams/blob/master/src/main/java/com/iridium/iridiumteams/commands/DeleteCommand.java#L62 we will still send the deleted message. if this returns a boolean we can optionally send that.

Would require changing the https://github.com/Iridium-Development/IridiumTeams/blob/master/src/main/java/com/iridium/iridiumteams/managers/TeamManager.java#L89 Interface.

Feel free to open a PR in teams yourself, or ill do it myself over the weekend

@lackoSK lackoSK closed this by deleting the head repository Sep 10, 2023
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.

3 participants