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
base: master
Are you sure you want to change the base?
Commits on May 14, 2014
-
Configuration menu - View commit details
-
Copy full SHA for a6631c4 - Browse repository at this point
Copy the full SHA a6631c4View commit details
Commits on May 16, 2014
-
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.
Configuration menu - View commit details
-
Copy full SHA for 10b3367 - Browse repository at this point
Copy the full SHA 10b3367View commit details
Commits on May 19, 2014
-
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.
Configuration menu - View commit details
-
Copy full SHA for 9c68c5e - Browse repository at this point
Copy the full SHA 9c68c5eView commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 8ec74fc - Browse repository at this point
Copy the full SHA 8ec74fcView commit details
Commits on May 20, 2014
-
Configuration menu - View commit details
-
Copy full SHA for 0f3caaa - Browse repository at this point
Copy the full SHA 0f3caaaView commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 5998742 - Browse repository at this point
Copy the full SHA 5998742View commit details
Commits on May 22, 2014
-
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.
Configuration menu - View commit details
-
Copy full SHA for 9aeeb63 - Browse repository at this point
Copy the full SHA 9aeeb63View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6efa7b2 - Browse repository at this point
Copy the full SHA 6efa7b2View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for a53497b - Browse repository at this point
Copy the full SHA a53497bView commit details
Commits on May 25, 2014
-
Restructure PersistentMetadataValue
Restore type-specific constructors, and add asList and asMap accessors. I did not add array accessors.
Configuration menu - View commit details
-
Copy full SHA for b8ed542 - Browse repository at this point
Copy the full SHA b8ed542View commit details
Commits on Aug 15, 2014
-
Configuration menu - View commit details
-
Copy full SHA for 3f49f5d - Browse repository at this point
Copy the full SHA 3f49f5dView commit details