Skip to content

Commit e077e0c

Browse files
authored
fix 10466 (#710)
fix 10466
1 parent ae55e35 commit e077e0c

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

gradle/wrapper/gradle-wrapper.jar

79 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

src/main/java/com/ldtteam/structurize/network/messages/TransferStructurePackToClient.java

+7-3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import io.netty.buffer.ByteBuf;
88
import io.netty.buffer.Unpooled;
99
import net.minecraft.network.RegistryFriendlyByteBuf;
10+
import net.minecraft.network.protocol.common.custom.CustomPacketPayload;
1011
import net.minecraft.world.entity.player.Player;
1112
import net.neoforged.neoforge.network.handling.IPayloadContext;
1213

@@ -40,7 +41,8 @@ protected TransferStructurePackToClient(final RegistryFriendlyByteBuf buf, final
4041
super(buf, type);
4142
this.packname = buf.readUtf(32767);
4243
this.eol = buf.readBoolean();
43-
this.payload = Unpooled.wrappedBuffer(buf.readByteArray());
44+
final int size = buf.readInt();
45+
this.payload = Unpooled.wrappedBuffer(buf.readBytes(size));
4446
}
4547

4648
/**
@@ -62,8 +64,10 @@ protected void toBytes(final RegistryFriendlyByteBuf buf)
6264
{
6365
buf.writeUtf(this.packname);
6466
buf.writeBoolean(this.eol);
65-
buf.writeByteArray(this.payload.array());
66-
this.payload.release();
67+
final int size = this.payload.readableBytes();
68+
buf.writeInt(size);
69+
buf.writeBytes(this.payload, size);
70+
this.payload.resetReaderIndex();
6771
}
6872

6973
@Override

0 commit comments

Comments
 (0)