/** * Retrieve a read/write structure for the List class. * @param converter Converter for elements * @param <E> Element param * @return A modifier for List fields */ public <E> StructureModifier<List<E>> getLists(EquivalentConverter<E> converter) { return structureModifier.withType( List.class, BukkitConverters.getListConverter(converter)); }
/** * 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(BukkitConverters.getNbtConverter()) ); }
/** * Retrieve a read/write structure for the PlayerInfoData list fields in the following packet: <br> * <ul> * <li>{@link PacketType.Play.Server#PLAYER_INFO} * </ul> * @return A modifier for PlayerInfoData list fields. */ public StructureModifier<List<PlayerInfoData>> getPlayerInfoDataLists() { // Convert to and from the ProtocolLib wrapper return structureModifier.withType( Collection.class, BukkitConverters.getListConverter(PlayerInfoData.getConverter())); }
/** * Retrieves a read/write structure for collections of watchable objects. * <p> * This modifier will automatically marshal between the visible WrappedWatchableObject and the * internal Minecraft WatchableObject. * @return A modifier for watchable object list fields. */ public StructureModifier<List<WrappedWatchableObject>> getWatchableCollectionModifier() { // Convert to and from the ProtocolLib wrapper return structureModifier.withType( Collection.class, BukkitConverters.getListConverter(BukkitConverters.getWatchableObjectConverter())); }
/** * Retrieves a read/write structure for lists of ItemStacks. * <p> * This modifier will automatically marshal between the Bukkit ItemStack and the * internal Minecraft ItemStack. * @return A modifier for ItemStack list fields. */ public StructureModifier<List<ItemStack>> getItemListModifier() { // Convert to and from the Bukkit wrapper return structureModifier.withType( List.class, BukkitConverters.getListConverter(BukkitConverters.getItemStackConverter()) ); }
/** * Retrieves a read/write structure for collections of attribute snapshots. * <p> * This modifier will automatically marshal between the visible ProtocolLib WrappedAttribute and the * internal Minecraft AttributeSnapshot. * @return A modifier for AttributeSnapshot collection fields. */ public StructureModifier<List<WrappedAttribute>> getAttributeCollectionModifier() { // Convert to and from the ProtocolLib wrapper return structureModifier.withType( Collection.class, BukkitConverters.getListConverter(BukkitConverters.getWrappedAttributeConverter()) ); }
/** * Retrieves a read/write structure for collections of chunk positions. * <p> * This modifier will automatically marshal between the visible ProtocolLib ChunkPosition and the * internal Minecraft ChunkPosition. * * @return A modifier for ChunkPosition list fields. */ public StructureModifier<List<ChunkPosition>> getPositionCollectionModifier() { // Convert to and from the ProtocolLib wrapper return structureModifier.withType( Collection.class, BukkitConverters.getListConverter(ChunkPosition.getConverter())); }
/** * Retrieves a read/write structure for collections of chunk positions. * <p> * This modifier will automatically marshal between the visible ProtocolLib BlockPosition and the * internal Minecraft BlockPosition. * * @return A modifier for ChunkPosition list fields. */ public StructureModifier<List<BlockPosition>> getBlockPositionCollectionModifier() { // Convert to and from the ProtocolLib wrapper return structureModifier.withType( Collection.class, BukkitConverters.getListConverter(BlockPosition.getConverter())); }