Skip to content

Commit

Permalink
Add Command Manager and README guid
Browse files Browse the repository at this point in the history
  • Loading branch information
Gk0Wk committed Mar 26, 2021
1 parent ae5b17d commit bfd2984
Show file tree
Hide file tree
Showing 10 changed files with 394 additions and 9 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 牛腩小镇
Copyright (c) 2021 Gk0Wk(Sttot)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
53 changes: 52 additions & 1 deletion README.md
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'
}
```
1 change: 0 additions & 1 deletion NewNanKits.iml → Violet.iml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<configuration>
<autoDetectTypes>
<platformType>BUKKIT</platformType>
<platformType>SPIGOT</platformType>
</autoDetectTypes>
</configuration>
</facet>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>io.github.gk0wk</groupId>
<artifactId>Violet</artifactId>
<version>1.0.4</version>
<version>1.0.5</version>
<packaging>jar</packaging>
<name>Violet</name>
<url>https://gk0wk.github.io/</url>
Expand Down
35 changes: 35 additions & 0 deletions src/main/java/io/github/gk0wk/violet/command/CommandContainer.java
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 src/main/java/io/github/gk0wk/violet/command/CommandHandler.java
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;
}
Loading

0 comments on commit bfd2984

Please sign in to comment.