Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[B+C] Add ItemMeta.hasCustomData/getCustomData. Adds BUKKIT-3221 #1064

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Commits on May 14, 2014

  1. Configuration menu
    Copy the full SHA
    a6631c4 View commit details
    Browse the repository at this point in the history

Commits on May 16, 2014

  1. ItemMeta extends Metadatable

    This replaces the ConfigurationSection-based getCustomData() method.
    
    The metadata store will only accept a new PersistentMetadataValue
    class, which encapsulates and hopefully clarifies the notion that only
    "persistable" data can be stored here. This includes Lists, Maps, most
    basic types, and ConfigurationSerializable objects.
    NathanWolf committed May 16, 2014
    Configuration menu
    Copy the full SHA
    10b3367 View commit details
    Browse the repository at this point in the history

Commits on May 19, 2014

  1. Add ItemStack.hasMetadata(String key)

    This provides an efficient mechanism for the common use case of wanting
    to check for the presence of a specific metadata key without unpacking
    all of the metadata.
    NathanWolf committed May 19, 2014
    Configuration menu
    Copy the full SHA
    9c68c5e View commit details
    Browse the repository at this point in the history
  2. Implement ItemStack.hasMetadata

    I have to admit I'm not sure what specific use cases will result in the
    base ItemStack methods getting called, but this is generally the
    correct thing to do, and let descending classes override for
    optimization purposes.
    NathanWolf committed May 19, 2014
    Configuration menu
    Copy the full SHA
    8ec74fc View commit details
    Browse the repository at this point in the history

Commits on May 20, 2014

  1. Configuration menu
    Copy the full SHA
    0f3caaa View commit details
    Browse the repository at this point in the history
  2. Add ItemMeta.getMetadata(String, Plugin)

    I think this is a good fit here as an extension to Metadatable, the
    more common use case is for a Plugin to want to retrieve its own data.
    NathanWolf committed May 20, 2014
    Configuration menu
    Copy the full SHA
    5998742 View commit details
    Browse the repository at this point in the history

Commits on May 22, 2014

  1. Remove the ItemStack.hasMetadata method

    There is no longer an efficient way to perform this check, and I don't
    believe there was a valid use case for its existence in the API in the
    first place.
    
    If a Plugin wants to interrogate for data, it should be doing so with a
    specific key.
    NathanWolf committed May 22, 2014
    Configuration menu
    Copy the full SHA
    9aeeb63 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6efa7b2 View commit details
    Browse the repository at this point in the history
  3. Clean up PersistentMetadataValue

    Extend MetadataValueAdapter directly for performance, and remove all
    the variant constructor types. They were meant to serve as a
    compile-time suggestion for what types are ok, but in practice it feels
    cluttered.
    NathanWolf committed May 22, 2014
    Configuration menu
    Copy the full SHA
    a53497b View commit details
    Browse the repository at this point in the history

Commits on May 25, 2014

  1. Restructure PersistentMetadataValue

    Restore type-specific constructors, and add asList and asMap accessors.
    I did not add array accessors.
    NathanWolf committed May 25, 2014
    Configuration menu
    Copy the full SHA
    b8ed542 View commit details
    Browse the repository at this point in the history

Commits on Aug 15, 2014

  1. Configuration menu
    Copy the full SHA
    3f49f5d View commit details
    Browse the repository at this point in the history