Fix firework flight show item conversion

Fixes #3877
This commit is contained in:
Nassim Jahnke 2024-05-26 13:02:38 +02:00
parent e886aca8be
commit 792f52e637
No known key found for this signature in database
GPG Key ID: EF6771C01F6EF02F
2 changed files with 4 additions and 2 deletions

View File

@ -27,6 +27,8 @@ import com.viaversion.viaversion.api.type.TypeConverter;
import io.netty.buffer.ByteBuf;
public class UnsignedByteType extends Type<Short> implements TypeConverter<Short> {
public static final int MAX_VALUE = 255;
public UnsignedByteType() {
super("Unsigned Byte", Short.class);
}

View File

@ -26,7 +26,6 @@ import com.viaversion.nbt.tag.ListTag;
import com.viaversion.nbt.tag.StringTag;
import com.viaversion.nbt.tag.Tag;
import com.google.common.base.Preconditions;
import com.google.common.primitives.UnsignedBytes;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.minecraft.GameProfile;
@ -72,6 +71,7 @@ import com.viaversion.viaversion.api.minecraft.item.data.Unbreakable;
import com.viaversion.viaversion.api.minecraft.item.data.WrittenBook;
import com.viaversion.viaversion.api.protocol.Protocol;
import com.viaversion.viaversion.api.protocol.packet.ClientboundPacketType;
import com.viaversion.viaversion.api.type.types.UnsignedByteType;
import com.viaversion.viaversion.api.type.types.item.StructuredDataType;
import com.viaversion.viaversion.protocols.v1_20_3to1_20_5.Protocol1_20_3To1_20_5;
import com.viaversion.viaversion.protocols.v1_20_3to1_20_5.data.ArmorMaterials1_20_5;
@ -1050,7 +1050,7 @@ public class ComponentRewriter1_20_5<C extends ClientboundPacketType> extends Co
}
protected ByteTag convertUnsignedByte(final byte value) {
if (value > UnsignedBytes.MAX_VALUE) {
if (value > UnsignedByteType.MAX_VALUE) {
throw new IllegalArgumentException("Value out of range: " + value);
}
return new ByteTag(value);