diff --git a/bungee/src/main/java/com/xinecraft/minetrax/bungee/MinetraxBungee.java b/bungee/src/main/java/com/xinecraft/minetrax/bungee/MinetraxBungee.java index e083991..b45957b 100644 --- a/bungee/src/main/java/com/xinecraft/minetrax/bungee/MinetraxBungee.java +++ b/bungee/src/main/java/com/xinecraft/minetrax/bungee/MinetraxBungee.java @@ -13,7 +13,6 @@ import com.xinecraft.minetrax.common.interfaces.MinetraxPlugin; import com.xinecraft.minetrax.common.enums.PlatformType; import com.xinecraft.minetrax.common.webquery.WebQueryServer; -import lombok.AccessLevel; import lombok.Getter; import net.md_5.bungee.api.plugin.Plugin; import net.md_5.bungee.config.Configuration; diff --git a/velocity/build.gradle b/velocity/build.gradle index 1f66ffc..e222dcd 100644 --- a/velocity/build.gradle +++ b/velocity/build.gradle @@ -1,8 +1,8 @@ dependencies { implementation project(":common") implementation 'org.bstats:bstats-velocity:3.0.0' - compileOnly "com.velocitypowered:velocity-api:3.3.0-SNAPSHOT" - annotationProcessor "com.velocitypowered:velocity-api:3.3.0-SNAPSHOT" + compileOnly "com.velocitypowered:velocity-api:3.0.0-SNAPSHOT" + annotationProcessor "com.velocitypowered:velocity-api:3.0.0-SNAPSHOT" implementation "dev.dejvokep:boosted-yaml:1.3" } diff --git a/velocity/src/main/java/com/xinecraft/minetrax/velocity/MinetraxVelocity.java b/velocity/src/main/java/com/xinecraft/minetrax/velocity/MinetraxVelocity.java index 3a38795..a15cf07 100644 --- a/velocity/src/main/java/com/xinecraft/minetrax/velocity/MinetraxVelocity.java +++ b/velocity/src/main/java/com/xinecraft/minetrax/velocity/MinetraxVelocity.java @@ -30,7 +30,6 @@ import dev.dejvokep.boostedyaml.settings.loader.LoaderSettings; import dev.dejvokep.boostedyaml.settings.updater.UpdaterSettings; import lombok.Getter; -import net.skinsrestorer.api.SkinsRestorer; import net.skinsrestorer.api.SkinsRestorerProvider; import net.skinsrestorer.api.VersionProvider; import net.skinsrestorer.api.event.SkinApplyEvent; @@ -93,11 +92,11 @@ public class MinetraxVelocity implements MinetraxPlugin { public HashMap joinAddressCache = new HashMap<>(); public Boolean hasSkinsRestorer = false; public Boolean isSkinsRestorerHookEnabled; - public SkinsRestorer skinsRestorerApi; public static final MinecraftChannelIdentifier PLUGIN_MESSAGE_CHANNEL = MinecraftChannelIdentifier.from(MinetraxCommon.PLUGIN_MESSAGE_CHANNEL); @Subscribe public void onProxyInitialization(ProxyInitializeEvent event) { + System.out.println("Minetrax plugin is starting..."); // GSON builder gson = new GsonBuilder() .serializeNulls() @@ -136,6 +135,7 @@ public void onProxyInitialization(ProxyInitializeEvent event) { // Start web query server startWebQueryServer(); + System.out.println("Checking skinsrestoareraasdf" + PluginUtil.checkIfPluginEnabled("skinsrestorer")); // Hook into plugins if (PluginUtil.checkIfPluginEnabled("skinsrestorer")) { hasSkinsRestorer = setupSkinsRestorer(); @@ -209,8 +209,7 @@ private Boolean setupSkinsRestorer() { // Add SkinsRestorerHook try { - skinsRestorerApi = SkinsRestorerProvider.get(); - skinsRestorerApi.getEventBus().subscribe(pluginContainer, SkinApplyEvent.class, new SkinsRestorerHook()); + SkinsRestorerProvider.get().getEventBus().subscribe(pluginContainer, SkinApplyEvent.class, new SkinsRestorerHook()); // Warn if SkinsRestorer is not compatible with v15 if (!VersionProvider.isCompatibleWith("15")) { diff --git a/velocity/src/main/java/com/xinecraft/minetrax/velocity/utils/SkinUtil.java b/velocity/src/main/java/com/xinecraft/minetrax/velocity/utils/SkinUtil.java index dcf9d3f..326703f 100644 --- a/velocity/src/main/java/com/xinecraft/minetrax/velocity/utils/SkinUtil.java +++ b/velocity/src/main/java/com/xinecraft/minetrax/velocity/utils/SkinUtil.java @@ -4,6 +4,7 @@ import com.xinecraft.minetrax.common.utils.LoggingUtil; import com.xinecraft.minetrax.velocity.MinetraxVelocity; import net.skinsrestorer.api.SkinsRestorer; +import net.skinsrestorer.api.SkinsRestorerProvider; import net.skinsrestorer.api.exception.DataRequestException; import net.skinsrestorer.api.exception.MineSkinException; import net.skinsrestorer.api.property.InputDataResult; @@ -16,7 +17,7 @@ public class SkinUtil { public static void setPlayerSkinUsingUrlOrName(String playerUuid, String value) throws MineSkinException, DataRequestException { - SkinsRestorer skinsRestorerApi = MinetraxVelocity.getPlugin().getSkinsRestorerApi(); + SkinsRestorer skinsRestorerApi = SkinsRestorerProvider.get(); SkinStorage skinStorage = skinsRestorerApi.getSkinStorage(); PlayerStorage playerStorage = skinsRestorerApi.getPlayerStorage(); Optional result = skinStorage.findOrCreateSkinData(value); @@ -35,7 +36,7 @@ public static void setPlayerSkinUsingUrlOrName(String playerUuid, String value) } public static void setPlayerSkinUsingCustom(String playerUuid, String value) throws DataRequestException { - SkinsRestorer skinsRestorerApi = MinetraxVelocity.getPlugin().getSkinsRestorerApi(); + SkinsRestorer skinsRestorerApi = SkinsRestorerProvider.get(); SkinStorage skinStorage = skinsRestorerApi.getSkinStorage(); PlayerStorage playerStorage = skinsRestorerApi.getPlayerStorage(); @@ -61,7 +62,7 @@ public static void setPlayerSkinUsingCustom(String playerUuid, String value) thr } public static void clearPlayerSkin(String playerUuid) throws DataRequestException { - SkinsRestorer skinsRestorerApi = MinetraxVelocity.getPlugin().getSkinsRestorerApi(); + SkinsRestorer skinsRestorerApi = SkinsRestorerProvider.get(); PlayerStorage playerStorage = skinsRestorerApi.getPlayerStorage(); playerStorage.removeSkinIdOfPlayer(UUID.fromString(playerUuid)); @@ -73,7 +74,7 @@ public static void clearPlayerSkin(String playerUuid) throws DataRequestExceptio } public static SkinProperty getSkinForPlayer(UUID playerUuid, String playerName) { - SkinsRestorer skinsRestorerAPI = MinetraxVelocity.getPlugin().getSkinsRestorerApi(); + SkinsRestorer skinsRestorerAPI = SkinsRestorerProvider.get(); PlayerStorage playerStorage = skinsRestorerAPI.getPlayerStorage(); try { Optional skin = playerStorage.getSkinForPlayer(playerUuid, playerName); diff --git a/velocity/src/main/java/com/xinecraft/minetrax/velocity/webquery/VelocityWebQuery.java b/velocity/src/main/java/com/xinecraft/minetrax/velocity/webquery/VelocityWebQuery.java index 17decba..3e200ee 100644 --- a/velocity/src/main/java/com/xinecraft/minetrax/velocity/webquery/VelocityWebQuery.java +++ b/velocity/src/main/java/com/xinecraft/minetrax/velocity/webquery/VelocityWebQuery.java @@ -11,6 +11,7 @@ import net.kyori.adventure.text.Component; import net.skinsrestorer.api.PropertyUtils; import net.skinsrestorer.api.SkinsRestorer; +import net.skinsrestorer.api.SkinsRestorerProvider; import net.skinsrestorer.api.property.SkinProperty; import net.skinsrestorer.api.storage.PlayerStorage; @@ -45,7 +46,7 @@ public String handleStatus() throws Exception { playerJsonObject.addProperty("ip_address", Objects.requireNonNull(player.getRemoteAddress()).getHostString()); if (this.plugin.getHasSkinsRestorer()) { - SkinsRestorer skinsRestorerApi = this.plugin.getSkinsRestorerApi(); + SkinsRestorer skinsRestorerApi = SkinsRestorerProvider.get(); PlayerStorage playerStorage = skinsRestorerApi.getPlayerStorage(); try { Optional skin = playerStorage.getSkinForPlayer(player.getUniqueId(), player.getUsername());