From 17a46569fec5eef276ffb20936e95d0df7e5e2c0 Mon Sep 17 00:00:00 2001 From: onebeastchris Date: Thu, 16 Jan 2025 22:53:15 +0100 Subject: [PATCH] more fixes, remove gson, other fixes --- .github/workflows/build.yml | 7 +++++++ README.md | 12 +++++++++++- build.gradle.kts | 3 +-- gradle/libs.versions.toml | 3 --- .../geysermc/globallinkserver/GlobalLinkServer.java | 12 +++++++----- .../geysermc/globallinkserver/link/LinkManager.java | 2 +- 6 files changed, 27 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 625dde1..921adad 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,6 +27,13 @@ jobs: arguments: build cache-read-only: ${{ github.ref_name != 'master' && github.ref_name != 'development' }} + - name: Archive Artifacts + uses: GeyserMC/actions/upload-multi-artifact@master + if: success() + with: + artifacts: | + GlobalLinkPlugin:build/libs/GlobalLinkPlugin.jar + - name: Notify Discord if: ${{ (success() || failure()) && github.repository == 'GeyserMC/GlobalLinkServer' }} uses: Tim203/actions-git-discord-webhook@main diff --git a/README.md b/README.md index 4a2e3c3..0f1fadc 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,25 @@ # GlobalLinkServer Plugin +> **Warning** +This repo contains the code for the Geyser Global Linking Server plugin. +If you want to just link your account, join link.geysermc.org on Minecraft Java or Bedrock. + ### `server.properties` ```properties allow-nether=false generate-structures=false generator-settings={"biome"\:"minecraft\:the_void","layers"\:[{"block"\:"minecraft\:air","height"\:1}]} level-type=minecraft\:flat -motd=§aGeyserMC §bLinking §fServer spawn-protection=200 ``` +### `spigot.yml` +```yaml +commands: + send-namespaced: false +``` + + ### `bukkit.yml` ```yaml settings: diff --git a/build.gradle.kts b/build.gradle.kts index e472f76..9db76ad 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -10,7 +10,6 @@ group = "org.geysermc.globallinkserver" dependencies { paperweight.paperDevBundle("1.21.4-R0.1-SNAPSHOT") - implementation(libs.gson) // newer version required for record support implementation(libs.bundles.fastutil) compileOnly(libs.floodgate.api) implementation(libs.mariadb.client) @@ -59,7 +58,7 @@ tasks.jar { duplicatesStrategy = DuplicatesStrategy.EXCLUDE from(configurations.runtimeClasspath.get().map { if (it.isDirectory) it else zipTree(it) }) - archiveBaseName = "GlobalLinkServer" + archiveBaseName = "GlobalLinkPlugin" archiveVersion = "" archiveClassifier = "" } \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 863e319..13947e4 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,4 @@ [versions] -gson = "2.10.1" fastutil = "8.5.2" mariadb-client = "2.7.3" checker-qual = "3.21.1" @@ -10,8 +9,6 @@ runpaper = "2.3.1" [libraries] floodgate-api = { group = "org.geysermc.floodgate", name = "api", version = "2.2.3-SNAPSHOT" } -gson = { module = "com.google.code.gson:gson", version.ref = "gson" } - fastutil-int-int-maps = { group = "com.nukkitx.fastutil", name = "fastutil-int-int-maps", version.ref = "fastutil" } fastutil-int-object-maps = { group = "com.nukkitx.fastutil", name = "fastutil-int-object-maps", version.ref = "fastutil" } fastutil-object-int-maps = { group = "com.nukkitx.fastutil", name = "fastutil-object-int-maps", version.ref = "fastutil" } diff --git a/src/main/java/org/geysermc/globallinkserver/GlobalLinkServer.java b/src/main/java/org/geysermc/globallinkserver/GlobalLinkServer.java index ce2e820..58d45a6 100644 --- a/src/main/java/org/geysermc/globallinkserver/GlobalLinkServer.java +++ b/src/main/java/org/geysermc/globallinkserver/GlobalLinkServer.java @@ -28,10 +28,7 @@ import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.FoodLevelChangeEvent; import org.bukkit.event.entity.PlayerDeathEvent; -import org.bukkit.event.player.PlayerCommandSendEvent; -import org.bukkit.event.player.PlayerJoinEvent; -import org.bukkit.event.player.PlayerQuitEvent; -import org.bukkit.event.player.PlayerRecipeDiscoverEvent; +import org.bukkit.event.player.*; import org.bukkit.plugin.Plugin; import org.bukkit.plugin.java.JavaPlugin; import org.checkerframework.checker.nullness.qual.NonNull; @@ -122,14 +119,19 @@ public void onEnable() { world.setGameRule(GameRule.RANDOM_TICK_SPEED, 0); world.setGameRule(GameRule.SHOW_DEATH_MESSAGES, false); + // Other changes + getServer().motd(Component.text("Global Link Server").color(NamedTextColor.AQUA)); + getServer().clearRecipes(); + // Make nighttime world.setTime(18000); getServer().setDefaultGameMode(GameMode.ADVENTURE); - LOGGER.info("Started Global Linking Server plugin!"); + LOGGER.info("Started Global Linking plugin!"); } + // TODO does not remove commands @EventHandler public void onCommands(PlayerCommandSendEvent event) { Collection toRemove = new ArrayList<>(); diff --git a/src/main/java/org/geysermc/globallinkserver/link/LinkManager.java b/src/main/java/org/geysermc/globallinkserver/link/LinkManager.java index b8314e2..ce3985c 100644 --- a/src/main/java/org/geysermc/globallinkserver/link/LinkManager.java +++ b/src/main/java/org/geysermc/globallinkserver/link/LinkManager.java @@ -145,7 +145,7 @@ public CompletableFuture> attemptFindJavaLink(Player player) { () -> { try (Connection connection = dataSource.getConnection()) { try (PreparedStatement query = connection.prepareStatement( - "SELECT `bedrock_id` FROM `links` WHERE `java_id` = ? LIMIT 1")) { + "SELECT `bedrock_id` FROM `links` WHERE `java_id` = ?")) { query.setString(1, player.getUniqueId().toString()); try (ResultSet resultSet = query.executeQuery()) {