Skip to content

Commit

Permalink
fix 10466 (#710)
Browse files Browse the repository at this point in the history
fix 10466
  • Loading branch information
Raycoms authored Nov 19, 2024
1 parent ae55e35 commit e077e0c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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));
}

/**
Expand All @@ -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
Expand Down

0 comments on commit e077e0c

Please sign in to comment.