Powah!

Powah!

19M Downloads

Energy Cables' large NBT data causes Badly Compressed Packet error from Server

ChristopherHoffman opened this issue ยท 3 comments

commented

Version: (make sure you are on the latest version before reporting):

  • Minecraft: 1.16.5

  • Forge: 36.0.45

  • Powah: 2.3.14

  • Modpack: Direwolf 20 1.16 version 1.7.0

Issue description:

This seems to be a regression of #128

I recently resolved an issue on our Direwolf20 1.16 FTB server where players were kicked with the following error when a specific chunk was loaded.

Internal Exception: io.netty.handler.codec.DecoderException: Badly compressed packet - size of 2113581 is larger than protocol maximum of 2097152

The chunk was narrowed down to a chunk with a large grid of 96 Powah niotic energy cables. When the cables were removed, the size of the chunk's nbt data dropped dramatically, allowing players to log in and load that chunk again.

When NBTExplorer is used on that chunk, it appears that each energy cable is storing a reference to the position of every other cable in the grid, for each side of the cable. This causes the NBT data to grow exponentially with each added cable, until the size of the NBT for that chunk outgrows what a minecrafter server can send to the client.

Every cable has 6 linked cables. 6 linked cables

Each of those linked cables has a reference to every other cable in the grid. reference to every other cable in the grid

Each cables_pos entry contains the x/y/z of that cable. the x/y/z of that cable

So in our case, those 96 cables stored: 96*6*96*3 positions, for a total of 165,888 positions in this single chunk.

Steps to reproduce:

Start a server, and create a grid or cube of energy cables in a single chunk. After ~96 cables, the size of the chunk saved in the region folder outgrows the 2.1mb allowed for a single chunk. When a player tried to load the chunk, they'll be kicked with the Badly compressed packet error.

Regression or re-report of #128

commented

Any update? A player is having this problem in Academy 1.16

commented

The exact same behavior and data is present for one user in FTB Oceanblock.
Powah-1.16.5-2.3.16.jar
They'll link an issue to here or post a message in the next day or two, normally.

commented

Yeah. I noticed this too while looking at the cable code while doing PR #153.