From e7ab1784496e2b7fffa087e03ee3688e100b8817 Mon Sep 17 00:00:00 2001 From: KennyTV Date: Sat, 9 May 2020 09:49:26 +0200 Subject: [PATCH] Fix load ordering issue with VV Fixes #204 --- bungee/src/main/java/nl/matsv/viabackwards/BungeePlugin.java | 5 +++-- .../src/main/java/nl/matsv/viabackwards/VelocityPlugin.java | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/bungee/src/main/java/nl/matsv/viabackwards/BungeePlugin.java b/bungee/src/main/java/nl/matsv/viabackwards/BungeePlugin.java index dd900aae..dbc7f751 100644 --- a/bungee/src/main/java/nl/matsv/viabackwards/BungeePlugin.java +++ b/bungee/src/main/java/nl/matsv/viabackwards/BungeePlugin.java @@ -12,12 +12,13 @@ package nl.matsv.viabackwards; import net.md_5.bungee.api.plugin.Plugin; import nl.matsv.viabackwards.api.ViaBackwardsPlatform; +import us.myles.ViaVersion.api.Via; public class BungeePlugin extends Plugin implements ViaBackwardsPlatform { @Override - public void onEnable() { - this.init(getDataFolder()); + public void onLoad() { + Via.getManager().addEnableListener(() -> this.init(getDataFolder())); } // Why is this not a thing in Bungee? O_o diff --git a/velocity/src/main/java/nl/matsv/viabackwards/VelocityPlugin.java b/velocity/src/main/java/nl/matsv/viabackwards/VelocityPlugin.java index b45dbaa7..1614e54f 100644 --- a/velocity/src/main/java/nl/matsv/viabackwards/VelocityPlugin.java +++ b/velocity/src/main/java/nl/matsv/viabackwards/VelocityPlugin.java @@ -19,6 +19,7 @@ import com.velocitypowered.api.plugin.Plugin; import com.velocitypowered.api.plugin.annotation.DataDirectory; import nl.matsv.viabackwards.api.ViaBackwardsPlatform; import nl.matsv.viabackwards.velocity.VersionInfo; +import us.myles.ViaVersion.api.Via; import us.myles.ViaVersion.sponge.util.LoggerWrapper; import java.io.File; @@ -44,8 +45,7 @@ public class VelocityPlugin implements ViaBackwardsPlatform { public void onProxyStart(ProxyInitializeEvent e) { // Setup Logger this.logger = new LoggerWrapper(loggerSlf4j); - // Init! - this.init(configPath.resolve("config.yml").toFile()); + Via.getManager().addEnableListener(() -> this.init(configPath.resolve("config.yml").toFile())); } @Override