Skip to content

Commit

Permalink
refactor(proj): 放弃spigot项目,将Bukkit子项目单独提出。
Browse files Browse the repository at this point in the history
  • Loading branch information
CarmJos committed Dec 16, 2022
1 parent 02f59b9 commit 6793109
Show file tree
Hide file tree
Showing 41 changed files with 72 additions and 308 deletions.
29 changes: 10 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,44 +20,35 @@ EasyConfiguration for MineCraft!

## 项目结构

### **MineConfiguration-Common**
### **MineConfiguration-Common** [`common`](common)

全部版本的共用部分,包括
全部版本的共用部分(均已被打包至下行包中),包括

- `ConfigMessage` (实现类为 `ConfiguredMessage<M>`)
- `ConfigMessageList` (实现类为 `ConfiguredMessageList<M>`)

如要使用,请访问对应实现类的builder() 方法来快速创建。

### MineConfiguration-Bukkit
### **MineConfiguration-Bukkit** [`platform/bukkit`](platform/bukkit)

#### MineConfiguration-Bukkit-Base

Bukkit系通用依赖,不包含实现部分,请使用 **MineConfiguration-Bukkit-General****MineConfiguration-Bukkit-Native**
适用于Bukkit的版本,同时支持其他以Bukkit为基础的服务端 *(如Spigot、Paper、CatServer)*

相较于基础版本,额外提供了以下功能:

- `ConfiguredSerializable<T extends ConfigurationSerializable>`
- `ConfiguredItem` (快捷读取简单的物品配置文件)
- `ConfiguredSound` (快捷读取音效配置文件)
- `ConfiguredItem` (快捷读\写\使用简单的物品配置文件)
- `ConfiguredSound` (快捷读\写\使用音效配置文件)
- `ConfiguredTitle` (快速读\写\使用标题文字配置文件)

以上类型可以通过 `CraftConfigValue.builder()` 来创建,部分类型提供了 `of(...);` 方法来快速创建。

#### **MineConfiguration-Bukkit** _(推荐)_

适用于Bukkit的版本,包含以Bukkit为基础的其他服务端 *(如Spigot、Paper、CatServer)*

#### **MineConfiguration-Spigot**

适用于 Spigot(1.18+) 的版本,适配了1.18及以后版本Spigot原生自带的配置文件注释功能,随Spigot更新而优化,安全稳定。

### **MineConfiguration-Bungee**
### **MineConfiguration-Bungee** [`platform/bungee`](platform/bungee)

适用于BungeeCord的版本,可用JSON与YAML格式。其中JSON格式**不支持配置文件注释**

## 开发

