mirror of
https://github.com/dmulloy2/ProtocolLib.git
synced 2024-11-27 21:26:17 +01:00
Merge pull request #265 from faradize/master
Added the ability of reading/writing lists of NBT classes!
This commit is contained in:
commit
051989a396
@ -520,6 +520,21 @@ public class PacketContainer implements Serializable {
|
|||||||
BukkitConverters.getNbtConverter());
|
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.
|
* Retrieves a read/write structure for Vectors.
|
||||||
* @return A modifier for Vectors.
|
* @return A modifier for Vectors.
|
||||||
|
Loading…
Reference in New Issue
Block a user