Project files

This commit is contained in:
Dawson
2022-08-08 14:53:33 -04:00
parent 26813fc4d4
commit 58b49a8976
134 changed files with 15530 additions and 0 deletions
@@ -0,0 +1,28 @@
package dev.brighten.ac.utils;
import lombok.AllArgsConstructor;
import org.bukkit.plugin.Plugin;
@AllArgsConstructor
public class ConfigDefault<A> {
private final A defaultValue;
private final String path;
private final Plugin plugin;
public A get() {
if(plugin.getConfig().get(path) != null)
return (A) plugin.getConfig().get(path);
else {
plugin.getConfig().set(path, defaultValue);
plugin.saveConfig();
return defaultValue;
}
}
public A set(A value) {
plugin.getConfig().set(path, value);
return value;
}
}