style: 更改类名
更改类名
This commit is contained in:
@@ -3,7 +3,7 @@ plugins {
|
||||
}
|
||||
|
||||
group 'cn.hamster3.mc.plugin'
|
||||
version '1.0.0'
|
||||
version '0.0.1-SNAPSHOT'
|
||||
|
||||
subprojects {
|
||||
apply plugin: 'java-library'
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package cn.hamster3.mc.plugin.core.bukkit;
|
||||
|
||||
import cn.hamster3.mc.plugin.core.bukkit.page.listener.PageListener;
|
||||
import cn.hamster3.mc.plugin.core.common.constant.ConstantObjects;
|
||||
import cn.hamster3.mc.plugin.core.common.constant.CoreConstantObjects;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
@@ -39,9 +39,9 @@ public class HamsterCorePlugin extends JavaPlugin {
|
||||
public void onDisable() {
|
||||
long start = System.currentTimeMillis();
|
||||
getLogger().info("仓鼠核心正在关闭...");
|
||||
ConstantObjects.WORKER_EXECUTOR.shutdownNow();
|
||||
CoreConstantObjects.WORKER_EXECUTOR.shutdownNow();
|
||||
getLogger().info("已暂停 WORKER_EXECUTOR.");
|
||||
ConstantObjects.SCHEDULED_EXECUTOR.shutdownNow();
|
||||
CoreConstantObjects.SCHEDULED_EXECUTOR.shutdownNow();
|
||||
getLogger().info("已暂停 SCHEDULED_EXECUTOR.");
|
||||
long time = System.currentTimeMillis() - start;
|
||||
getLogger().info("仓鼠核心已关闭,总计耗时 " + time + " ms.");
|
||||
|
@@ -7,7 +7,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.concurrent.*;
|
||||
|
||||
public interface ConstantObjects {
|
||||
public interface CoreConstantObjects {
|
||||
/**
|
||||
* GSON 工具
|
||||
*/
|
||||
@@ -23,6 +23,10 @@ public interface ConstantObjects {
|
||||
.serializeNulls()
|
||||
.setPrettyPrinting()
|
||||
.create();
|
||||
/**
|
||||
* JSON 解析器
|
||||
*/
|
||||
JsonParser JSON_PARSER = new JsonParser();
|
||||
|
||||
/**
|
||||
* 调度器线程
|
@@ -1,6 +1,6 @@
|
||||
package cn.hamster3.mc.plugin.core.common.data;
|
||||
|
||||
import cn.hamster3.mc.plugin.core.common.constant.ConstantObjects;
|
||||
import cn.hamster3.mc.plugin.core.common.constant.CoreConstantObjects;
|
||||
import cn.hamster3.mc.plugin.core.common.util.SerializeUtils;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
@@ -215,6 +215,6 @@ public class Message {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return ConstantObjects.GSON.toJson(this);
|
||||
return CoreConstantObjects.GSON.toJson(this);
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package cn.hamster3.mc.plugin.core.common.thread;
|
||||
|
||||
import cn.hamster3.mc.plugin.core.common.constant.ConstantObjects;
|
||||
import cn.hamster3.mc.plugin.core.common.constant.CoreConstantObjects;
|
||||
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@@ -23,7 +23,7 @@ public abstract class CountdownThread implements Runnable {
|
||||
}
|
||||
|
||||
public void start(long initialDelay) {
|
||||
future = ConstantObjects.SCHEDULED_EXECUTOR.scheduleWithFixedDelay(this, initialDelay, interval, TimeUnit.MILLISECONDS);
|
||||
future = CoreConstantObjects.SCHEDULED_EXECUTOR.scheduleWithFixedDelay(this, initialDelay, interval, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package cn.hamster3.mc.plugin.core.common.util;
|
||||
|
||||
import cn.hamster3.mc.plugin.core.common.constant.ConstantObjects;
|
||||
import cn.hamster3.mc.plugin.core.common.constant.CoreConstantObjects;
|
||||
import com.google.gson.JsonObject;
|
||||
import net.kyori.adventure.key.Key;
|
||||
import net.kyori.adventure.sound.Sound;
|
||||
@@ -28,8 +28,8 @@ public class SerializeUtils {
|
||||
public static Title deserializeTitle(@NotNull JsonObject object) {
|
||||
if (object.has("times")) {
|
||||
return Title.title(
|
||||
ConstantObjects.GSON.fromJson(object.get("title"), Component.class),
|
||||
ConstantObjects.GSON.fromJson(object.get("subtitle"), Component.class),
|
||||
CoreConstantObjects.GSON.fromJson(object.get("title"), Component.class),
|
||||
CoreConstantObjects.GSON.fromJson(object.get("subtitle"), Component.class),
|
||||
deserializeTitleTimes(object.getAsJsonObject("times"))
|
||||
);
|
||||
} else {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package cn.hamster3.mc.plugin.core.proxy;
|
||||
|
||||
import cn.hamster3.mc.plugin.core.common.constant.ConstantObjects;
|
||||
import cn.hamster3.mc.plugin.core.common.constant.CoreConstantObjects;
|
||||
import net.md_5.bungee.api.plugin.Plugin;
|
||||
|
||||
public class HamsterCorePlugin extends Plugin {
|
||||
@@ -27,9 +27,9 @@ public class HamsterCorePlugin extends Plugin {
|
||||
public void onDisable() {
|
||||
long start = System.currentTimeMillis();
|
||||
getLogger().info("仓鼠核心正在关闭...");
|
||||
ConstantObjects.WORKER_EXECUTOR.shutdownNow();
|
||||
CoreConstantObjects.WORKER_EXECUTOR.shutdownNow();
|
||||
getLogger().info("已暂停 WORKER_EXECUTOR.");
|
||||
ConstantObjects.SCHEDULED_EXECUTOR.shutdownNow();
|
||||
CoreConstantObjects.SCHEDULED_EXECUTOR.shutdownNow();
|
||||
getLogger().info("已暂停 SCHEDULED_EXECUTOR.");
|
||||
long time = System.currentTimeMillis() - start;
|
||||
getLogger().info("仓鼠核心已关闭,总计耗时 " + time + " ms.");
|
||||
|
Reference in New Issue
Block a user