From ba3ce290a89cabe509a5f4c9f7c9d418e2edf915 Mon Sep 17 00:00:00 2001 From: jhqwqmc <2110242767@qq.com> Date: Tue, 11 Feb 2025 23:42:14 +0800 Subject: [PATCH] =?UTF-8?q?build(core):=20=E6=9B=B4=E6=96=B0=20boosted-yam?= =?UTF-8?q?l=E4=BE=9D=E8=B5=96=E5=B9=B6=E4=BC=98=E5=8C=96=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将 boosted-yaml 依赖从本地文件改为 Maven 仓库引用 -优化 FriendlyByteBuf 类中的 readLongArray 方法签名 --- core/build.gradle.kts | 2 +- .../net/momirealms/craftengine/core/util/FriendlyByteBuf.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/build.gradle.kts b/core/build.gradle.kts index 3bef0ddd5..f01314f86 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -13,7 +13,7 @@ dependencies { // JOML compileOnly("org.joml:joml:1.10.8") // YAML - implementation(files("libs/boosted-yaml-${rootProject.properties["boosted_yaml_version"]}.jar")) + implementation("dev.dejvokep:boosted-yaml:${rootProject.properties["boosted_yaml_version"]}") compileOnly("org.yaml:snakeyaml:${rootProject.properties["snake_yaml_version"]}") // NBT implementation("com.github.Xiao-MoMi:sparrow-nbt:${rootProject.properties["sparrow_nbt_version"]}") diff --git a/core/src/main/java/net/momirealms/craftengine/core/util/FriendlyByteBuf.java b/core/src/main/java/net/momirealms/craftengine/core/util/FriendlyByteBuf.java index 7b298a6cd..c6e8d84cb 100644 --- a/core/src/main/java/net/momirealms/craftengine/core/util/FriendlyByteBuf.java +++ b/core/src/main/java/net/momirealms/craftengine/core/util/FriendlyByteBuf.java @@ -221,11 +221,11 @@ public class FriendlyByteBuf extends ByteBuf { return this.readLongArray(null); } - public long[] readLongArray(long @Nullable [] toArray) { + public long[] readLongArray(@Nullable long[] toArray) { return this.readLongArray(toArray, this.readableBytes() / 8); } - public long[] readLongArray(long @Nullable [] toArray, int maxSize) { + public long[] readLongArray(@Nullable long[] toArray, int maxSize) { int arraySize = this.readVarInt(); if (toArray == null || toArray.length != arraySize) { if (arraySize > maxSize) {