mirror of
https://github.com/dmulloy2/ProtocolLib.git
synced 2025-01-03 15:08:19 +01:00
Added the ability of reading/writing lists of NBT classes!
Works perfectly with MapChunk-Packet's TileEntity-Data!
This commit is contained in:
parent
caaa57c915
commit
474c74b1f9
@ -520,6 +520,21 @@ public class PacketContainer implements Serializable {
|
||||
BukkitConverters.getNbtConverter());
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a read/write structure for lists of NBT classes.
|
||||
* @return A modifier for lists of NBT classes.
|
||||
*/
|
||||
public StructureModifier<List<NbtBase<?>>> getListNbtModifier() {
|
||||
// Convert to and from the ProtocolLib wrapper
|
||||
return structureModifier.withType(
|
||||
Collection.class,
|
||||
BukkitConverters.getListConverter(
|
||||
MinecraftReflection.getNBTBaseClass(),
|
||||
BukkitConverters.getNbtConverter()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a read/write structure for Vectors.
|
||||
* @return A modifier for Vectors.
|
||||
|
Loading…
Reference in New Issue
Block a user