build: 优化依赖

This commit is contained in:
2023-10-12 14:51:42 +08:00
parent 46997d6c17
commit b4eed3133b
9 changed files with 50 additions and 105 deletions

View File

@@ -1,6 +1,7 @@
package cn.hamster3.mc.plugin.core.common.api;
import com.google.gson.Gson;
import lombok.Getter;
import net.kyori.adventure.platform.AudienceProvider;
import org.jetbrains.annotations.NotNull;
@@ -12,12 +13,9 @@ import java.util.concurrent.ScheduledExecutorService;
@SuppressWarnings("unused")
public abstract class CoreAPI {
@Getter
protected static CoreAPI instance;
public static CoreAPI getInstance() {
return instance;
}
@NotNull
public abstract AudienceProvider getAudienceProvider();
@@ -32,20 +30,24 @@ public abstract class CoreAPI {
/**
* @return GSON 工具
*/
@NotNull
public abstract Gson getGson();
/**
* @return GSON 工具会使用格式化输出、且解析中包含null参数
*/
@NotNull
public abstract Gson getHumanGson();
/**
* @return 异步线程池
*/
@NotNull
public abstract ExecutorService getExecutorService();
/**
* @return 调度器线程池
*/
@NotNull
public abstract ScheduledExecutorService getScheduledExecutorService();
}