3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-27 16:40:10 +01:00

Implement 1_8 writing

Dieser Commit ist enthalten in:
Matsv 2016-08-05 20:17:39 +02:00
Ursprung afca92d122
Commit d715607826
2 geänderte Dateien mit 7 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -19,7 +19,9 @@ public class Metadata1_8Type extends MetaTypeTemplate {
} }
@Override @Override
public void write(ByteBuf buffer, Metadata object) throws Exception { public void write(ByteBuf buffer, Metadata meta) throws Exception {
throw new UnsupportedOperationException("1.8 Metadata writing is not implemented!"); byte item = (byte) (meta.getTypeID() << 5 | meta.getId() & 0x1F);
buffer.writeByte(item);
meta.getType().write(buffer, meta.getValue());
} }
} }

Datei anzeigen

@ -25,6 +25,8 @@ public class MetadataList1_8Type extends MetaListTypeTemplate {
@Override @Override
public void write(ByteBuf buffer, List<Metadata> object) throws Exception { 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);
} }
} }