mirror of
https://github.com/Minestom/Minestom.git
synced 2024-09-29 23:17:59 +02:00
Fix optional metadata
This commit is contained in:
parent
1707cc73f5
commit
735dd50f4e
@ -203,10 +203,12 @@ public class Metadata {
|
||||
|
||||
@Override
|
||||
public void write(@NotNull BinaryWriter writer) {
|
||||
writer.writeVarInt(type);
|
||||
|
||||
final boolean present = value != null;
|
||||
writer.writeBoolean(present);
|
||||
if (present) {
|
||||
super.write(writer);
|
||||
this.valueWriter.accept(writer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user