mirror of
https://github.com/GeyserMC/MCProtocolLib.git
synced 2024-11-14 19:34:58 -05:00
Make readBlockEntityType() nullable again (#786)
The vanilla client does so too - it allows reading a null value, but wont write one.
This commit is contained in:
parent
cf4ccc3df6
commit
eacfb2d037
1 changed files with 2 additions and 8 deletions
|
@ -620,15 +620,9 @@ public class MinecraftCodecHelper extends BasePacketCodecHelper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@Nullable
|
||||||
public BlockEntityType readBlockEntityType(ByteBuf buf) {
|
public BlockEntityType readBlockEntityType(ByteBuf buf) {
|
||||||
int id = this.readVarInt(buf);
|
return BlockEntityType.from(this.readVarInt(buf));
|
||||||
BlockEntityType type = BlockEntityType.from(id);
|
|
||||||
|
|
||||||
if (type == null) {
|
|
||||||
throw new IllegalArgumentException("Unknown BlockEntityType: " + id);
|
|
||||||
}
|
|
||||||
return type;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void writeBlockEntityType(ByteBuf buf, BlockEntityType type) {
|
public void writeBlockEntityType(ByteBuf buf, BlockEntityType type) {
|
||||||
|
|
Loading…
Reference in a new issue