-
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.
- Loading branch information
Showing
10 changed files
with
394 additions
and
9 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
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,3 +1,54 @@ | ||
# Violet | ||
# Violet [![](https://www.jitpack.io/v/NewNanCity/Violet.svg)](https://www.jitpack.io/#NewNanCity/Violet) [![](https://img.shields.io/badge/Join-NewNanCity-yellow)](https://www.newnan.city) | ||
|
||
Useful toolkits java library for Bukkit Server Plugin. | ||
|
||
- [x] ConfigManager | ||
- [x] MessageManager (i18n Supported) | ||
- [x] LanguageManager | ||
- [x] CommandManager (Deprecated, and recommend to use [aikar's commands](https://github.com/aikar/commands)) | ||
|
||
## How to add Violet to your project | ||
|
||
## Maven | ||
|
||
Add the JitPack repository to your build file: | ||
|
||
```xml | ||
<repositories> | ||
<repository> | ||
<id>jitpack.io</id> | ||
<url>https://www.jitpack.io</url> | ||
</repository> | ||
</repositories> | ||
``` | ||
|
||
Add the dependency: | ||
|
||
```xml | ||
<dependency> | ||
<groupId>com.github.NewNanCity</groupId> | ||
<artifactId>Violet</artifactId> | ||
<version>VERSION</version> | ||
</dependency> | ||
``` | ||
|
||
Gradle | ||
|
||
Add it in your root build.gradle at the end of repositories: | ||
|
||
``` | ||
allprojects { | ||
repositories { | ||
... | ||
maven { url 'https://www.jitpack.io' } | ||
} | ||
} | ||
``` | ||
|
||
Add the dependency: | ||
|
||
``` | ||
dependencies { | ||
implementation 'com.github.NewNanCity:Violet:1.0.4' | ||
} | ||
``` |
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
35 changes: 35 additions & 0 deletions
35
src/main/java/io/github/gk0wk/violet/command/CommandContainer.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,35 @@ | ||
package io.github.gk0wk.violet.command; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
|
||
import javax.annotation.Nullable; | ||
|
||
/** | ||
* 同时也可以解析plugin.yml的内容 | ||
*/ | ||
@Deprecated | ||
class CommandContainer { | ||
public final String token; | ||
public final String permission; | ||
public final String usageSuggestion; | ||
public final String permissionMessage; | ||
public final String description; | ||
public final String[] aliases; | ||
public final boolean hidden; | ||
public final boolean consoleAllowable; | ||
public final CommandHandler handler; | ||
|
||
public CommandContainer(@NotNull String token, @Nullable String permission, @NotNull String usageSuggestion, | ||
@NotNull String description, @Nullable String permissionMessage, boolean hidden, | ||
boolean consoleAllowable, @Nullable String[] aliases, @Nullable CommandHandler handler) { | ||
this.token = token; | ||
this.permission = permission; | ||
this.usageSuggestion = usageSuggestion; | ||
this.permissionMessage = permissionMessage; | ||
this.description = description; | ||
this.aliases = aliases; | ||
this.hidden = hidden; | ||
this.consoleAllowable = consoleAllowable; | ||
this.handler = handler; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/io/github/gk0wk/violet/command/CommandHandler.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,18 @@ | ||
package io.github.gk0wk.violet.command; | ||
|
||
import org.bukkit.command.Command; | ||
import org.bukkit.command.CommandSender; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
@Deprecated | ||
public interface CommandHandler { | ||
/** | ||
* 执行某个命令 | ||
* @param sender 发送指令者的实例 | ||
* @param command 被执行的指令实例 | ||
* @param token 指令的标识字符串 | ||
* @param args 指令的参数 | ||
*/ | ||
void executeCommand(@NotNull CommandSender sender, @NotNull Command command, | ||
@NotNull String token, @NotNull String[] args) throws Exception; | ||
} |
Oops, something went wrong.