mirror of
https://github.com/CarmJos/EasyPlugin.git
synced 2026-06-05 00:58:17 +08:00
Compare commits
32 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 043fb99591 | |||
| 67af1b0dd4 | |||
| 1293ce1c35 | |||
| 069e243aa2 | |||
| a598cd4051 | |||
| af1cb7ae69 | |||
| 2463e62391 | |||
| adba8d774c | |||
| b42968c9a7 | |||
| 47b97fb97b | |||
| 2d286301d3 | |||
| 061d2a5ac9 | |||
| b2c248e0ae | |||
| 6f95fb156d | |||
| 21db2f59a4 | |||
| 326434a760 | |||
| 1be0541740 | |||
| 869811dd3f | |||
| 5bcb02ddf1 | |||
| 85ffc66c61 | |||
| 000ef51afe | |||
| 1ada26a919 | |||
| 95d2921c02 | |||
| 6ec015308c | |||
| 3a3906352f | |||
| 6e52cdef7c | |||
| a186ff896c | |||
| 8b13d4358f | |||
| c6a7312e3a | |||
| 8c347525ca | |||
| 66cb00431e | |||
| ba8e2b2929 |
@@ -14,9 +14,9 @@ jobs:
|
||||
packages-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
- name: "Set up JDK"
|
||||
uses: actions/setup-java@v4
|
||||
uses: actions/setup-java@v5
|
||||
with:
|
||||
java-version: '8'
|
||||
distribution: 'adopt'
|
||||
@@ -35,9 +35,9 @@ jobs:
|
||||
github-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
- name: "Set up JDK"
|
||||
uses: actions/setup-java@v4
|
||||
uses: actions/setup-java@v5
|
||||
with:
|
||||
java-version: '8'
|
||||
distribution: 'adopt'
|
||||
@@ -112,9 +112,9 @@ jobs:
|
||||
name: "Deploy Project (Central)"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
- name: "Set up JDK"
|
||||
uses: actions/setup-java@v4
|
||||
uses: actions/setup-java@v5
|
||||
with:
|
||||
java-version: '8'
|
||||
distribution: 'adopt'
|
||||
|
||||
@@ -14,9 +14,9 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
- name: "Set up JDK"
|
||||
uses: actions/setup-java@v4
|
||||
uses: actions/setup-java@v5
|
||||
with:
|
||||
cache: maven
|
||||
java-version: '8'
|
||||
|
||||
@@ -179,9 +179,6 @@ dependencies {
|
||||
若您觉得本插件做的不错,您可以通过捐赠支持我!
|
||||
|
||||
感谢您对开源项目的支持!
|
||||
|
||||
<img height=25% width=25% src="https://raw.githubusercontent.com/CarmJos/CarmJos/main/img/donate-code.jpg" alt=""/>
|
||||
|
||||
## 开源协议
|
||||
|
||||
本项目源码采用 [The MIT License](https://opensource.org/licenses/MIT) 开源协议。
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>cc.carm.lib</groupId>
|
||||
<artifactId>easyplugin-parent</artifactId>
|
||||
<version>1.5.13</version>
|
||||
<version>1.5.14</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<properties>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>cc.carm.lib</groupId>
|
||||
<artifactId>easyplugin-parent</artifactId>
|
||||
<version>1.5.13</version>
|
||||
<version>1.5.14</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<properties>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>easyplugin-parent</artifactId>
|
||||
<groupId>cc.carm.lib</groupId>
|
||||
<version>1.5.13</version>
|
||||
<version>1.5.14</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>easyplugin-parent</artifactId>
|
||||
<groupId>cc.carm.lib</groupId>
|
||||
<version>1.5.13</version>
|
||||
<version>1.5.14</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>easyplugin-parent</artifactId>
|
||||
<groupId>cc.carm.lib</groupId>
|
||||
<version>1.5.13</version>
|
||||
<version>1.5.14</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>cc.carm.lib</groupId>
|
||||
<artifactId>easyplugin-parent</artifactId>
|
||||
<version>1.5.13</version>
|
||||
<version>1.5.14</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<properties>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>easyplugin-parent</artifactId>
|
||||
<groupId>cc.carm.lib</groupId>
|
||||
<version>1.5.13</version>
|
||||
<version>1.5.14</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>cc.carm.lib</groupId>
|
||||
<artifactId>easyplugin-parent</artifactId>
|
||||
<version>1.5.13</version>
|
||||
<version>1.5.14</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<properties>
|
||||
|
||||
@@ -17,6 +17,11 @@ public abstract class AbstractUserData<K> implements UserData<K> {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull K key() {
|
||||
return key;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param dropping true if the data is dropping, false otherwise
|
||||
*/
|
||||
|
||||
@@ -6,11 +6,6 @@ public interface UserData<K> {
|
||||
|
||||
@NotNull K key();
|
||||
|
||||
@Deprecated
|
||||
default @NotNull K getKey() {
|
||||
return key();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param dropping true if the data is dropping, false otherwise
|
||||
*/
|
||||
|
||||
@@ -68,7 +68,8 @@ public abstract class UserDataManager<K, U extends AbstractUserData<K>> implemen
|
||||
|
||||
protected abstract void saveData(@NotNull U data) throws Exception;
|
||||
|
||||
public @NotNull Map<K, U> getDataCache() {
|
||||
@Override
|
||||
public @NotNull Map<K, U> cache() {
|
||||
return dataCache;
|
||||
}
|
||||
|
||||
@@ -107,7 +108,7 @@ public abstract class UserDataManager<K, U extends AbstractUserData<K>> implemen
|
||||
@Override
|
||||
public @NotNull CompletableFuture<Boolean> save(@NotNull U user) {
|
||||
return CompletableFuture.supplyAsync(() -> {
|
||||
String identifier = serializeKey(user.getKey());
|
||||
String identifier = serializeKey(user.key());
|
||||
|
||||
try {
|
||||
long s1 = System.currentTimeMillis();
|
||||
@@ -195,12 +196,12 @@ public abstract class UserDataManager<K, U extends AbstractUserData<K>> implemen
|
||||
|
||||
@Override
|
||||
public void saveAll() {
|
||||
if (getDataCache().isEmpty()) return;
|
||||
for (U u : getDataCache().values()) {
|
||||
if (cache().isEmpty()) return;
|
||||
for (U u : cache().values()) {
|
||||
try {
|
||||
saveData(u);
|
||||
} catch (Exception e) {
|
||||
getPlugin().error("保存用户 " + serializeKey(u.getKey()) + " 数据失败,请检查相关配置!");
|
||||
getPlugin().error("保存用户 " + serializeKey(u.key()) + " 数据失败,请检查相关配置!");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@@ -209,8 +210,8 @@ public abstract class UserDataManager<K, U extends AbstractUserData<K>> implemen
|
||||
@Override
|
||||
public int unloadAll(boolean save) {
|
||||
if (save) saveAll();
|
||||
int size = getDataCache().size();
|
||||
getDataCache().clear();
|
||||
int size = cache().size();
|
||||
cache().clear();
|
||||
return size;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@ public interface UserDataRegistry<K, U extends UserData<K>> {
|
||||
|
||||
@NotNull Logger getLogger();
|
||||
|
||||
|
||||
@NotNull Map<K, U> cache();
|
||||
|
||||
default String serializeKey(@NotNull K key) {
|
||||
@@ -40,7 +39,6 @@ public interface UserDataRegistry<K, U extends UserData<K>> {
|
||||
return load(key, () -> cache);
|
||||
}
|
||||
|
||||
|
||||
@Unmodifiable
|
||||
default @NotNull Set<U> list() {
|
||||
return ImmutableSet.copyOf(cache().values());
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>easyplugin-parent</artifactId>
|
||||
<groupId>cc.carm.lib</groupId>
|
||||
<version>1.5.13</version>
|
||||
<version>1.5.14</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>easyplugin-parent</artifactId>
|
||||
<groupId>cc.carm.lib</groupId>
|
||||
<version>1.5.13</version>
|
||||
<version>1.5.14</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>easyplugin-parent</artifactId>
|
||||
<groupId>cc.carm.lib</groupId>
|
||||
<version>1.5.13</version>
|
||||
<version>1.5.14</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>easyplugin-parent</artifactId>
|
||||
<groupId>cc.carm.lib</groupId>
|
||||
<version>1.5.13</version>
|
||||
<version>1.5.14</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>easyplugin-parent</artifactId>
|
||||
<groupId>cc.carm.lib</groupId>
|
||||
<version>1.5.13</version>
|
||||
<version>1.5.14</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>easyplugin-parent</artifactId>
|
||||
<groupId>cc.carm.lib</groupId>
|
||||
<version>1.5.13</version>
|
||||
<version>1.5.14</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>easyplugin-parent</artifactId>
|
||||
<groupId>cc.carm.lib</groupId>
|
||||
<version>1.5.13</version>
|
||||
<version>1.5.14</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<groupId>cc.carm.lib</groupId>
|
||||
<artifactId>easyplugin-parent</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>1.5.13</version>
|
||||
<version>1.5.14</version>
|
||||
<modules>
|
||||
<module>base/color</module>
|
||||
<module>base/utils</module>
|
||||
@@ -117,14 +117,14 @@
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.13.2-R0.1-SNAPSHOT</version>
|
||||
<version>1.19-R0.1-20220725.090125-47</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.jetbrains</groupId>
|
||||
<artifactId>annotations</artifactId>
|
||||
<version>26.0.2</version>
|
||||
<version>26.1.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -142,7 +142,7 @@
|
||||
<dependency>
|
||||
<groupId>me.clip</groupId>
|
||||
<artifactId>placeholderapi</artifactId>
|
||||
<version>2.11.6</version>
|
||||
<version>2.12.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.MilkBowl</groupId>
|
||||
@@ -162,7 +162,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>3.5.2</version>
|
||||
<version>3.5.6</version>
|
||||
<configuration>
|
||||
<useSystemClassLoader>false</useSystemClassLoader>
|
||||
</configuration>
|
||||
@@ -170,7 +170,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.14.0</version>
|
||||
<version>3.15.0</version>
|
||||
<configuration>
|
||||
<source>${project.jdk.version}</source>
|
||||
<target>${project.jdk.version}</target>
|
||||
@@ -181,12 +181,12 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.4.2</version>
|
||||
<version>3.5.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<version>3.3.1</version>
|
||||
<version>3.4.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
@@ -203,7 +203,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-gpg-plugin</artifactId>
|
||||
<version>3.2.7</version>
|
||||
<version>3.2.8</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>sign-artifacts</id>
|
||||
@@ -223,7 +223,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-release-plugin</artifactId>
|
||||
<version>3.1.1</version>
|
||||
<version>3.3.1</version>
|
||||
<configuration>
|
||||
<autoVersionSubmodules>true</autoVersionSubmodules>
|
||||
<useReleaseProfile>false</useReleaseProfile>
|
||||
@@ -237,7 +237,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>3.11.2</version>
|
||||
<version>3.12.0</version>
|
||||
<configuration>
|
||||
<classifier>javadoc</classifier>
|
||||
<detectJavaApiLink>false</detectJavaApiLink>
|
||||
@@ -258,7 +258,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.6.0</version>
|
||||
<version>3.6.2</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
@@ -302,7 +302,7 @@
|
||||
<plugin>
|
||||
<groupId>org.sonatype.central</groupId>
|
||||
<artifactId>central-publishing-maven-plugin</artifactId>
|
||||
<version>0.7.0</version>
|
||||
<version>0.10.0</version>
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<publishingServerId>central</publishingServerId>
|
||||
|
||||
@@ -2,5 +2,12 @@
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"extends": [
|
||||
"config:recommended"
|
||||
],
|
||||
"packageRules": [
|
||||
{
|
||||
"matchUpdateTypes": ["minor", "patch"],
|
||||
"matchCurrentVersion": "!/^0/",
|
||||
"automerge": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user