summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/bukkit/World.java
diff options
context:
space:
mode:
authorrmichela <deltahat@gmail.com>2011-12-08 00:33:33 -0500
committerErik Broes <erikbroes@grum.nl>2012-02-29 19:16:04 +0100
commitcd732ee3f71ae63711fb776e35caf8e13dbcdc8e (patch)
tree86b895be806bb2788b7fe0fff945df759ade6a71 /src/main/java/org/bukkit/World.java
parentca7aab6f4ffab1a025e7385cafef45b664346d6c (diff)
downloadbukkit-cd732ee3f71ae63711fb776e35caf8e13dbcdc8e.tar
bukkit-cd732ee3f71ae63711fb776e35caf8e13dbcdc8e.tar.gz
bukkit-cd732ee3f71ae63711fb776e35caf8e13dbcdc8e.tar.lz
bukkit-cd732ee3f71ae63711fb776e35caf8e13dbcdc8e.tar.xz
bukkit-cd732ee3f71ae63711fb776e35caf8e13dbcdc8e.zip
[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.
Diffstat (limited to 'src/main/java/org/bukkit/World.java')
-rw-r--r--src/main/java/org/bukkit/World.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 5212f961..1b326a55 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -13,13 +13,14 @@ import org.bukkit.block.Block;
import org.bukkit.entity.*;
import org.bukkit.generator.BlockPopulator;
import org.bukkit.inventory.ItemStack;
+import org.bukkit.metadata.Metadatable;
import org.bukkit.plugin.messaging.PluginMessageRecipient;
import org.bukkit.util.Vector;
/**
* Represents a world, which may contain entities, chunks and blocks
*/
-public interface World extends PluginMessageRecipient {
+public interface World extends PluginMessageRecipient, Metadatable {
/**
* Gets the {@link Block} at the given coordinates