forked from JorelAli/CommandAPI
-
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.
Create base for a "delayed commands" example project
See JorelAli#451
- Loading branch information
1 parent
4a1b42b
commit ece9477
Showing
4 changed files
with
72 additions
and
0 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 @@ | ||
# Delayed Commands | ||
|
||
A simple example showcasing various ways to implement "delayed commands" with the CommandAPI. This was inspired by [#451](https://github.com/JorelAli/CommandAPI/issues/451). While delayed commands are not directly implemented in the CommandAPI, this example aims to show various ways to add them yourself. Developers are encouraged to find solutions that fit their own needs, perhaps adding them to this project for others to use. | ||
|
||
### What is a "delayed command"? | ||
|
||
Per the [original issue](https://github.com/JorelAli/CommandAPI/issues/451), a delayed command is limited to only run once within a certain time period. This can prevent users from spamming commands that might perform CPU-intensive tasks. This creates a delay between executions of a command, hence, a "delayed command". | ||
|
||
### TODO: Write some examples and explain them |
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,47 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>dev.jorel</groupId> | ||
<artifactId>commandapi-trees</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
|
||
<repositories> | ||
<!-- This adds the Spigot Maven repository to the build --> | ||
<repository> | ||
<id>spigot-repo</id> | ||
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url> | ||
</repository> | ||
</repositories> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>dev.jorel</groupId> | ||
<artifactId>commandapi-bukkit-core</artifactId> | ||
<version>9.0.2</version> | ||
</dependency> | ||
|
||
<!--This adds the Spigot API artifact to the build --> | ||
<dependency> | ||
<groupId>org.spigotmc</groupId> | ||
<artifactId>spigot-api</artifactId> | ||
<version>1.19.4-R0.1-SNAPSHOT</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<defaultGoal>clean package</defaultGoal> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.11.0</version> | ||
<configuration> | ||
<release>17</release> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
10 changes: 10 additions & 0 deletions
10
examples/bukkit/delayed-commands/src/main/java/io/github/jorelali/Main.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,10 @@ | ||
package io.github.jorelali; | ||
|
||
import org.bukkit.plugin.java.JavaPlugin; | ||
|
||
public class Main extends JavaPlugin { | ||
@Override | ||
public void onEnable() { | ||
// TODO: Write some commands | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
examples/bukkit/delayed-commands/src/main/resources/plugin.yml
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,6 @@ | ||
name: DelayedCommands | ||
main: io.github.jorelali.Main | ||
version: 0.0.1 | ||
website: https://www.jorel.dev/CommandAPI/ | ||
api-version: 1.13 | ||
depend: [CommandAPI] |