Merge pull request #265 from faradize/master

Added the ability of reading/writing lists of NBT classes!
This commit is contained in:
Dan Mulloy 2016-09-11 17:00:25 -04:00 committed by GitHub
commit 051989a396

View File

@ -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.