diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 2c3521197..a4b76b953 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 09523c0e5..9355b4155 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/src/main/java/com/ldtteam/structurize/network/messages/TransferStructurePackToClient.java b/src/main/java/com/ldtteam/structurize/network/messages/TransferStructurePackToClient.java index f128756ea..bca4dd8bd 100644 --- a/src/main/java/com/ldtteam/structurize/network/messages/TransferStructurePackToClient.java +++ b/src/main/java/com/ldtteam/structurize/network/messages/TransferStructurePackToClient.java @@ -7,6 +7,7 @@ import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; import net.minecraft.network.RegistryFriendlyByteBuf; +import net.minecraft.network.protocol.common.custom.CustomPacketPayload; import net.minecraft.world.entity.player.Player; import net.neoforged.neoforge.network.handling.IPayloadContext; @@ -40,7 +41,8 @@ protected TransferStructurePackToClient(final RegistryFriendlyByteBuf buf, final super(buf, type); this.packname = buf.readUtf(32767); this.eol = buf.readBoolean(); - this.payload = Unpooled.wrappedBuffer(buf.readByteArray()); + final int size = buf.readInt(); + this.payload = Unpooled.wrappedBuffer(buf.readBytes(size)); } /** @@ -62,8 +64,10 @@ protected void toBytes(final RegistryFriendlyByteBuf buf) { buf.writeUtf(this.packname); buf.writeBoolean(this.eol); - buf.writeByteArray(this.payload.array()); - this.payload.release(); + final int size = this.payload.readableBytes(); + buf.writeInt(size); + buf.writeBytes(this.payload, size); + this.payload.resetReaderIndex(); } @Override