From 75680296e8b6ce5e49cda9ce2b23125ac476cdb1 Mon Sep 17 00:00:00 2001 From: EnZaXD <60033407+FlorianMichael@users.noreply.github.com> Date: Sun, 8 Oct 2023 06:51:49 +0200 Subject: [PATCH] Updated Via API usage (#601) --- .../java/com/viaversion/viabackwards/ViaBackwardsConfig.java | 4 ++-- .../com/viaversion/viabackwards/api/ViaBackwardsConfig.java | 4 +++- .../com/viaversion/viabackwards/api/ViaBackwardsPlatform.java | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/common/src/main/java/com/viaversion/viabackwards/ViaBackwardsConfig.java b/common/src/main/java/com/viaversion/viabackwards/ViaBackwardsConfig.java index c2a98864..c228d978 100644 --- a/common/src/main/java/com/viaversion/viabackwards/ViaBackwardsConfig.java +++ b/common/src/main/java/com/viaversion/viabackwards/ViaBackwardsConfig.java @@ -38,8 +38,8 @@ public class ViaBackwardsConfig extends Config implements com.viaversion.viaback } @Override - public void reloadConfig() { - super.reloadConfig(); + public void reload() { + super.reload(); loadFields(); } diff --git a/common/src/main/java/com/viaversion/viabackwards/api/ViaBackwardsConfig.java b/common/src/main/java/com/viaversion/viabackwards/api/ViaBackwardsConfig.java index 42273aae..94e11f43 100644 --- a/common/src/main/java/com/viaversion/viabackwards/api/ViaBackwardsConfig.java +++ b/common/src/main/java/com/viaversion/viabackwards/api/ViaBackwardsConfig.java @@ -17,7 +17,9 @@ */ package com.viaversion.viabackwards.api; -public interface ViaBackwardsConfig { +import com.viaversion.viaversion.api.configuration.Config; + +public interface ViaBackwardsConfig extends Config { /** * Mimics name and level of a custom enchant through the item's lore. diff --git a/common/src/main/java/com/viaversion/viabackwards/api/ViaBackwardsPlatform.java b/common/src/main/java/com/viaversion/viabackwards/api/ViaBackwardsPlatform.java index 4743f6be..4c48bd28 100644 --- a/common/src/main/java/com/viaversion/viabackwards/api/ViaBackwardsPlatform.java +++ b/common/src/main/java/com/viaversion/viabackwards/api/ViaBackwardsPlatform.java @@ -74,7 +74,8 @@ public interface ViaBackwardsPlatform { */ default void init(File dataFolder) { ViaBackwardsConfig config = new ViaBackwardsConfig(new File(dataFolder, "config.yml")); - config.reloadConfig(); + config.reload(); + Via.getManager().getConfigurationProvider().register(config); ViaBackwards.init(this, config);