config is now an util class

This commit is contained in:
2024-11-03 15:29:50 +01:00
parent 55e77cbdf8
commit 9263442f83
2 changed files with 7 additions and 7 deletions
@@ -2,7 +2,6 @@ package me.youhavetrouble.enchantio;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import io.papermc.paper.registry.data.EnchantmentRegistryEntry;
import io.papermc.paper.registry.keys.tags.ItemTypeTagKeys;
import io.papermc.paper.registry.tag.TagKey;
import io.papermc.paper.tag.TagEntry;
@@ -19,17 +18,18 @@ import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import java.util.*;
import java.util.logging.Logger;
@SuppressWarnings("UnstableApiUsage")
public class EnchantioConfig {
public static final Map<Key, EnchantioEnchant> ENCHANTS = new HashMap<>();
private final Logger logger;
protected EnchantioConfig(Path filePath, Logger logger) throws IOException {
this.logger = logger;
private static boolean initialized = false;
protected static void init(Path filePath) throws IOException {
if (initialized) {
return;
}
initialized = true;
File file = filePath.toFile();
if (!file.exists()) {
file.mkdirs();