请详见 [EasyConfiguration](https://github.com/CarmJos/EasyConfiguration)
其他功能请详见 [EasyConfiguration](https://github.com/CarmJos/EasyConfiguration)
[开发介绍](https://github.com/CarmJos/EasyConfiguration/tree/master/.documentation)

### 依赖方式
Expand Down Expand Up @@ -113,7 +104,7 @@ Bukkit系通用依赖,不包含实现部分,请使用 **MineConfiguration-Bu
<version>[LATEST RELEASE]</version>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>cc.carm.lib</groupId>
<artifactId>mineconfiguration-spigot</artifactId>
Expand Down
7 changes: 6 additions & 1 deletion common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,20 @@
<parent>
<artifactId>mineconfiguration-parent</artifactId>
<groupId>cc.carm.lib</groupId>
<version>2.2.1</version>
<version>2.3.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<properties>
<maven.compiler.source>${project.jdk.version}</maven.compiler.source>
<maven.compiler.target>${project.jdk.version}</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
</properties>
<artifactId>mineconfiguration-common</artifactId>

<name>MineConfiguration-Common</name>
<description>轻松(做)配置,全部版本的共用部分。</description>

<dependencies>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,26 @@ default void sendToEach(@Nullable Predicate<R> limiter,
}
}


/**
* 广播此消息(包括后台)
*
* @param values 已定变量的对应参数(按定义顺序)
*/
default void sendToAll(@Nullable Object... values) {
broadcast(values);
}

/**
* 广播此消息(包括后台)
*
* @param placeholders 消息中的变量与对应参数
*/
default void sendToAll(@NotNull Map<String, Object> placeholders) {
broadcast(placeholders);
}


/**
* 广播此消息(包括后台)
*
Expand Down
38 changes: 0 additions & 38 deletions platform/bukkit/base/pom.xml

This file was deleted.

41 changes: 0 additions & 41 deletions platform/bukkit/general/pom.xml

This file was deleted.

31 changes: 23 additions & 8 deletions platform/bukkit/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,31 @@
<parent>
<artifactId>mineconfiguration-parent</artifactId>
<groupId>cc.carm.lib</groupId>
<version>2.2.1</version>
<version>2.3.0</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<properties>
<maven.compiler.source>${project.jdk.version}</maven.compiler.source>
<maven.compiler.target>${project.jdk.version}</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
</properties>
<artifactId>mineconfiguration-bukkit-parent</artifactId>
<packaging>pom</packaging>
<modules>
<module>base</module>
<module>general</module>
</modules>
<artifactId>mineconfiguration-bukkit</artifactId>
<packaging>jar</packaging>

<name>MineConfiguration-Bukkit-Parent</name>
<name>MineConfiguration-Bukkit</name>
<description>轻松(做)配置,适用于Bukkit系服务端的版本。</description>

<dependencies>

<dependency>
<groupId>${project.parent.groupId}</groupId>
<artifactId>mineconfiguration-common</artifactId>
<version>${project.parent.version}</version>
<scope>compile</scope>
</dependency>

<!--suppress VulnerableLibrariesLocal -->
<dependency>
<groupId>org.bukkit</groupId>
Expand All @@ -50,4 +56,13 @@

</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public CraftConfigValue(@Nullable CraftConfigProvider provider, @Nullable String
public CraftConfigProvider getBukkitProvider() {
ConfigurationProvider<?> provider = getProvider();
if (provider instanceof CraftConfigProvider) return (CraftConfigProvider) getProvider();
else throw new IllegalStateException("Provider is not a SpigotConfigProvider");
else throw new IllegalStateException("Provider is not a CraftConfigProvider");
}

public CraftSectionWrapper getBukkitConfig() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ public static BukkitConfigProvider from(Plugin plugin, String fileName) {
public static BukkitConfigProvider from(Plugin plugin, String fileName, String source) {
return from(new File(plugin.getDataFolder(), fileName), source);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,15 @@ public void send(@NotNull Player player, @NotNull Map<String, Object> placeholde
}
}

public void sendAll(Object... values) {
sendAll(this.params, values);
public void sendToAll(Object... values) {
sendToAll(this.params, values);
}

public void sendAll(@NotNull String[] params, @NotNull Object[] values) {
sendAll(ParamsUtils.buildParams(params, values));
public void sendToAll(@NotNull String[] params, @NotNull Object[] values) {
sendToAll(ParamsUtils.buildParams(params, values));
}

public void sendAll(@NotNull Map<String, Object> placeholders) {
public void sendToAll(@NotNull Map<String, Object> placeholders) {
TitleConfig config = get();
if (config == null) return;

Expand Down
7 changes: 5 additions & 2 deletions platform/bungee/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,22 @@
<parent>
<artifactId>mineconfiguration-parent</artifactId>
<groupId>cc.carm.lib</groupId>
<version>2.2.1</version>
<version>2.3.0</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<properties>
<maven.compiler.source>${project.jdk.version}</maven.compiler.source>
<maven.compiler.target>${project.jdk.version}</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
</properties>
<artifactId>mineconfiguration-bungee</artifactId>
<packaging>jar</packaging>

<name>MineConfiguration-Bungee</name>

<description>轻松(做)配置,适用于BungeeCord的版本,可用JSON与YAML格式。</description>

<dependencies>

<dependency>
Expand Down
67 changes: 0 additions & 67 deletions platform/spigot/pom.xml

This file was deleted.

Loading

0 comments on commit 6793109

Please sign in to comment.