Commit Graph

17 Commits

Author SHA1 Message Date
Wesley Wolfe
1f83111208 Deprecate magic values 2013-08-28 01:44:09 -05:00
Edmond Poon
409595c2a2 Pulling all pending Bukkit-JavaDoc changes 2013-04-02 00:11:22 -04:00
Travis Watkins
7c8d3d4007 Add method to update state without physics update. Addresses BUKKIT-3939 2013-03-31 19:16:53 -05:00
Travis Watkins
0700565d8b Provide a faster way to get a location. Adds BUKKIT-3120
Currently when a plugin wants to get the location of something it calls
getLocation() which returns a new Location object. In some scenarios this
can cause enough object creation/destruction churn to be a significant
overhead. For this cases we add a method that updates a provided Location
object so there is no object creation done. This allows well written code
to work on several locations with only a single Location object getting
created.

Providing a more efficient way to set a location was also looked at but
the current solution is the fastest we can provide. You are not required
to create a new Location object every time you want to set something's
location so, with proper design, you can set locations with only a single
Location object being created.
2012-12-07 21:18:31 -06:00
Celtic Minstrel
18a4a25c8b Adding/expanding documentation 2012-02-29 21:31:33 -05:00
rmichela
a2c69f9f51 [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
b0bb7aaa66 Added missing BlockState functions. Addresses BUKKIT-807 2012-02-27 17:52:44 -05:00
Erik Broes
eb9dc64493 Generic cleaning 2012-01-15 14:37:43 +01:00
Dinnerbone
e6c273e8b0 Many javadoc fixes thanks to Celtic Minstrel 2011-09-25 02:56:40 +01:00
Erik Broes
c4d444ce98 Whitespace + general cleanup 2011-05-15 14:06:02 +02:00
Tahg
d82679b8c7 refactor Items 2011-02-21 19:57:06 -05:00
Erik Broes
8039c05c9f General cleanup (deprecated+whitespace) 2011-02-02 00:28:41 +01:00
Dinnerbone
e50b5d6ecf Moved block stuff from org.bukkit to org.bukkit.block 2011-01-15 21:37:08 +00:00
Erik Broes
b8072b8a37 Global ID -> Id rename 2011-01-15 20:54:06 +01:00
Dinnerbone
ce1247aa2e Added MaterialData from BlockState 2011-01-15 19:41:18 +00:00
Dinnerbone
6696ca34f6 Added state update() 2011-01-07 16:53:29 +00:00
Dinnerbone
33bcc6c21e Make a start on BlockState stuff 2011-01-07 16:17:54 +00:00