From 1042bb7fb8083f71384a094a9424dde55ff79ba6 Mon Sep 17 00:00:00 2001 From: MrMicky Date: Thu, 9 May 2024 18:01:55 +0200 Subject: [PATCH] Update build for Java 21 --- .github/workflows/build.yml | 11 +- README.md | 1 - build.gradle | 6 +- .../bukkit/injector/NettyLibraryLoader.java | 5 +- common/build.gradle | 5 +- .../azlink/common/http/client/HttpClient.java | 8 +- .../azlink/common/platform/PlatformType.java | 1 - .../azlink/common/utils/UpdateChecker.java | 8 +- fabric/build.gradle | 57 ------- .../azlink/fabric/AzLinkFabricMod.java | 152 ------------------ .../fabric/command/FabricCommandExecutor.java | 72 --------- .../fabric/command/FabricCommandSource.java | 40 ----- .../azlink/fabric/command/FabricPlayer.java | 35 ---- .../azlink/fabric/command/TextAdapter.java | 25 --- fabric/src/main/resources/fabric.mod.json | 27 ---- settings.gradle | 12 -- .../azlink/velocity/AzLinkVelocityPlugin.java | 3 +- .../src/main/resources/velocity-config.yml | 5 + 18 files changed, 29 insertions(+), 444 deletions(-) delete mode 100644 fabric/build.gradle delete mode 100644 fabric/src/main/java/com/azuriom/azlink/fabric/AzLinkFabricMod.java delete mode 100644 fabric/src/main/java/com/azuriom/azlink/fabric/command/FabricCommandExecutor.java delete mode 100644 fabric/src/main/java/com/azuriom/azlink/fabric/command/FabricCommandSource.java delete mode 100644 fabric/src/main/java/com/azuriom/azlink/fabric/command/FabricPlayer.java delete mode 100644 fabric/src/main/java/com/azuriom/azlink/fabric/command/TextAdapter.java delete mode 100644 fabric/src/main/resources/fabric.mod.json diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7dfe1d3..6ae205d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,10 +25,10 @@ jobs: java-version: ${{ matrix.java-version }} - name: Validate Gradle Wrapper - uses: gradle/wrapper-validation-action@v1 + uses: gradle/actions/wrapper-validation@v3 - name: Setup Gradle - uses: gradle/gradle-build-action@v2 + uses: gradle/actions/setup-gradle@v3 - name: Build run: ./gradlew build @@ -46,10 +46,3 @@ jobs: name: AzLink-Legacy path: universal-legacy/build/libs/AzLink-Legacy-*.jar overwrite: true - - - name: Upload AzLink-Fabric.jar - uses: actions/upload-artifact@v4 - with: - name: AzLink-Fabric - path: fabric/build/libs/AzLink-Fabric-*.jar - overwrite: true diff --git a/README.md b/README.md index 6fcee10..b55eb59 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,6 @@ This plugin currently supports the following platforms: * [Sponge](https://www.spongepowered.org/) * [Velocity](https://velocitypowered.com/) * [Nukkit](https://cloudburstmc.org/articles/) -* [FabricMC](https://fabricmc.net/) ## Setup diff --git a/build.gradle b/build.gradle index 1548e81..349a7d2 100644 --- a/build.gradle +++ b/build.gradle @@ -6,8 +6,10 @@ allprojects { subprojects { apply plugin: 'java' - sourceCompatibility = 1.8 - targetCompatibility = 1.8 + java { + sourceCompatibility = 1.8 + targetCompatibility = 1.8 + } tasks.withType(JavaCompile) { options.encoding = 'UTF-8' diff --git a/bukkit/src/main/java/com/azuriom/azlink/bukkit/injector/NettyLibraryLoader.java b/bukkit/src/main/java/com/azuriom/azlink/bukkit/injector/NettyLibraryLoader.java index 99fcc65..cde9fe7 100644 --- a/bukkit/src/main/java/com/azuriom/azlink/bukkit/injector/NettyLibraryLoader.java +++ b/bukkit/src/main/java/com/azuriom/azlink/bukkit/injector/NettyLibraryLoader.java @@ -5,6 +5,7 @@ import java.io.InputStream; import java.lang.reflect.Field; +import java.net.URI; import java.net.URL; import java.net.URLClassLoader; import java.nio.file.Files; @@ -52,9 +53,9 @@ private void loadLibrary(String groupId, String artifactId, String version) thro this.plugin.getLogger().warn("Downloading " + artifactId + " v" + version + "..."); - URL url = new URL(String.format(MAVEN_CENTRAL, groupId.replace('.', '/'), artifactId, version, artifactId, version)); + String url = String.format(MAVEN_CENTRAL, groupId.replace('.', '/'), artifactId, version, artifactId, version); - try (InputStream in = url.openStream()) { + try (InputStream in = URI.create(url).toURL().openStream()) { Files.copy(in, jar); } diff --git a/common/build.gradle b/common/build.gradle index be33b49..dc11dc5 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -10,9 +10,8 @@ dependencies { compileOnly 'net.skinsrestorer:skinsrestorer-api:15.0.2' compileOnly 'com.nickuc.login:nlogin-api:10.3' - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.1' - testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.10.1' - testImplementation 'org.junit.jupiter:junit-jupiter-params:5.10.1' + testImplementation 'org.junit.jupiter:junit-jupiter:5.10.2' + testRuntimeOnly 'org.junit.platform:junit-platform-launcher' } test { diff --git a/common/src/main/java/com/azuriom/azlink/common/http/client/HttpClient.java b/common/src/main/java/com/azuriom/azlink/common/http/client/HttpClient.java index 0c0f39b..4470c40 100644 --- a/common/src/main/java/com/azuriom/azlink/common/http/client/HttpClient.java +++ b/common/src/main/java/com/azuriom/azlink/common/http/client/HttpClient.java @@ -13,6 +13,7 @@ import java.io.OutputStream; import java.net.HttpURLConnection; import java.net.InetAddress; +import java.net.URI; import java.net.URL; import java.nio.charset.StandardCharsets; import java.util.UUID; @@ -104,7 +105,10 @@ private T rawRequest(RequestMethod method, String endpoint, String body, Cla int status = conn.getResponseCode(); if (status >= 400) { - throw new IOException("Unexpected HTTP error " + status); + String info = status == 401 || status == 403 + ? ". Try to do again the link command given on the admin panel." : ""; + + throw new IOException("Unexpected HTTP error " + status + info); } if (status >= 300) { @@ -132,7 +136,7 @@ private HttpURLConnection prepareConnection(RequestMethod method, String endpoin String baseUrl = this.plugin.getConfig().getSiteUrl(); String version = this.plugin.getPlatform().getPluginVersion(); String token = this.plugin.getConfig().getSiteKey(); - URL url = new URL(baseUrl + "/api" + endpoint); + URL url = URI.create(baseUrl + "/api" + endpoint).toURL(); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setUseCaches(false); diff --git a/common/src/main/java/com/azuriom/azlink/common/platform/PlatformType.java b/common/src/main/java/com/azuriom/azlink/common/platform/PlatformType.java index 401ab5b..b648e2a 100644 --- a/common/src/main/java/com/azuriom/azlink/common/platform/PlatformType.java +++ b/common/src/main/java/com/azuriom/azlink/common/platform/PlatformType.java @@ -6,7 +6,6 @@ public enum PlatformType { BUNGEE("BungeeCord"), SPONGE("Sponge"), VELOCITY("Velocity"), - FABRIC("Fabric"), NUKKIT("Nukkit"); private final String name; diff --git a/common/src/main/java/com/azuriom/azlink/common/utils/UpdateChecker.java b/common/src/main/java/com/azuriom/azlink/common/utils/UpdateChecker.java index f372d6a..70f4ac3 100644 --- a/common/src/main/java/com/azuriom/azlink/common/utils/UpdateChecker.java +++ b/common/src/main/java/com/azuriom/azlink/common/utils/UpdateChecker.java @@ -5,7 +5,9 @@ import com.google.gson.JsonObject; import java.io.BufferedReader; +import java.io.IOException; import java.io.InputStreamReader; +import java.net.URI; import java.net.URL; import java.util.Objects; @@ -46,7 +48,7 @@ private static String parseVersion(String version) { public void checkUpdates() { try { - URL url = new URL(RELEASE_URL); + URL url = URI.create(RELEASE_URL).toURL(); try (BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()))) { JsonObject json = AzLinkPlugin.getGson().fromJson(reader, JsonObject.class); @@ -64,8 +66,8 @@ public void checkUpdates() { this.plugin.getLogger().warn("You can download it on https://azuriom.com/azlink"); } } - } catch (Exception e) { - // ignore + } catch (IOException e) { + this.plugin.getLogger().warn("Failed to check for updates: " + e.getMessage()); } } } diff --git a/fabric/build.gradle b/fabric/build.gradle deleted file mode 100644 index 1dd96c4..0000000 --- a/fabric/build.gradle +++ /dev/null @@ -1,57 +0,0 @@ -plugins { - id 'fabric-loom' version '1.2.7' - id 'com.github.johnrengelman.shadow' version '8.1.1' -} - -sourceCompatibility = JavaVersion.VERSION_17 -targetCompatibility = JavaVersion.VERSION_17 - -ext { - minecraft_version = '1.20.4' - yarn_mappings = '1.20.4+build.1' - loader_version = '0.15.1' - fabric_version = '0.91.2+1.20.4' -} - -dependencies { - implementation project(':azlink-common') - implementation 'net.kyori:adventure-api:4.12.0' - implementation 'net.kyori:adventure-text-serializer-gson:4.14.0' - implementation 'net.kyori:adventure-text-serializer-legacy:4.14.0' - minecraft "com.mojang:minecraft:${project.ext.minecraft_version}" - mappings "net.fabricmc:yarn:${project.ext.yarn_mappings}:v2" - modImplementation "net.fabricmc:fabric-loader:${project.ext.loader_version}" - modImplementation "net.fabricmc.fabric-api:fabric-api:${project.ext.fabric_version}" -} - -loom { - runtimeOnlyLog4j = true -} - -processResources { - filesMatching('**/*.json') { - expand 'version': project.version - } -} - -shadowJar { - dependencies { - exclude 'net.fabricmc:.*' - include dependency('com.azuriom:.*') - include dependency('net.kyori:.*') - } - - relocate 'net.kyori', 'com.azuriom.azlink.libs' -} - -remapJar { - dependsOn tasks.shadowJar - mustRunAfter tasks.shadowJar - inputFile = shadowJar.archiveFile - addNestedDependencies = true - archiveFileName = "AzLink-Fabric-${project.version}-${project.ext.minecraft_version}.jar" -} - -artifacts { - archives remapJar -} diff --git a/fabric/src/main/java/com/azuriom/azlink/fabric/AzLinkFabricMod.java b/fabric/src/main/java/com/azuriom/azlink/fabric/AzLinkFabricMod.java deleted file mode 100644 index 771b153..0000000 --- a/fabric/src/main/java/com/azuriom/azlink/fabric/AzLinkFabricMod.java +++ /dev/null @@ -1,152 +0,0 @@ -package com.azuriom.azlink.fabric; - -import com.azuriom.azlink.common.AzLinkPlatform; -import com.azuriom.azlink.common.AzLinkPlugin; -import com.azuriom.azlink.common.command.CommandSender; -import com.azuriom.azlink.common.data.WorldData; -import com.azuriom.azlink.common.logger.LoggerAdapter; -import com.azuriom.azlink.common.logger.Slf4jLoggerAdapter; -import com.azuriom.azlink.common.platform.PlatformInfo; -import com.azuriom.azlink.common.platform.PlatformType; -import com.azuriom.azlink.common.scheduler.JavaSchedulerAdapter; -import com.azuriom.azlink.common.scheduler.SchedulerAdapter; -import com.azuriom.azlink.common.tasks.TpsTask; -import com.azuriom.azlink.fabric.command.FabricCommandExecutor; -import com.azuriom.azlink.fabric.command.FabricPlayer; -import com.google.common.collect.Iterables; -import com.google.common.collect.Streams; -import net.fabricmc.api.DedicatedServerModInitializer; -import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback; -import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents; -import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents; -import net.fabricmc.loader.api.FabricLoader; -import net.fabricmc.loader.api.ModContainer; -import net.minecraft.server.MinecraftServer; -import net.minecraft.server.command.ServerCommandSource; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.nio.file.Path; -import java.util.Optional; -import java.util.stream.Stream; - -public final class AzLinkFabricMod implements AzLinkPlatform, DedicatedServerModInitializer { - - private static final Logger LOGGER = LoggerFactory.getLogger("azlink"); - - private final LoggerAdapter logger = new Slf4jLoggerAdapter(LOGGER); - private final TpsTask tpsTask = new TpsTask(); - - private final ModContainer modContainer; - private final AzLinkPlugin plugin; - private SchedulerAdapter scheduler; - - public AzLinkFabricMod() { - this.modContainer = FabricLoader.getInstance() - .getModContainer("azlink") - .orElseThrow(() -> new RuntimeException("Unable to get the mod container.")); - this.plugin = new AzLinkPlugin(this); - } - - @Override - public void onInitializeServer() { - var command = new FabricCommandExecutor<>(this.plugin); - - ServerLifecycleEvents.SERVER_STARTING.register(this::onServerStart); - ServerLifecycleEvents.SERVER_STOPPING.register(this::onServerStop); - ServerTickEvents.START_SERVER_TICK.register(s -> this.tpsTask.run()); - - CommandRegistrationCallback.EVENT - .register((dispatcher, registry, env) -> command.register(dispatcher)); - } - - public void onServerStart(MinecraftServer server) { - this.scheduler = this.initScheduler(); - this.plugin.init(); - } - - public void onServerStop(MinecraftServer server) { - if (this.plugin != null) { - this.plugin.shutdown(); - } - } - - @Override - public AzLinkPlugin getPlugin() { - return this.plugin; - } - - @Override - public LoggerAdapter getLoggerAdapter() { - return this.logger; - } - - @Override - public SchedulerAdapter getSchedulerAdapter() { - return this.scheduler; - } - - @Override - public PlatformType getPlatformType() { - return PlatformType.FABRIC; - } - - @Override - public PlatformInfo getPlatformInfo() { - return FabricLoader.getInstance() - .getModContainer("fabric") - .map(ModContainer::getMetadata) - .map(m -> new PlatformInfo(m.getName(), m.getVersion().getFriendlyString())) - .orElse(new PlatformInfo("unknown", "unknown")); - } - - @Override - public String getPluginVersion() { - return this.modContainer.getMetadata().getVersion().getFriendlyString(); - } - - @Override - public Path getDataDirectory() { - return FabricLoader.getInstance().getConfigDir().resolve("AzLink"); - } - - @Override - public Optional getWorldData() { - int loadedChunks = Streams.stream(getServer().getWorlds()) - .mapToInt(w -> w.getChunkManager().getLoadedChunkCount()) - .sum(); - int entities = Streams.stream(getServer().getWorlds()) - .mapToInt(w -> Iterables.size(w.iterateEntities())) - .sum(); - - return Optional.of(new WorldData(this.tpsTask.getTps(), loadedChunks, entities)); - } - - @Override - public Stream getOnlinePlayers() { - return getServer().getPlayerManager() - .getPlayerList() - .stream() - .map(FabricPlayer::new); - } - - @Override - public void dispatchConsoleCommand(String command) { - ServerCommandSource source = getServer().getCommandSource(); - getServer().getCommandManager().executeWithPrefix(source, command); - } - - @Override - public int getMaxPlayers() { - return getServer().getMaxPlayerCount(); - } - - private SchedulerAdapter initScheduler() { - return new JavaSchedulerAdapter(getServer()::executeSync); - } - - @SuppressWarnings("deprecation") - private MinecraftServer getServer() { - return (MinecraftServer) FabricLoader.getInstance().getGameInstance(); - } -} diff --git a/fabric/src/main/java/com/azuriom/azlink/fabric/command/FabricCommandExecutor.java b/fabric/src/main/java/com/azuriom/azlink/fabric/command/FabricCommandExecutor.java deleted file mode 100644 index 567c0ca..0000000 --- a/fabric/src/main/java/com/azuriom/azlink/fabric/command/FabricCommandExecutor.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.azuriom.azlink.fabric.command; - -import com.azuriom.azlink.common.AzLinkPlugin; -import com.azuriom.azlink.common.command.AzLinkCommand; -import com.mojang.brigadier.Command; -import com.mojang.brigadier.CommandDispatcher; -import com.mojang.brigadier.arguments.StringArgumentType; -import com.mojang.brigadier.builder.LiteralArgumentBuilder; -import com.mojang.brigadier.builder.RequiredArgumentBuilder; -import com.mojang.brigadier.context.CommandContext; -import com.mojang.brigadier.suggestion.SuggestionProvider; -import com.mojang.brigadier.suggestion.Suggestions; -import com.mojang.brigadier.suggestion.SuggestionsBuilder; -import net.minecraft.server.command.ServerCommandSource; - -import java.util.concurrent.CompletableFuture; - -public class FabricCommandExecutor - extends AzLinkCommand implements Command, SuggestionProvider { - - public FabricCommandExecutor(AzLinkPlugin plugin) { - super(plugin); - } - - @Override - public int run(CommandContext context) { - try { - String args = getArguments(context); - FabricCommandSource source = new FabricCommandSource(context.getSource()); - - this.execute(source, args.split(" ", -1)); - } catch (Exception e) { - this.plugin.getLogger().error("An error occurred while executing command", e); - } - - return Command.SINGLE_SUCCESS; - } - - @Override - public CompletableFuture getSuggestions(CommandContext context, SuggestionsBuilder builder) { - try { - String args = getArguments(context); - FabricCommandSource source = new FabricCommandSource(context.getSource()); - - this.tabComplete(source, args.split(" ", -1)).forEach(builder::suggest); - } catch (Exception e) { - this.plugin.getLogger().error("An error occurred while getting suggestions", e); - } - - return builder.buildFuture(); - } - - public void register(CommandDispatcher dispatcher) { - LiteralArgumentBuilder command = LiteralArgumentBuilder.literal("azlink") - .then(RequiredArgumentBuilder - .argument("args", StringArgumentType.greedyString()) - .executes(this) - .suggests(this) - ) - .executes(this); - - dispatcher.register(command); - } - - private String getArguments(CommandContext context) { - try { - return context.getArgument("args", String.class); - } catch (IllegalArgumentException e) { - return ""; - } - } -} diff --git a/fabric/src/main/java/com/azuriom/azlink/fabric/command/FabricCommandSource.java b/fabric/src/main/java/com/azuriom/azlink/fabric/command/FabricCommandSource.java deleted file mode 100644 index 9c316b5..0000000 --- a/fabric/src/main/java/com/azuriom/azlink/fabric/command/FabricCommandSource.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.azuriom.azlink.fabric.command; - -import com.azuriom.azlink.common.command.CommandSender; -import net.minecraft.entity.Entity; -import net.minecraft.server.command.ServerCommandSource; - -import java.util.UUID; - -public class FabricCommandSource implements CommandSender { - - private final ServerCommandSource source; - - public FabricCommandSource(ServerCommandSource source) { - this.source = source; - } - - @Override - public String getName() { - return this.source.getName(); - } - - @Override - public UUID getUuid() { - Entity entity = this.source.getEntity(); - - return entity != null - ? entity.getUuid() - : UUID.nameUUIDFromBytes(this.source.getName().getBytes()); - } - - @Override - public void sendMessage(String message) { - this.source.sendMessage(TextAdapter.toText(message)); - } - - @Override - public boolean hasPermission(String permission) { - return this.source.hasPermissionLevel(3); - } -} diff --git a/fabric/src/main/java/com/azuriom/azlink/fabric/command/FabricPlayer.java b/fabric/src/main/java/com/azuriom/azlink/fabric/command/FabricPlayer.java deleted file mode 100644 index a92b9df..0000000 --- a/fabric/src/main/java/com/azuriom/azlink/fabric/command/FabricPlayer.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.azuriom.azlink.fabric.command; - -import com.azuriom.azlink.common.command.CommandSender; -import net.minecraft.server.network.ServerPlayerEntity; - -import java.util.UUID; - -public class FabricPlayer implements CommandSender { - - private final ServerPlayerEntity player; - - public FabricPlayer(ServerPlayerEntity player) { - this.player = player; - } - - @Override - public String getName() { - return this.player.getName().getString(); - } - - @Override - public UUID getUuid() { - return this.player.getUuid(); - } - - @Override - public void sendMessage(String message) { - this.player.sendMessage(TextAdapter.toText(message)); - } - - @Override - public boolean hasPermission(String permission) { - return this.player.hasPermissionLevel(3); - } -} diff --git a/fabric/src/main/java/com/azuriom/azlink/fabric/command/TextAdapter.java b/fabric/src/main/java/com/azuriom/azlink/fabric/command/TextAdapter.java deleted file mode 100644 index 9a01b03..0000000 --- a/fabric/src/main/java/com/azuriom/azlink/fabric/command/TextAdapter.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.azuriom.azlink.fabric.command; - -import net.kyori.adventure.text.TextComponent; -import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer; -import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; -import net.minecraft.text.Text; - -public final class TextAdapter { - - private static final LegacyComponentSerializer LEGACY_SERIALIZER = LegacyComponentSerializer.builder() - .character('&') - .extractUrls() - .build(); - - private TextAdapter() { - throw new UnsupportedOperationException(); - } - - public static Text toText(String message) { - TextComponent component = LEGACY_SERIALIZER.deserialize(message); - String json = GsonComponentSerializer.gson().serialize(component); - - return Text.Serialization.fromJson(json); - } -} diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json deleted file mode 100644 index 9195451..0000000 --- a/fabric/src/main/resources/fabric.mod.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "schemaVersion": 1, - "id": "azlink", - "version": "${version}", - "name": "AzLink", - "description": "The mod to link your Azuriom website with your Fabric server.", - "authors": [ - "Azuriom" - ], - "contact": { - "homepage": "https://azuriom.com/", - "sources": "https://github.com/Azuriom/AzLink" - }, - "license": "MIT", - "environment": "server", - "entrypoints": { - "server": [ - "com.azuriom.azlink.fabric.AzLinkFabricMod" - ] - }, - "mixins": [], - "depends": { - "fabricloader": ">=0.14.11", - "fabric-api": "*", - "minecraft": "~1.20" - } -} diff --git a/settings.gradle b/settings.gradle index 1463179..2b4ff28 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,14 +1,3 @@ -pluginManagement { - repositories { - maven { - name = 'Fabric' - url = 'https://maven.fabricmc.net/' - } - mavenCentral() - gradlePluginPortal() - } -} - rootProject.name = 'azlink' def modules = [ @@ -19,7 +8,6 @@ def modules = [ 'sponge-legacy', 'velocity', 'nukkit', - 'fabric', 'universal', 'universal-legacy', ] diff --git a/velocity/src/main/java/com/azuriom/azlink/velocity/AzLinkVelocityPlugin.java b/velocity/src/main/java/com/azuriom/azlink/velocity/AzLinkVelocityPlugin.java index dcc4c37..2cb3e09 100644 --- a/velocity/src/main/java/com/azuriom/azlink/velocity/AzLinkVelocityPlugin.java +++ b/velocity/src/main/java/com/azuriom/azlink/velocity/AzLinkVelocityPlugin.java @@ -79,7 +79,8 @@ public void onProxyInitialization(ProxyInitializeEvent event) { loadConfig(); - if (this.proxy.getPluginManager().getPlugin("limboauth").isPresent()) { + if (this.proxy.getPluginManager().getPlugin("limboauth").isPresent() + && this.config.getNode("limboauth-integration").getBoolean()) { this.proxy.getEventManager().register(this, new LimboAuthIntegration(this)); } diff --git a/velocity/src/main/resources/velocity-config.yml b/velocity/src/main/resources/velocity-config.yml index 8d5b217..aeaa9bc 100644 --- a/velocity/src/main/resources/velocity-config.yml +++ b/velocity/src/main/resources/velocity-config.yml @@ -2,6 +2,11 @@ # the player's skin will be updated to the website's skin skinsrestorer-integration: false +# When enabled, new users registered with the LimboAuth plugin will automatically be registered on the website +# If you are using multiples servers, you should use the same database for AuthMe to prevent users +# from registering multiple times +limboauth-integration: false + # When enabled, new users registered with the nLogin plugin will automatically be registered on the website # WARNING: You need nLogin version 10.2.43 or newer! # If you are using multiples servers, you should use the same database for nLogin to prevent users