From 3a4d180094c5e14dcc72de2dd1a3766d8b0a7fa5 Mon Sep 17 00:00:00 2001 From: qscbm187531 <1309635304@qq.com> Date: Sun, 1 Oct 2023 15:21:35 +0800 Subject: [PATCH 1/2] upload --- .../dodoopenjava/permissions/Permissions.java | 14 +++----------- .../dodoopenjava/permissions/data/PermData.java | 5 ++--- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/permissions/src/main/java/io/github/minecraftchampions/dodoopenjava/permissions/Permissions.java b/permissions/src/main/java/io/github/minecraftchampions/dodoopenjava/permissions/Permissions.java index 6e2ec751..c0645bf6 100644 --- a/permissions/src/main/java/io/github/minecraftchampions/dodoopenjava/permissions/Permissions.java +++ b/permissions/src/main/java/io/github/minecraftchampions/dodoopenjava/permissions/Permissions.java @@ -8,7 +8,7 @@ * 权限系统核心 */ public class Permissions { - public static PermData permData = new PermData(); + public static PermData permData = null; public static DataType type; public static boolean initialized; @@ -89,16 +89,8 @@ public void run() { while (true) { try { Thread.sleep(10 * 60 * 60); - switch (Permissions.type.getType()) { - case "YAML" -> permData.saveToFile(); - case "JSON" -> permData.saveToFile(); - case "Xml" -> permData.saveToFile(); - case "Toml" -> permData.saveToFile(); - default -> System.err.println("错误的存储种类"); - } - } catch (InterruptedException e) { - e.printStackTrace(); - } catch (IOException e) { + permData.saveToFile(); + } catch (IOException | InterruptedException e) { throw new RuntimeException(e); } } diff --git a/permissions/src/main/java/io/github/minecraftchampions/dodoopenjava/permissions/data/PermData.java b/permissions/src/main/java/io/github/minecraftchampions/dodoopenjava/permissions/data/PermData.java index 81674687..1e5f1606 100644 --- a/permissions/src/main/java/io/github/minecraftchampions/dodoopenjava/permissions/data/PermData.java +++ b/permissions/src/main/java/io/github/minecraftchampions/dodoopenjava/permissions/data/PermData.java @@ -6,10 +6,9 @@ /** * 存储实例 */ -public class PermData { +public abstract class PermData { public File User; public File Group; - public void saveToFile() throws IOException { - } + public abstract void saveToFile() throws IOException; } From 850e8bcc1d014c4dbd1cfd195fd5ab89d28124fe Mon Sep 17 00:00:00 2001 From: qscbm187531 <1309635304@qq.com> Date: Sun, 1 Oct 2023 19:02:24 +0800 Subject: [PATCH 2/2] upload Co-Authored-By: KisssStar <141255211+KisssStar@users.noreply.github.com> --- .../dodoopenjava/card/component/Component.java | 4 +++- pom.xml | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/io/github/minecraftchampions/dodoopenjava/card/component/Component.java b/core/src/main/java/io/github/minecraftchampions/dodoopenjava/card/component/Component.java index 1e5e92fb..64b5f9e2 100644 --- a/core/src/main/java/io/github/minecraftchampions/dodoopenjava/card/component/Component.java +++ b/core/src/main/java/io/github/minecraftchampions/dodoopenjava/card/component/Component.java @@ -2,10 +2,12 @@ import org.json.JSONObject; +import java.io.Serializable; + /** * 组件 */ -public class Component { +public abstract class Component implements Serializable { protected JSONObject jsonCard = new JSONObject(); /** diff --git a/pom.xml b/pom.xml index 7364662f..2e17bc32 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ UTF-8 UTF-8 UTF-8 - 2.5.11 + 2.5.12 io.github.minecraftchampions.dodoopenjava