package ovh.sad.animalrp.paper; import java.util.UUID; import java.util.logging.Level; import org.bukkit.plugin.java.JavaPlugin; import ovh.sad.animalrp.common.AnimalRP; import ovh.sad.animalrp.common.util.HashmapStore; public class AnimalRPPaper extends JavaPlugin implements AnimalRP { public static HashmapStore hashmapStore; @Override public void onEnable() { AnimalRPPaper.hashmapStore = new HashmapStore(this.getDataFolder().toPath()); this.getLogger().log(Level.INFO, welcomeMessage); hashmapStore.get("users.json").forEach((k, v) -> { users.put(UUID.fromString(k), animals.get(v)); }); hashmapStore.get("nochat.json").forEach((k, v) -> { noChat.put(UUID.fromString(k), Boolean.valueOf(v)); }); } @Override public void onDisable() { hashmapStore.save("users.json", users); hashmapStore.save("nochat.json", noChat); } }