Skip to content

Field index out of bounds #2053

@JHarris12345

Description

@JHarris12345
  • This issue is not solved in a development build

Describe the bug
When I try to create a packet container for the client custom payload, I cannot write to the byte array field.

To Reproduce
Steps to reproduce the behavior:

  1. I am using the latest 5.0.0-SNAPSHOT API

  2. Here is my code:

         PacketContainer packetContainer = new PacketContainer(PacketType.Play.Client.CUSTOM_PAYLOAD);
         packetContainer.getByteArrays().write(0, bytes);
    
  3. I get the error Field index 0 is out of bounds for length 0

Expected behavior
It should allow me to get that field

Screenshots
If applicable, add screenshots to help explain your problem.

Version Info
Provide your ProtocolLib install info with /protocol dump through pastebin.
http://dump-2022-12-21_12.13.31.txt

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions