-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleaned up documentation and added events (thanks Paul)
- Loading branch information
1 parent
0521d47
commit 1c47aa0
Showing
27 changed files
with
141 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
## Events | ||
|
||
### PreGenerateWorldEvent | ||
This event is called when the #generateWorld method is first ran either through an API call or through the plugin. | ||
The SlimeWorld is exposed and can be modified. The event is not cancellable. | ||
|
||
### PostGenerateWorldEvent | ||
This event is called after the #generateWorld method is ran either through an API call or through the plugin. | ||
The SlimeWorld is exposed and can be modified. The event is not cancellable. |
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
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
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
31 changes: 31 additions & 0 deletions
31
swoftyworldmanager-api/src/main/java/net/swofty/swm/api/events/PostGenerateWorldEvent.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,31 @@ | ||
package net.swofty.swm.api.events; | ||
|
||
import net.swofty.swm.api.world.SlimeWorld; | ||
import org.bukkit.event.Event; | ||
import org.bukkit.event.HandlerList; | ||
|
||
import java.util.Objects; | ||
|
||
public class PostGenerateWorldEvent extends Event { | ||
|
||
private static final HandlerList handlers = new HandlerList(); | ||
private final SlimeWorld slimeWorld; | ||
|
||
public PostGenerateWorldEvent(SlimeWorld slimeWorld) { | ||
super(false); | ||
this.slimeWorld = Objects.requireNonNull(slimeWorld, "slimeWorld cannot be null"); | ||
} | ||
|
||
public static HandlerList getHandlerList() { | ||
return handlers; | ||
} | ||
|
||
@Override | ||
public HandlerList getHandlers() { | ||
return handlers; | ||
} | ||
|
||
public SlimeWorld getSlimeWorld() { | ||
return slimeWorld; | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
swoftyworldmanager-api/src/main/java/net/swofty/swm/api/events/PreGenerateWorldEvent.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,45 @@ | ||
package net.swofty.swm.api.events; | ||
|
||
import lombok.Getter; | ||
import net.swofty.swm.api.world.SlimeWorld; | ||
import org.bukkit.event.Cancellable; | ||
import org.bukkit.event.Event; | ||
import org.bukkit.event.HandlerList; | ||
|
||
import java.util.Objects; | ||
|
||
public class PreGenerateWorldEvent extends Event implements Cancellable { | ||
|
||
private static final HandlerList handlers = new HandlerList(); | ||
private boolean isCancelled; | ||
@Getter | ||
private SlimeWorld slimeWorld; | ||
|
||
public PreGenerateWorldEvent(SlimeWorld slimeWorld) { | ||
super(false); | ||
this.slimeWorld = Objects.requireNonNull(slimeWorld, "slimeWorld cannot be null"); | ||
} | ||
|
||
public static HandlerList getHandlerList() { | ||
return handlers; | ||
} | ||
|
||
@Override | ||
public HandlerList getHandlers() { | ||
return handlers; | ||
} | ||
|
||
@Override | ||
public boolean isCancelled() { | ||
return this.isCancelled; | ||
} | ||
|
||
@Override | ||
public void setCancelled(boolean cancelled) { | ||
this.isCancelled = cancelled; | ||
} | ||
|
||
public void setSlimeWorld(SlimeWorld slimeWorld) { | ||
this.slimeWorld = Objects.requireNonNull(slimeWorld, "slimeWorld cannot be null"); | ||
} | ||
} |
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
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
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