mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2025-03-21 02:49:08 +01:00
Implement 1_8 writing
This commit is contained in:
parent
afca92d122
commit
d715607826
src/main/java/us/myles/ViaVersion/api/type/types/version
@ -19,7 +19,9 @@ public class Metadata1_8Type extends MetaTypeTemplate {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(ByteBuf buffer, Metadata object) throws Exception {
|
||||
throw new UnsupportedOperationException("1.8 Metadata writing is not implemented!");
|
||||
public void write(ByteBuf buffer, Metadata meta) throws Exception {
|
||||
byte item = (byte) (meta.getTypeID() << 5 | meta.getId() & 0x1F);
|
||||
buffer.writeByte(item);
|
||||
meta.getType().write(buffer, meta.getValue());
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,8 @@ public class MetadataList1_8Type extends MetaListTypeTemplate {
|
||||
|
||||
@Override
|
||||
public void write(ByteBuf buffer, List<Metadata> object) throws Exception {
|
||||
throw new UnsupportedOperationException("1.8 MetadataList writing is not implemented");
|
||||
for (Metadata data : object)
|
||||
Types1_8.METADATA.write(buffer, data);
|
||||
buffer.writeByte(127);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user