-
-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
344 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
src/main/java/com/iridium/iridiumskyblock/api/IslandCreateEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
package com.iridium.iridiumskyblock.api; | ||
|
||
import com.iridium.iridiumskyblock.configs.Schematics; | ||
import com.iridium.iridiumskyblock.database.User; | ||
import lombok.Getter; | ||
import org.bukkit.event.Cancellable; | ||
import org.bukkit.event.Event; | ||
import org.bukkit.event.HandlerList; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
@Getter | ||
|
||
public class IslandCreateEvent extends Event implements Cancellable { | ||
|
||
private static final HandlerList handlers = new HandlerList(); | ||
private boolean cancelled; | ||
@Nullable | ||
private String islandName; | ||
@NotNull | ||
private final User user; | ||
@NotNull | ||
private Schematics.SchematicConfig schematicConfig; | ||
|
||
public IslandCreateEvent(@NotNull User user, @Nullable String islandName, Schematics.@NotNull SchematicConfig schematicConfig) { | ||
this.islandName = islandName; | ||
this.user = user; | ||
this.schematicConfig = schematicConfig; | ||
} | ||
|
||
@NotNull | ||
public HandlerList getHandlers() { | ||
return handlers; | ||
} | ||
|
||
@NotNull | ||
public static HandlerList getHandlerList() { | ||
return handlers; | ||
} | ||
|
||
@Override | ||
public void setCancelled(boolean cancelled) { | ||
this.cancelled = cancelled; | ||
} | ||
|
||
/** | ||
* The name of the Island.<br> | ||
* null indicates that the name of the Player is used as the Island name | ||
* because it hasn't been set. | ||
* | ||
* @return the name of the Island or null | ||
*/ | ||
@Nullable | ||
public String getIslandName() { | ||
return islandName; | ||
} | ||
|
||
/** | ||
* | ||
* Sets the name of the Island.<br> | ||
* set it to null to default to the player's name | ||
* | ||
* @param islandName The name of the island | ||
*/ | ||
public void setIslandName(@Nullable String islandName) { | ||
this.islandName = islandName; | ||
} | ||
|
||
/** | ||
* Sets the schematic of the new island | ||
* | ||
* @param schematicConfig The schematic configuration of the island | ||
*/ | ||
|
||
public void setSchematicConfig(Schematics.@NotNull SchematicConfig schematicConfig) { | ||
this.schematicConfig = schematicConfig; | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
src/main/java/com/iridium/iridiumskyblock/api/IslandDeleteEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.iridium.iridiumskyblock.api; | ||
|
||
import com.iridium.iridiumskyblock.database.Island; | ||
import com.iridium.iridiumskyblock.database.User; | ||
import lombok.Getter; | ||
import org.bukkit.event.Cancellable; | ||
import org.bukkit.event.Event; | ||
import org.bukkit.event.HandlerList; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
@Getter | ||
public class IslandDeleteEvent extends Event implements Cancellable { | ||
|
||
private static final HandlerList handlers = new HandlerList(); | ||
private boolean cancelled; | ||
@NotNull private final Island island; | ||
@NotNull private final User user; | ||
|
||
public IslandDeleteEvent(@NotNull Island island, @NotNull User user) { | ||
this.island = island; | ||
this.user = user; | ||
} | ||
|
||
@NotNull | ||
public HandlerList getHandlers() { | ||
return handlers; | ||
} | ||
|
||
@NotNull | ||
public static HandlerList getHandlerList() { | ||
return handlers; | ||
} | ||
|
||
@Override | ||
public void setCancelled(boolean cancelled) { | ||
this.cancelled = cancelled; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.