Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-11-04 23:30:24 +01:00
Implement 1_8 writing
Dieser Commit ist enthalten in:
Ursprung
afca92d122
Commit
d715607826
@ -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);
|
||||
}
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren