From f478891b47a2d368e0360e8abdb04e14cc3e4c11 Mon Sep 17 00:00:00 2001 From: Ryan Barlow <7389646+ryanbarlow97@users.noreply.github.com> Date: Tue, 22 Sep 2026 23:34:34 +0000 Subject: [PATCH] fix: resolve build warnings --- .github/scripts/install-local-dependencies.sh | 12 ++++++++++++ .github/scripts/prepare-release.sh | 2 +- pom.xml | 10 ++++------ .../games/display/FakeItemDisplayPackets.java | 8 ++++---- .../net/tfminecraft/games/loader/ConfigLoader.java | 2 ++ 5 files changed, 23 insertions(+), 11 deletions(-) create mode 100644 .github/scripts/install-local-dependencies.sh diff --git a/.github/scripts/install-local-dependencies.sh b/.github/scripts/install-local-dependencies.sh new file mode 100644 index 0000000..fffdcb0 --- /dev/null +++ b/.github/scripts/install-local-dependencies.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +set -euo pipefail +# Run from the repository root after downloading the pinned JARs. +# Hash-qualified versions prevent different private JARs sharing a Maven cache key. +sha256sum --check .github/dependencies.sha256 + +mvn -B --no-transfer-progress org.apache.maven.plugins:maven-install-plugin:3.1.4:install-file \ + -Dfile="libs/ProtocolLib.jar" -DgroupId="local" -DartifactId="ProtocolLib" \ + -Dversion="1.0-tfmc-ee2e7ab9b538" -Dpackaging=jar -DgeneratePom=true "$@" +mvn -B --no-transfer-progress org.apache.maven.plugins:maven-install-plugin:3.1.4:install-file \ + -Dfile="libs/ItemsAdder_3.5.0-r2.jar" -DgroupId="local" -DartifactId="ItemsAdder" \ + -Dversion="3.5.0-tfmc-0116d714822b" -Dpackaging=jar -DgeneratePom=true "$@" diff --git a/.github/scripts/prepare-release.sh b/.github/scripts/prepare-release.sh index e0942aa..50045f0 100644 --- a/.github/scripts/prepare-release.sh +++ b/.github/scripts/prepare-release.sh @@ -5,4 +5,4 @@ ref=8a44414cd5b74b7d1c7a258ccf5a86a5f6e0294b mkdir -p libs curl --fail --location --silent --show-error --retry 3 -H "Authorization: Bearer $GH_TOKEN" -H "Accept: application/vnd.github.raw+json" "https://api.github.com/repos/TF-Minecraft/ServerAssets/contents/runtime/plugins/ProtocolLib.jar?ref=$ref" > "libs/ProtocolLib.jar" curl --fail --location --silent --show-error --retry 3 -H "Authorization: Bearer $GH_TOKEN" -H "Accept: application/vnd.github.raw+json" "https://api.github.com/repos/TF-Minecraft/ServerAssets/contents/jars/0116d714822b/ItemsAdder_3.5.0-r2.jar?ref=$ref" > "libs/ItemsAdder_3.5.0-r2.jar" -sha256sum --check .github/dependencies.sha256 +bash .github/scripts/install-local-dependencies.sh "$@" diff --git a/pom.xml b/pom.xml index 46c8746..b74c980 100644 --- a/pom.xml +++ b/pom.xml @@ -40,16 +40,14 @@ local ProtocolLib - 1.0 - system - ${project.basedir}/libs/ProtocolLib.jar + 1.0-tfmc-ee2e7ab9b538 + provided local ItemsAdder - 3.5.0 - system - ${project.basedir}/libs/ItemsAdder_3.5.0-r2.jar + 3.5.0-tfmc-0116d714822b + provided net.tfminecraft diff --git a/src/main/java/net/tfminecraft/games/display/FakeItemDisplayPackets.java b/src/main/java/net/tfminecraft/games/display/FakeItemDisplayPackets.java index a10437f..89cd3cb 100644 --- a/src/main/java/net/tfminecraft/games/display/FakeItemDisplayPackets.java +++ b/src/main/java/net/tfminecraft/games/display/FakeItemDisplayPackets.java @@ -156,10 +156,10 @@ private PacketContainer createMetadataPacket(int entityId, ItemStack item, Displ private List buildMetadata(ItemStack item, DisplayPose pose, int delay, int duration) { List values = new ArrayList<>(); - Serializer intSerializer = WrappedDataWatcher.Registry.get(Integer.class); - Serializer vectorSerializer = WrappedDataWatcher.Registry.get(Vector3f.class); - Serializer quaternionSerializer = WrappedDataWatcher.Registry.get(Quaternionf.class); - Serializer byteSerializer = WrappedDataWatcher.Registry.get(Byte.class); + Serializer intSerializer = WrappedDataWatcher.Registry.get((java.lang.reflect.Type) Integer.class, false); + Serializer vectorSerializer = WrappedDataWatcher.Registry.get((java.lang.reflect.Type) Vector3f.class, false); + Serializer quaternionSerializer = WrappedDataWatcher.Registry.get((java.lang.reflect.Type) Quaternionf.class, false); + Serializer byteSerializer = WrappedDataWatcher.Registry.get((java.lang.reflect.Type) Byte.class, false); values.add(new WrappedDataValue(META_INTERPOLATION_DELAY, intSerializer, delay)); values.add(new WrappedDataValue(META_INTERPOLATION_DURATION, intSerializer, duration)); diff --git a/src/main/java/net/tfminecraft/games/loader/ConfigLoader.java b/src/main/java/net/tfminecraft/games/loader/ConfigLoader.java index 0e205ee..da12477 100644 --- a/src/main/java/net/tfminecraft/games/loader/ConfigLoader.java +++ b/src/main/java/net/tfminecraft/games/loader/ConfigLoader.java @@ -197,6 +197,8 @@ private static WagerItemOverride readOverride(ConfigurationSection section, Stri return new WagerItemOverride(item, value, model, stackMax, layerGap, scale, randomYaw, pitch, threeD, yOffset); } + // Existing configuration accepts legacy enum names and aliases; registry keys are not equivalent. + @SuppressWarnings("deprecation") public static Sound parseSound(String raw, String path, Sound unknownFallback) { if (raw == null || raw.isBlank()) { return null;