Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/scripts/install-local-dependencies.sh
Original file line number Diff line number Diff line change
@@ -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 "$@"
2 changes: 1 addition & 1 deletion .github/scripts/prepare-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 "$@"
10 changes: 4 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,14 @@
<dependency>
<groupId>local</groupId>
<artifactId>ProtocolLib</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/libs/ProtocolLib.jar</systemPath>
<version>1.0-tfmc-ee2e7ab9b538</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>local</groupId>
<artifactId>ItemsAdder</artifactId>
<version>3.5.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/libs/ItemsAdder_3.5.0-r2.jar</systemPath>
<version>3.5.0-tfmc-0116d714822b</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.tfminecraft</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,10 @@ private PacketContainer createMetadataPacket(int entityId, ItemStack item, Displ

private List<WrappedDataValue> buildMetadata(ItemStack item, DisplayPose pose, int delay, int duration) {
List<WrappedDataValue> 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));
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/net/tfminecraft/games/loader/ConfigLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@
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;
Expand All @@ -208,10 +210,10 @@
}
key = key.replace('.', '_').replace('-', '_').toUpperCase(Locale.ROOT);
try {
return Sound.valueOf(key);

Check warning on line 213 in src/main/java/net/tfminecraft/games/loader/ConfigLoader.java

View workflow job for this annotation

GitHub Actions / build

valueOf(java.lang.String) in org.bukkit.Sound has been deprecated and marked for removal
} catch (IllegalArgumentException ex) {
Sound fallback = unknownFallback != null ? unknownFallback : Sound.ITEM_BOOK_PAGE_TURN;
Games.plugin.getLogger().warning("[Games] Unknown " + path + " '" + raw + "', using " + fallback.name()

Check warning on line 216 in src/main/java/net/tfminecraft/games/loader/ConfigLoader.java

View workflow job for this annotation

GitHub Actions / build

name() in org.bukkit.util.OldEnum has been deprecated and marked for removal
+ ".");
return fallback;
}
Expand Down