12 Commits

Author SHA1 Message Date
rmichela
cd732ee3f7 [Bleeding] Added a Metadata framework for Entities, Blocks, and Worlds
This metadata implementation has the following features:

- All metadata is lazy. Metadata values are not actually computed until another plugin requests them. Memory and CPU are conserved by not computing and storing unnecessary metadata values.

- All metadata is cached. Once a metadata value is computed its value is cached in the metadata store to prevent further unnecessary computation. An invalidation mechanism is provided to flush the cache and force recompilation of metadata values.

- All metadata is stored in basic data types. Convenience methods in the MetadataValue class allow for the conversion of metadata data types when possible. Restricting metadata to basic data types prevents the accidental linking of large object graphs into metadata. Metadata is persistent across the lifetime of the application and adding large object graphs would damage garbage collector performance.

- Metadata access is thread safe. Care has been taken to protect the internal data structures and access them in a thread safe manner.

- Metadata is exposed for all objects that descend from Entity, Block, and World. All Entity and World metadata is stored at the Server  level and all Block metadata is stored at the World level.

- Metadata is NOT keyed on references to original objects - instead metadata is keyed off of unique fields within those objects. Doing this allows metadata to exist for blocks that are in chunks not currently in memory. Additionally, Player objects are keyed off of player name so that Player metadata remains consistent between logins.

- Metadata convenience methods have been added to all Entities, Players, Blocks, BlockStates, and World allowing direct access to an individual instance's metadata.

- Players and OfflinePlayers share a single metadata store, allowing player metadata to be manipulated regardless of the player's current online status.
2012-02-29 19:16:04 +01:00
TomyLobo
7d51bc7834 Added missing BlockState functions. Addresses BUKKIT-807 2012-02-27 17:52:44 -05:00
Erik Broes
88c17a7f86 Generic cleaning 2012-01-15 14:37:43 +01:00
Dinnerbone
fe4f4c5f58 Many javadoc fixes thanks to Celtic Minstrel 2011-09-25 02:56:40 +01:00
Erik Broes
992f1f2bf3 Whitespace + general cleanup 2011-05-15 14:06:02 +02:00
Tahg
dbab772ca8 refactor Items 2011-02-21 19:57:06 -05:00
Erik Broes
01988e8f6b General cleanup (deprecated+whitespace) 2011-02-02 00:28:41 +01:00
Dinnerbone
ba635ade10 Moved block stuff from org.bukkit to org.bukkit.block 2011-01-15 21:37:08 +00:00
Erik Broes
7754b08893 Global ID -> Id rename 2011-01-15 20:54:06 +01:00
Dinnerbone
c25b2984b5 Added MaterialData from BlockState 2011-01-15 19:41:18 +00:00
Dinnerbone
af781b4317 Added state update() 2011-01-07 16:53:29 +00:00
Dinnerbone
4cdd519963 Make a start on BlockState stuff 2011-01-07 16:17:54 +00:00