From 7820b1434463820bf5efc53341a29f8e80750628 Mon Sep 17 00:00:00 2001 From: carm Date: Sat, 22 Feb 2025 10:20:34 +0800 Subject: [PATCH] build(deps): Update with EasyConfiguration --- common/pom.xml | 2 +- platform/bukkit/pom.xml | 2 +- .../bukkit/source/BukkitSection.java | 23 ++++++++++--------- platform/bungee/pom.xml | 2 +- platform/velocity/pom.xml | 2 +- pom.xml | 4 ++-- 6 files changed, 18 insertions(+), 17 deletions(-) diff --git a/common/pom.xml b/common/pom.xml index 9adb3f2..c313dd7 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -5,7 +5,7 @@ mineconfiguration-parent cc.carm.lib - 3.0.0 + 3.0.1 4.0.0 diff --git a/platform/bukkit/pom.xml b/platform/bukkit/pom.xml index 546a765..6f944e1 100644 --- a/platform/bukkit/pom.xml +++ b/platform/bukkit/pom.xml @@ -5,7 +5,7 @@ mineconfiguration-parent cc.carm.lib - 3.0.0 + 3.0.1 ../../pom.xml 4.0.0 diff --git a/platform/bukkit/src/main/java/cc/carm/lib/mineconfiguration/bukkit/source/BukkitSection.java b/platform/bukkit/src/main/java/cc/carm/lib/mineconfiguration/bukkit/source/BukkitSection.java index 08dcbf1..d87c256 100644 --- a/platform/bukkit/src/main/java/cc/carm/lib/mineconfiguration/bukkit/source/BukkitSection.java +++ b/platform/bukkit/src/main/java/cc/carm/lib/mineconfiguration/bukkit/source/BukkitSection.java @@ -6,7 +6,6 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.UnmodifiableView; -import java.util.List; import java.util.Map; import java.util.Set; @@ -56,25 +55,27 @@ public class BukkitSection implements ConfigureSection { data().set(path, null); } - @Override - public boolean contains(@NotNull String path) { - return data().contains(path); - } - - @Override - public @Nullable List getList(@NotNull String path) { - return data().getList(path); - } - @Override public @Nullable ConfigureSection getSection(@NotNull String path) { Object value = get(path); if (value instanceof ConfigureSection) { return (ConfigureSection) value; + } else if (value instanceof ConfigurationSection) { + return new BukkitSection(source(), this, (ConfigurationSection) value); } return null; } + @Override + public @NotNull ConfigureSection createSection(@NotNull Map data) { + throw new UnsupportedOperationException("BukkitSection does not support this operation"); + } + + @Override + public @NotNull ConfigureSection computeSection(@NotNull String path) { + return new BukkitSection(source(), this, data.createSection(path)); + } + @Override public @Nullable Object get(@NotNull String path) { Object value = data().get(path); diff --git a/platform/bungee/pom.xml b/platform/bungee/pom.xml index cdb6e05..e76277b 100644 --- a/platform/bungee/pom.xml +++ b/platform/bungee/pom.xml @@ -5,7 +5,7 @@ mineconfiguration-parent cc.carm.lib - 3.0.0 + 3.0.1 ../../pom.xml 4.0.0 diff --git a/platform/velocity/pom.xml b/platform/velocity/pom.xml index c011424..d4cf02d 100644 --- a/platform/velocity/pom.xml +++ b/platform/velocity/pom.xml @@ -5,7 +5,7 @@ mineconfiguration-parent cc.carm.lib - 3.0.0 + 3.0.1 ../../pom.xml 4.0.0 diff --git a/pom.xml b/pom.xml index 25f6d69..f2280d9 100644 --- a/pom.xml +++ b/pom.xml @@ -10,14 +10,14 @@ UTF-8 UTF-8 - 4.0.2 + 4.0.6 1.2.0 1.5.12 cc.carm.lib mineconfiguration-parent - 3.0.0 + 3.0.1 pom common