mirror of
https://github.com/Crazy-Crew/CrazyAuctions.git
synced 2025-01-22 21:41:28 +01:00
remove common module
This commit is contained in:
parent
c705274c18
commit
c761419c78
@ -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")
|
||||
}
|
||||
}
|
@ -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;
|
||||
}
|
||||
}
|
@ -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;
|
||||
}
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
package com.ryderbelserion.crazyauctions.platform;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public interface Server {
|
||||
|
||||
File getFolder();
|
||||
|
||||
}
|
@ -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<Boolean> 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<Boolean> toggle_metrics = newProperty("root.toggle_metrics", true);
|
||||
|
||||
@Comment("The prefix that appears in front of messages.")
|
||||
public static final Property<String> prefix = newProperty("root.prefix", "<dark_gray>[<blue>CrazyAuctions<dark_gray>]: ");
|
||||
}
|
Loading…
Reference in New Issue
Block a user