Fix not using the selected Cash shop surprise

If you have multiple, it would always use the first one. Now it uses whichever you select (as expected).
This commit is contained in:
P0nk
2024-06-16 15:08:48 +02:00
parent 6ab1af99da
commit 5aeed01e38
4 changed files with 66 additions and 51 deletions

View File

@@ -2,11 +2,17 @@ package testutil;
import io.netty.buffer.Unpooled;
import net.packet.ByteBufInPacket;
import net.packet.ByteBufOutPacket;
import net.packet.InPacket;
import net.packet.OutPacket;
import java.util.function.Consumer;
public class Packets {
public static InPacket emptyInPacket() {
return new ByteBufInPacket(Unpooled.buffer());
public static InPacket buildInPacket(Consumer<OutPacket> contentProvider) {
OutPacket builderInput = new ByteBufOutPacket();
contentProvider.accept(builderInput);
return new ByteBufInPacket(Unpooled.wrappedBuffer(builderInput.getBytes()));
}
}