Added ItemSpawnEvent

This commit is contained in:
Shoghi Cervantes
2014-10-08 16:53:13 +02:00
parent c750a204e6
commit 4a3163b4c8
2 changed files with 52 additions and 0 deletions

View File

@@ -24,6 +24,7 @@ namespace pocketmine\entity;
use pocketmine\event\entity\EntityDamageEvent;
use pocketmine\event\entity\EntityRegainHealthEvent;
use pocketmine\event\entity\ItemDespawnEvent;
use pocketmine\event\entity\ItemSpawnEvent;
use pocketmine\item\Item;
use pocketmine\math\Vector3;
use pocketmine\nbt\tag\Byte;
@@ -67,6 +68,9 @@ class DroppedItem extends Entity{
$this->thrower = $this->namedtag["Thrower"];
}
$this->item = Item::get($this->namedtag->Item["id"], $this->namedtag->Item["Damage"], $this->namedtag->Item["Count"]);
$this->server->getPluginManager()->callEvent(new ItemSpawnEvent($this));
}
public function onUpdate(){