From 96385ae88945e6fb523690bb40b979a3d600049e Mon Sep 17 00:00:00 2001 From: Draycia Date: Sun, 18 Oct 2020 00:00:46 -0700 Subject: [PATCH] Bump Configurate --- .../commands/settings/CommandSettingsRegistry.java | 8 ++++---- .../draycia/carbon/api/config/CarbonSettings.java | 8 ++++---- .../carbon/api/config/CarbonTranslations.java | 8 ++++---- .../draycia/carbon/api/config/ChannelSettings.java | 8 ++++---- .../carbon/api/config/ModerationSettings.java | 8 ++++---- .../net/draycia/carbon/bukkit/CarbonChatBukkit.java | 13 ++++++------- .../draycia/carbon/common/config/KeySerializer.java | 8 ++++---- .../carbon/common/config/SoundSerializer.java | 8 ++++---- 8 files changed, 34 insertions(+), 35 deletions(-) diff --git a/CarbonChat-API/src/main/java/net/draycia/carbon/api/commands/settings/CommandSettingsRegistry.java b/CarbonChat-API/src/main/java/net/draycia/carbon/api/commands/settings/CommandSettingsRegistry.java index 67724cbd..a667a9f9 100644 --- a/CarbonChat-API/src/main/java/net/draycia/carbon/api/commands/settings/CommandSettingsRegistry.java +++ b/CarbonChat-API/src/main/java/net/draycia/carbon/api/commands/settings/CommandSettingsRegistry.java @@ -7,8 +7,8 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.configurate.CommentedConfigurationNode; import org.spongepowered.configurate.objectmapping.ConfigSerializable; import org.spongepowered.configurate.objectmapping.ObjectMapper; -import org.spongepowered.configurate.objectmapping.ObjectMappingException; import org.spongepowered.configurate.objectmapping.meta.Setting; +import org.spongepowered.configurate.serialize.SerializationException; import java.util.HashMap; import java.util.Iterator; @@ -26,16 +26,16 @@ public class CommandSettingsRegistry implements Registry { public static final KeySerializer INSTANCE = new KeySerializer(); @@ -38,15 +38,15 @@ public final class KeySerializer extends ScalarSerializer { } @Override - public Key deserialize(final Type type, final Object obj) throws ObjectMappingException { + public Key deserialize(final Type type, final Object obj) throws SerializationException { if (!(obj instanceof CharSequence)) { - throw new ObjectMappingException("Invalid type presented to serializer: " + type); + throw new SerializationException("Invalid type presented to serializer: " + type); } try { return Key.key(obj.toString()); } catch(final InvalidKeyException ex) { - throw new ObjectMappingException(ex); + throw new SerializationException(ex); } } diff --git a/CarbonChat-Common/src/main/java/net/draycia/carbon/common/config/SoundSerializer.java b/CarbonChat-Common/src/main/java/net/draycia/carbon/common/config/SoundSerializer.java index 260fc68a..12ede5bb 100644 --- a/CarbonChat-Common/src/main/java/net/draycia/carbon/common/config/SoundSerializer.java +++ b/CarbonChat-Common/src/main/java/net/draycia/carbon/common/config/SoundSerializer.java @@ -29,7 +29,7 @@ import net.kyori.adventure.sound.Sound; import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.configurate.ConfigurationNode; -import org.spongepowered.configurate.objectmapping.ObjectMappingException; +import org.spongepowered.configurate.serialize.SerializationException; import org.spongepowered.configurate.serialize.TypeSerializer; import java.lang.reflect.Type; @@ -49,7 +49,7 @@ public final class SoundSerializer implements TypeSerializer { } @Override - public @Nullable Sound deserialize(@NonNull final Type type, @NonNull final ConfigurationNode value) throws ObjectMappingException { + public @Nullable Sound deserialize(@NonNull final Type type, @NonNull final ConfigurationNode value) throws SerializationException { if (value.empty()) { return null; } @@ -60,14 +60,14 @@ public final class SoundSerializer implements TypeSerializer { final float pitch = value.node(PITCH).getFloat(1.0f); if (name == null || source == null) { - throw new ObjectMappingException("A name and source are required to deserialize a Sound"); + throw new SerializationException("A name and source are required to deserialize a Sound"); } return Sound.sound(name, source, volume, pitch); } @Override - public void serialize(@NonNull final Type type, @Nullable final Sound obj, @NonNull final ConfigurationNode value) throws ObjectMappingException { + public void serialize(@NonNull final Type type, @Nullable final Sound obj, @NonNull final ConfigurationNode value) throws SerializationException { if (obj == null) { value.set(null); return;