Added object metadata for Plugins, use WeakMap on perms

This commit is contained in:
Shoghi Cervantes
2014-05-19 20:07:27 +02:00
parent 88f9347093
commit 99818a26f5
16 changed files with 540 additions and 19 deletions

View File

@ -22,7 +22,9 @@
namespace pocketmine;
use pocketmine\metadata\MetadataValue;
use pocketmine\nbt\tag\Compound;
use pocketmine\plugin\Plugin;
class OfflinePlayer implements IPlayer{
@ -112,5 +114,21 @@ class OfflinePlayer implements IPlayer{
return $this->namedtag instanceof Compound;
}
public function setMetadata($metadataKey, MetadataValue $metadataValue){
$this->server->getPlayerMetadata()->setMetadata($this, $metadataKey, $metadataValue);
}
public function getMetadata($metadataKey){
return $this->server->getPlayerMetadata()->getMetadata($this, $metadataKey);
}
public function hasMetadata($metadataKey){
return $this->server->getPlayerMetadata()->hasMetadata($this, $metadataKey);
}
public function removeMetadata($metadataKey, Plugin $plugin){
$this->server->getPlayerMetadata()->removeMetadata($this, $metadataKey, $plugin);
}
}