mirror of
https://github.com/Crazy-Crew/CrazyAuctions.git
synced 2025-01-22 21:41:28 +01:00
It now is using the proper API
This commit is contained in:
parent
bcce34d9c1
commit
16e172d0e0
@ -7,7 +7,7 @@ paper = "1.19.3-R0.1-SNAPSHOT"
|
||||
adventure = "4.12.0"
|
||||
|
||||
# RubyCore
|
||||
ruby = "0.0.1.1"
|
||||
ruby = "0.0.1.2"
|
||||
|
||||
[libraries]
|
||||
|
||||
|
@ -3,18 +3,23 @@ package com.badbones69.crazyauctions;
|
||||
import com.badbones69.crazyauctions.api.economy.vault.VaultSupport;
|
||||
import com.badbones69.crazyauctions.api.enums.PluginSupport;
|
||||
import com.badbones69.crazyauctions.configs.Config;
|
||||
import net.dehya.ruby.PaperManager;
|
||||
import net.dehya.ruby.PaperRuby;
|
||||
import net.dehya.ruby.RubyCore;
|
||||
import net.dehya.ruby.command.RubyCommand;
|
||||
import net.dehya.ruby.player.RubyPlayerRegistry;
|
||||
import net.dehya.ruby.registry.senders.types.Console;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import java.lang.reflect.Field;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class CrazyAuctions extends JavaPlugin implements RubyCore {
|
||||
|
||||
private static CrazyAuctions plugin;
|
||||
|
||||
private final PaperManager paperManager = new PaperManager(this, true);
|
||||
private final PaperRuby paperRuby = new PaperRuby(this);
|
||||
|
||||
private final PluginSupport pluginSupport;
|
||||
|
||||
@ -58,16 +63,31 @@ public class CrazyAuctions extends JavaPlugin implements RubyCore {
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Boolean isFileModuleActivated() {
|
||||
return true;
|
||||
public @NotNull Console getConsole() {
|
||||
return this.paperRuby.getConsole();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull RubyPlayerRegistry getPlayerRegistry() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull List<RubyCommand> getCommands() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull String getPrefix() {
|
||||
return Config.PREFIX;
|
||||
}
|
||||
|
||||
public static CrazyAuctions getPlugin() {
|
||||
return plugin;
|
||||
}
|
||||
|
||||
public PaperManager getPaperManager() {
|
||||
return this.paperManager;
|
||||
public PaperRuby getPaperManager() {
|
||||
return this.paperRuby;
|
||||
}
|
||||
|
||||
public PluginSupport getPluginSupport() {
|
||||
|
@ -1,34 +0,0 @@
|
||||
package com.badbones69.crazyauctions.configs.convert;
|
||||
|
||||
import com.badbones69.crazyauctions.CrazyAuctions;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
public class ConfigConversion {
|
||||
|
||||
private final CrazyAuctions plugin = CrazyAuctions.getPlugin();
|
||||
|
||||
public void convertConfig() {
|
||||
File file = new File(this.plugin.getDataFolder() + "/config.yml");
|
||||
|
||||
File secondFile = new File(this.plugin.getDataFolder() + "/config-v1.yml");
|
||||
|
||||
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(file);
|
||||
|
||||
if (yamlConfiguration.getString("Settings.Config-Version") == null && !secondFile.exists()) {
|
||||
this.plugin.getLogger().warning("Could not find Config-Version, I am assuming configurations have been converted.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (file.renameTo(secondFile)) this.plugin.getLogger().warning("Renamed " + file.getName() + " to config-v1.yml");
|
||||
|
||||
YamlConfiguration secondConfiguration = YamlConfiguration.loadConfiguration(secondFile);
|
||||
|
||||
try {
|
||||
yamlConfiguration.save(file);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user