diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..a856063b --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,52 @@ +name: Build With Gradle + +on: [ push, pull_request ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - name: Checkout repository and submodules + uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Set up JDK 16 + uses: actions/setup-java@v2 + with: + distribution: 'temurin' + java-version: '16' + cache: 'gradle' + + - name: Build with Gradle + run: ./gradlew shadowJar + + - name: Archive artifacts (Bungee) + uses: actions/upload-artifact@v2 + if: success() + with: + name: BungeeTabListPlus Bungee + path: bootstrap-bungee/build/libs/BungeeTabListPlus-*-SNAPSHOT.jar + + - name: Archive artifacts (Bukkit) + uses: actions/upload-artifact@v2 + if: success() + with: + name: BungeeTabListPlus Bukkit Bridge + path: bootstrap-bukkit/build/libs/BungeeTabListPlus_BukkitBridge-*-SNAPSHOT.jar + + - name: Archive artifacts (Fabric 1.16.3) + uses: actions/upload-artifact@v2 + if: success() + with: + name: BungeeTabListPlus Fabric 1.16.3 Bridge + path: fabric-bridge-1.16.3/build/libs/btlp-fabric-bridge-*-SNAPSHOT.jar + + - name: Archive artifacts (Fabric 1.17) + uses: actions/upload-artifact@v2 + if: success() + with: + name: BungeeTabListPlus Fabric 1.17 Bridge + path: fabric-bridge-1.17/build/libs/btlp-fabric-bridge-*-SNAPSHOT.jar \ No newline at end of file diff --git a/build.gradle b/build.gradle index 68e3e1a1..6c9cc231 100644 --- a/build.gradle +++ b/build.gradle @@ -10,7 +10,7 @@ buildscript { ext { spigotVersion = '1.11-R0.1-SNAPSHOT' - bungeeVersion = '1.19-R0.1-SNAPSHOT' + bungeeVersion = '1.20-R0.2-SNAPSHOT' spongeVersion = '7.0.0' dataApiVersion = '1.0.2-SNAPSHOT' } diff --git a/bungee/src/main/java/codecrafter47/bungeetablistplus/handler/NewTabOverlayHandler.java b/bungee/src/main/java/codecrafter47/bungeetablistplus/handler/NewTabOverlayHandler.java index eba4958b..d3e271b9 100644 --- a/bungee/src/main/java/codecrafter47/bungeetablistplus/handler/NewTabOverlayHandler.java +++ b/bungee/src/main/java/codecrafter47/bungeetablistplus/handler/NewTabOverlayHandler.java @@ -33,6 +33,7 @@ import de.codecrafter47.taboverlay.handler.*; import it.unimi.dsi.fastutil.objects.*; import lombok.*; +import net.md_5.bungee.UserConnection; import net.md_5.bungee.api.connection.ProxiedPlayer; import net.md_5.bungee.protocol.DefinedPacket; import net.md_5.bungee.protocol.packet.*; @@ -181,6 +182,11 @@ private void sendPacket(DefinedPacket packet) { logVersionMismatch = true; logger.warning("Cannot correctly update tablist for player " + player.getName() + "\nThe client and server versions do not match. Client >= 1.19.3, server < 1.19.3.\nUse ViaVersion on the spigot server for the best experience."); } + } else if (player.getPendingConnection().getVersion() >= 764) { + // Ensure that unsafe packets are not sent in the config phase + // Why bungee doesn't expose this via api beyond me... + // https://github.com/SpigotMC/BungeeCord/blob/1ef4d27dbea48a1d47501ad2be0d75e42cc2cc12/proxy/src/main/java/net/md_5/bungee/UserConnection.java#L182-L192 + ((UserConnection) player).sendPacketQueued(packet); } else { player.unsafe().sendPacket(packet); }