mirror of
https://github.com/SimplexDevelopment/Traverse.git
synced 2025-07-04 16:36:41 +00:00
Fishnets and Baubles
This commit is contained in:
@ -1,8 +1,7 @@
|
||||
package mc.unraveled.reforged.config;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.SneakyThrows;
|
||||
import mc.unraveled.reforged.plugin.Traverse;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.InvalidConfigurationException;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@ -11,7 +10,6 @@ import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
public class YamlManager {
|
||||
private final List<Yaml> configurations = new ArrayList<>();
|
||||
private final Traverse plugin;
|
||||
@ -20,6 +18,14 @@ public class YamlManager {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
public List<Yaml> getConfigurations() {
|
||||
return configurations;
|
||||
}
|
||||
|
||||
public Traverse getPlugin() {
|
||||
return plugin;
|
||||
}
|
||||
|
||||
public Builder bldr() {
|
||||
return new Builder(plugin);
|
||||
}
|
||||
@ -32,14 +38,20 @@ public class YamlManager {
|
||||
configurations.remove(yaml);
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
public void load(@NotNull Yaml yaml) {
|
||||
yaml.load(yaml.getYamlFile());
|
||||
try {
|
||||
yaml.load(yaml.getYamlFile());
|
||||
} catch (IOException | InvalidConfigurationException e) {
|
||||
Bukkit.getLogger().severe("Failed to load " + yaml.getYamlFile().getName() + "!");
|
||||
}
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
public void save(@NotNull Yaml yaml) {
|
||||
yaml.save(yaml.getYamlFile());
|
||||
try {
|
||||
yaml.save(yaml.getYamlFile());
|
||||
} catch (IOException e) {
|
||||
Bukkit.getLogger().severe("Failed to save " + yaml.getYamlFile().getName() + "!");
|
||||
}
|
||||
}
|
||||
|
||||
public void loadAll() {
|
||||
|
Reference in New Issue
Block a user