From 5ae88349b4f6be7c82efaeed6108c7ab0c01a2a1 Mon Sep 17 00:00:00 2001 From: Florian CUNY Date: Thu, 9 Aug 2018 16:40:21 +0200 Subject: [PATCH] Removed purge-related events (unused) --- .../events/purge/PurgeDeleteIslandEvent.java | 22 ----- .../api/events/purge/PurgeStartEvent.java | 85 ------------------- 2 files changed, 107 deletions(-) delete mode 100644 src/main/java/world/bentobox/bentobox/api/events/purge/PurgeDeleteIslandEvent.java delete mode 100644 src/main/java/world/bentobox/bentobox/api/events/purge/PurgeStartEvent.java diff --git a/src/main/java/world/bentobox/bentobox/api/events/purge/PurgeDeleteIslandEvent.java b/src/main/java/world/bentobox/bentobox/api/events/purge/PurgeDeleteIslandEvent.java deleted file mode 100644 index 060b3ab24..000000000 --- a/src/main/java/world/bentobox/bentobox/api/events/purge/PurgeDeleteIslandEvent.java +++ /dev/null @@ -1,22 +0,0 @@ -package world.bentobox.bentobox.api.events.purge; - -import world.bentobox.bentobox.api.events.IslandBaseEvent; -import world.bentobox.bentobox.database.objects.Island; - -/** - * This event is fired before an island is going to be purged. - * Canceling this event will prevent the plugin to remove the island. - * - * @author Poslovitch - * @since 1.0 - */ -public class PurgeDeleteIslandEvent extends IslandBaseEvent { - - /** - * Called to create the event - * @param island - island that will be removed - */ - public PurgeDeleteIslandEvent(Island island) { - super(island); - } -} diff --git a/src/main/java/world/bentobox/bentobox/api/events/purge/PurgeStartEvent.java b/src/main/java/world/bentobox/bentobox/api/events/purge/PurgeStartEvent.java deleted file mode 100644 index e44d7dd33..000000000 --- a/src/main/java/world/bentobox/bentobox/api/events/purge/PurgeStartEvent.java +++ /dev/null @@ -1,85 +0,0 @@ -package world.bentobox.bentobox.api.events.purge; - -import java.util.List; -import java.util.UUID; - -import org.bukkit.event.Cancellable; - -import world.bentobox.bentobox.api.events.PremadeEvent; - -/** - * This event is fired when islands to remove have been chosen and before starting to remove them. - * You can remove or add islands to remove. - * Canceling this event will cancel the purge - * - * @author Poslovitch - * @since 1.0 - */ -public class PurgeStartEvent extends PremadeEvent implements Cancellable { - private boolean cancelled; - - private final UUID user; - private List islandsList; - - /** - * Called to create the event - * @param user - the User - the UUID of the player who launched the purge, may be null if purge is launched using the console. - * @param islandsList - the list of islands to remove, based on their leader's UUID - */ - public PurgeStartEvent(UUID user, List islandsList) { - this.user = user; - this.islandsList = islandsList; - } - - /** - * @return the user who launched the purge, may be null if purge is launched using the console. - */ - public UUID getUser( ){ - return user; - } - - /** - * @return the list of islands to remove, based on their leader's UUID - */ - public List getIslandsList() { - return islandsList; - } - - /** - * Convenience method to directly add an island owner's UUID to the list - * @param islandOwner - the owner's UUID from the island to remove - */ - public void add(UUID islandOwner) { - if(!islandsList.contains(islandOwner)) { - islandsList.add(islandOwner); - } - } - - /** - * Convenience method to directly remove an island owner's UUID to the list - * @param islandOwner - the owner's UUID from the island to remove - */ - public void remove(UUID islandOwner) { - if(islandsList.contains(islandOwner)) { - islandsList.remove(islandOwner); - } - } - - /** - * Replace the island list - * @param islandsList - a new island owners' UUIDs list - */ - public void setIslandsList(List islandsList) { - this.islandsList = islandsList; - } - - @Override - public boolean isCancelled() { - return cancelled; - } - - @Override - public void setCancelled(boolean cancel) { - cancelled = cancel; - } -}