Configurable coefficients and reload command

This commit is contained in:
Sofiane H. Djerbi 2023-04-26 21:31:23 +03:00
commit 452e8ceb23
5 changed files with 56 additions and 3 deletions

View file

@ -1,15 +1,32 @@
package xyz.hynse.foliaflow;
import org.bukkit.plugin.java.JavaPlugin;
import xyz.hynse.foliaflow.command.ReloadCommand;
import xyz.hynse.foliaflow.watcher.PortalWatcher;
public class FoliaFlow extends JavaPlugin {
public static FoliaFlow instance;
public static double horizontalCoefficient;
public static double verticalCoefficient;
@Override
public void onEnable() {
instance = this;
register();
reload();
}
public void reload() {
saveDefaultConfig();
reloadConfig();
horizontalCoefficient = getConfig().getDouble("horizontal_coefficient");
verticalCoefficient = getConfig().getDouble("vertical_coefficient");
}
private void register() {
getCommand("flowreload").setExecutor(new ReloadCommand());
getServer().getPluginManager().registerEvents(new PortalWatcher(), this);
}
}