-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[+] Added DiceRollEvent for other plugins to hook into.
- Loading branch information
Loapu
committed
Nov 11, 2021
1 parent
049cf6d
commit 59d82b6
Showing
13 changed files
with
91 additions
and
12 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 |
---|---|---|
|
@@ -20,5 +20,5 @@ jobs: | |
git config user.name github-actions | ||
git config user.email [email protected] | ||
git fetch origin gh-pages --depth=1 | ||
mike deploy --push --update-aliases 2.2 latest | ||
mike deploy --push --update-aliases 2.3 latest | ||
mike set-default --push latest |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
hide: | ||
- navigation | ||
--- | ||
# Developer API | ||
|
||
### DiceRollEvent | ||
As of version `2.3.0` VestriaDice fires a custom `DiceRollEvent` every time a dice is rolled by a player. This event is cancellable and allows you to get the player rolling the dice, the result and the modifier. As of now these values are not modifiable but you can use them if you wish. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
pluginGroup=dev.loapu | ||
pluginName=VestriaDice | ||
pluginPrefix=VD | ||
pluginVersion=2.2.0 | ||
pluginVersion=2.3.0 | ||
pluginBuildNumber=177 | ||
pluginApiVersion=1.17 | ||
pluginAuthor=Loapu | ||
pluginDescription=A Pen-and-Paper-like dice rolling system inside Minecraft. | ||
pluginHomepage=https://docs.loapu.dev/VestriaDice/ | ||
projectEncoding=UTF-8 | ||
versionPaper=1.17-R0.1-SNAPSHOT | ||
versionCommandApi=6.3.0 | ||
versionCommandApi=6.3.1 | ||
versionMiniMessage=4.1.0-SNAPSHOT | ||
versionJava=16 |
Binary file not shown.
Binary file not shown.
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
62 changes: 62 additions & 0 deletions
62
src/main/java/dev/loapu/vestriadice/events/DiceRollEvent.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,62 @@ | ||
package dev.loapu.vestriadice.events; | ||
|
||
import org.bukkit.entity.Player; | ||
import org.bukkit.event.Cancellable; | ||
import org.bukkit.event.Event; | ||
import org.bukkit.event.HandlerList; | ||
|
||
public class DiceRollEvent extends Event implements Cancellable | ||
{ | ||
private static final HandlerList HANDLERS = new HandlerList(); | ||
|
||
private final Player player; | ||
private final int result; | ||
private final short modifier; | ||
private boolean isCancelled; | ||
|
||
public DiceRollEvent(Player player, int result, short modifier) | ||
{ | ||
this.player = player; | ||
this.result = result; | ||
this.modifier = modifier; | ||
} | ||
|
||
@Override | ||
public HandlerList getHandlers() | ||
{ | ||
return HANDLERS; | ||
} | ||
|
||
public static HandlerList getHandlerList() | ||
{ | ||
return HANDLERS; | ||
} | ||
|
||
@Override | ||
public boolean isCancelled() | ||
{ | ||
return this.isCancelled; | ||
} | ||
|
||
@Override | ||
public void setCancelled(boolean isCancelled) { | ||
this.isCancelled = isCancelled; | ||
} | ||
|
||
public Player getPlayer() | ||
{ | ||
return player; | ||
} | ||
|
||
public int getResult() | ||
{ | ||
return result; | ||
} | ||
|
||
public short getModifier() | ||
{ | ||
return modifier; | ||
} | ||
|
||
|
||
} |