mirror of
https://github.com/Crazy-Crew/CrazyAuctions.git
synced 2025-01-08 19:38:15 +01:00
Add the config.yml
This commit is contained in:
parent
ae1401f00b
commit
abc28d901b
@ -1,20 +1,38 @@
|
|||||||
package com.badbones69.crazyauctions;
|
package com.badbones69.crazyauctions;
|
||||||
|
|
||||||
|
import com.badbones69.crazyauctions.configs.Config;
|
||||||
|
import net.dehya.ruby.PaperManager;
|
||||||
|
import net.dehya.ruby.RubyCore;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
import java.nio.file.Path;
|
||||||
|
|
||||||
public class CrazyAuctions extends JavaPlugin {
|
public class CrazyAuctions extends JavaPlugin implements RubyCore {
|
||||||
|
|
||||||
private static CrazyAuctions plugin;
|
private static CrazyAuctions plugin;
|
||||||
|
|
||||||
|
private final PaperManager paperManager = new PaperManager(this, true);;
|
||||||
|
|
||||||
public CrazyAuctions() {
|
public CrazyAuctions() {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
|
try {
|
||||||
|
Field api = Provider.class.getDeclaredField("api");
|
||||||
|
api.setAccessible(true);
|
||||||
|
api.set(null, this);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
|
||||||
|
getServer().getPluginManager().disablePlugin(this);
|
||||||
|
}
|
||||||
|
|
||||||
plugin = this;
|
plugin = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
|
Config.reload(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -22,7 +40,21 @@ public class CrazyAuctions extends JavaPlugin {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public @NotNull Path getDirectory() {
|
||||||
|
return getDataFolder().toPath();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public @NotNull Boolean isFileModuleActivated() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public static CrazyAuctions getPlugin() {
|
public static CrazyAuctions getPlugin() {
|
||||||
return plugin;
|
return plugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public PaperManager getPaperManager() {
|
||||||
|
return this.paperManager;
|
||||||
|
}
|
||||||
}
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package com.badbones69.crazyauctions.configs;
|
||||||
|
|
||||||
|
import com.badbones69.crazyauctions.CrazyAuctions;
|
||||||
|
import net.dehya.ruby.common.annotations.FileBuilder;
|
||||||
|
import net.dehya.ruby.common.annotations.yaml.Comment;
|
||||||
|
import net.dehya.ruby.common.annotations.yaml.Header;
|
||||||
|
import net.dehya.ruby.common.annotations.yaml.Key;
|
||||||
|
import net.dehya.ruby.common.enums.FileType;
|
||||||
|
import net.dehya.ruby.files.FileExtension;
|
||||||
|
|
||||||
|
@FileBuilder(isLogging = true, isAsync = true, isData = false, fileType = FileType.YAML)
|
||||||
|
@Header("""
|
||||||
|
Discord: https://discord.gg/crazycrew
|
||||||
|
Github: https://github.com/Crazy-Crew
|
||||||
|
|
||||||
|
Report Issues: https://github.com/Crazy-Crew/CrazyAuctions/issues
|
||||||
|
Request Features/Support: https://github.com/orgs/Crazy-Crew/discussions
|
||||||
|
""")
|
||||||
|
public class Config extends FileExtension {
|
||||||
|
|
||||||
|
@Key("settings.toggle-metrics")
|
||||||
|
@Comment("Whether metrics are sent to https://bstats.org or not.")
|
||||||
|
public static boolean TOGGLE_METRICS = true;
|
||||||
|
|
||||||
|
public Config() {
|
||||||
|
super("config.yml");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void reload(CrazyAuctions plugin) {
|
||||||
|
plugin.getPaperManager().getPaperFileManager().addFile(new Config());
|
||||||
|
}
|
||||||
|
}
|
8
platforms/paper/src/main/resources/config.yml
Normal file
8
platforms/paper/src/main/resources/config.yml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# Discord: https://discord.gg/crazycrew
|
||||||
|
# Github: https://github.com/Crazy-Crew
|
||||||
|
#
|
||||||
|
# Report Issues: https://github.com/Crazy-Crew/CrazyAuctions/issues
|
||||||
|
# Request Features/Support: https://github.com/orgs/Crazy-Crew/discussions
|
||||||
|
|
||||||
|
settings:
|
||||||
|
toggle-metrics: true # Whether metrics are sent to https://bstats.org or not.
|
Loading…
Reference in New Issue
Block a user