diff --git a/common/build.gradle.kts b/common/build.gradle.kts deleted file mode 100644 index 0986fd7..0000000 --- a/common/build.gradle.kts +++ /dev/null @@ -1,13 +0,0 @@ -plugins { - id("root-plugin") -} - -dependencies { - compileOnlyApi(libs.bundles.adventure) - - compileOnly(libs.cluster.api) - - api(libs.configme) { - exclude(group = "org.yaml", module = "snakeyaml") - } -} \ No newline at end of file diff --git a/common/src/main/java/com/ryderbelserion/crazyauctions/CrazyAuctions.java b/common/src/main/java/com/ryderbelserion/crazyauctions/CrazyAuctions.java deleted file mode 100644 index ff3cc2e..0000000 --- a/common/src/main/java/com/ryderbelserion/crazyauctions/CrazyAuctions.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.ryderbelserion.crazyauctions; - -import ch.jalu.configme.SettingsManager; -import ch.jalu.configme.SettingsManagerBuilder; -import ch.jalu.configme.resource.YamlFileResourceOptions; -import com.ryderbelserion.crazyauctions.platform.impl.Config; -import com.ryderbelserion.crazyauctions.platform.Server; -import java.io.File; - -public class CrazyAuctions { - - private final Server server; - - private final SettingsManager config; - - public CrazyAuctions(Server server) { - this.server = server; - - - // Create config files - YamlFileResourceOptions builder = YamlFileResourceOptions.builder().indentationSize(2).build(); - - this.config = SettingsManagerBuilder - .withYamlFile(new File(server.getFolder(), "config.yml"), builder) - .useDefaultMigrationService() - .configurationData(Config.class) - .create(); - - // Register provider. - CrazyProvider.register(this); - } - - public void reload() { - // Reload the config. - this.config.reload(); - } - - public void disable() { - // Save the config. - this.config.save(); - - // Unregister provider. - CrazyProvider.unregister(); - } - - public Server getServer() { - return this.server; - } - - public SettingsManager getConfig() { - return this.config; - } -} \ No newline at end of file diff --git a/common/src/main/java/com/ryderbelserion/crazyauctions/CrazyProvider.java b/common/src/main/java/com/ryderbelserion/crazyauctions/CrazyProvider.java deleted file mode 100644 index 0675624..0000000 --- a/common/src/main/java/com/ryderbelserion/crazyauctions/CrazyProvider.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.ryderbelserion.crazyauctions; - -public final class CrazyProvider { - - private static CrazyAuctions instance; - - private CrazyProvider() { - throw new UnsupportedOperationException("This class cannot be instantiated"); - } - - public static CrazyAuctions get() { - if (instance == null) { - throw new IllegalStateException("CrazyAuctions is not loaded."); - } - - return instance; - } - - static void register(final CrazyAuctions instance) { - if (get() != null) { - return; - } - - CrazyProvider.instance = instance; - } - - static void unregister() { - CrazyProvider.instance = null; - } -} \ No newline at end of file diff --git a/common/src/main/java/com/ryderbelserion/crazyauctions/platform/Server.java b/common/src/main/java/com/ryderbelserion/crazyauctions/platform/Server.java deleted file mode 100644 index 504cc39..0000000 --- a/common/src/main/java/com/ryderbelserion/crazyauctions/platform/Server.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.ryderbelserion.crazyauctions.platform; - -import java.io.File; - -public interface Server { - - File getFolder(); - -} \ No newline at end of file diff --git a/common/src/main/java/com/ryderbelserion/crazyauctions/platform/impl/Config.java b/common/src/main/java/com/ryderbelserion/crazyauctions/platform/impl/Config.java deleted file mode 100644 index 1971c9e..0000000 --- a/common/src/main/java/com/ryderbelserion/crazyauctions/platform/impl/Config.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.ryderbelserion.crazyauctions.platform.impl; - -import ch.jalu.configme.Comment; -import ch.jalu.configme.SettingsHolder; -import ch.jalu.configme.configurationdata.CommentsConfiguration; -import ch.jalu.configme.properties.Property; -import org.jetbrains.annotations.NotNull; -import static ch.jalu.configme.properties.PropertyInitializer.newProperty; - -public class Config implements SettingsHolder { - - - @Override - public void registerComments(@NotNull CommentsConfiguration conf) { - String[] header = { - "Support: https://discord.gg/badbones-s-live-chat-182615261403283459", - "Github: https://github.com/Crazy-Crew", - "", - "Issues: https://github.com/Crazy-Crew/CrazyAuctions/issues", - "Features: https://github.com/Crazy-Crew/CrazyAuctions/issues", - "", - "Sounds: https://jd.papermc.io/paper/1.20/org/bukkit/Sound.html", - "Enchantments: https://jd.papermc.io/paper/1.20/org/bukkit/enchantments/Enchantment.html" - }; - - conf.setComment("root", header); - } - - @Comment("Whether you want CrazyAuctions to shut up or not.") - public static final Property verbose_logging = newProperty("root.verbose_logging", true); - - @Comment({ - "Sends anonymous statistics about how the plugin is used to bstats.org.", - "bstats is a service for plugin developers to find out how the plugin being used,", - "This information helps us figure out how to better improve the plugin." - }) - public static final Property toggle_metrics = newProperty("root.toggle_metrics", true); - - @Comment("The prefix that appears in front of messages.") - public static final Property prefix = newProperty("root.prefix", "[CrazyAuctions]: "); -} \ No newline at end of file