YABBA

YABBA

19M Downloads

Antibarrel causing crash

SeooY opened this issue ยท 22 comments

commented

Version: 1.1.2.22

I just updated the pack Modern Skyblock 3, which if I'm not mistaken was using 1.1.2.10 in the version before. The Antibarrel worked great before updating, but now whenever I interact in any form with it my game crashes with this message in console:

https://pastebin.com/tvFeZzXg

First it crashed after I right clicked on it, and then I picked it up and just trying to place it in the world also caused a crash.

commented

Hello, Just and fyi, this is still a problem in 1.1.2.28. Same error

commented

Could be fixed, could be broken even more. Either way, would be nice if someone tested this update

commented

Hmm, still crashes for me with the YABBA-1.1.2.34.jar, crash looks the same: https://pastebin.com/X76nrwbg

commented

Does this happen on login? I have another idea, save an ID in barrel and save the inventory as file on server, because its so huge, I will probably have to do that

commented

It is happening for me only when I'm opening it's UI.
For a split second I've even can see the first couple of rows of it's contents, then client crashes.

commented

I wanted to add more info about this issue after playing a bit with it trying to rescue my items from inside the Antibarrel without the game crashing. Seems like the game only crashes after passing a certain limit of items/types inside the Antibarrel, and only when interacting directly with it. I set up a small ME Network with a Storage Bus connected to the Antibarrel, and a Terminal, which allowed me to interact with all of my items successfully.

I then set a Export Bus to a second Antibarrel to start moving some items between them, and after passing a certain threshold the second Antibarrel also started crashing if I right clicked on it. I don't have the exact numbers, but it wasn't exactly a lot, at least according to what the Antibarrel is supposed to be able to hold.

At the end I was able to separate all of the contents into three separate Antibarrels without any of them crashing, with approximately 360 types in total, and something like 30k items. When one Antibarrel had 330 types and 20k items, it was crashing.

commented

I can confirm the exact same behaviour, the same pack, with the same version.

My error log is identical.

commented

I am also having this issue.

commented

Same issue for me. Hopefully Latvian can fix this soon :-)

commented

I'd leave a pastebin with the error from my logs on this....but it's functionally identical to the OP's one, save that I'm running java 1.8.0_181 rather than OP's 1.8.0_171 (that's what the last line in OP's pastebin is for those unfamiliar)

commented

Same issue, same pack: https://pastebin.com/Dy1t4ntb

commented

Same issue, FTB Revelation 2.5.0: https://i.imgur.com/Jxo0Bze.png

commented

This is caused by The One Probe doing a pickBlock() on the client and sending that to the server. The AntiBarrel dumps its whole contents into the stack when picked or broken, so that stack gets too big to be sent over the network.

@McJty for not checking packet size (and not filtering with getNBTShareTag()).

LatvianModder for also dumping the whole contents in getNBTShareTag() (and for syncing the data to the client-side TileEntity at all---it is only needed in the GUI).

commented

About not checking packet size I have no clue how to do that. I use SimpleNetworkWrapper and found no way to check for this before actually sending the packet.

I'm fixing The One Probe to serialize the itemstack from pickblock using PacketBuffer.writeItemStack() which takes care of the share tag so that should fix that issue at least

commented

I can just fix this by not sending contents to client at all, only when opened barrel

commented

McJty:

ByteBuf buffer = Unpooled.buffer();
ByteBufUtils.writeItemStack(buffer, stack);
if (buffer.writerIndex() <= 20000) {
    out.writeInt(buffer.writerIndex());
    out.writeBytes(buffer);
} else {
    out.writeIn(0);
}

(you can just use writerIndex because you know that you started that buffer at 0. Otherwise you'd need to store your start pos. You actually could do this directly in the output buffer by remembering your startpos and rewinding if it gets to big, too.)

commented

Thanks. You put 20000 there. I thought the max was around 32000?

commented

Just a random number. I chose a lower one because players' upload speeds are usually lower than their downloads.

commented

PS: you can actually do:

if (buffer.writerIndex() <= 20000) {
    out.writeBytes(buffer);
} else {
    out.writeShort(-1);
}

and then just use ByteBufUtils.readItemStack(in), which will return EMPTY if it reads a negative short . However, this may break in 1.13.2 when item IDs are not shorts anymore.

commented

In my case I'm actually going to do this:

    ByteBuf buffer = Unpooled.buffer();
    ByteBufUtils.writeItemStack(buffer, pickBlock);
    if (buffer.writerIndex() <= Config.maxPacketToServer) {
        buf.writeBytes(buffer);
    } else {
        ItemStack copy = new ItemStack(pickBlock.getItem(), pickBlock.getCount(), pickBlock.getMetadata());
        ByteBufUtils.writeItemStack(buf, copy);
    }

i.e. if the packet is too big with the normal pickblock I'll just add a copy that doesn't have any NBT

commented

oh, that's even better

commented

Using Modern Skyblock 3.5.0, same bug.
I updated YABBA from 1.1.2.28 to 1.1.2.53 : the bug is still here on the same antibarrel, the game still crashes when I try to open it's GUI.