mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +00:00
New way to spawn entities/tiles using a global register table, allow overriding default entity/tile classes via classes
This commit is contained in:
@ -22,7 +22,7 @@
|
||||
namespace pocketmine\event\entity;
|
||||
|
||||
use pocketmine\entity\Creature;
|
||||
use pocketmine\entity\DroppedItem;
|
||||
use pocketmine\entity\Item;
|
||||
use pocketmine\entity\Entity;
|
||||
use pocketmine\entity\Human;
|
||||
use pocketmine\entity\Projectile;
|
||||
@ -85,7 +85,7 @@ class EntityDespawnEvent extends EntityEvent{
|
||||
* @return bool
|
||||
*/
|
||||
public function isItem(){
|
||||
return $this->entity instanceof DroppedItem;
|
||||
return $this->entity instanceof Item;
|
||||
}
|
||||
|
||||
}
|
@ -22,7 +22,7 @@
|
||||
namespace pocketmine\event\entity;
|
||||
|
||||
use pocketmine\entity\Creature;
|
||||
use pocketmine\entity\DroppedItem;
|
||||
use pocketmine\entity\Item;
|
||||
use pocketmine\entity\Entity;
|
||||
use pocketmine\entity\Human;
|
||||
use pocketmine\entity\Projectile;
|
||||
@ -92,7 +92,7 @@ class EntitySpawnEvent extends EntityEvent{
|
||||
* @return bool
|
||||
*/
|
||||
public function isItem(){
|
||||
return $this->entity instanceof DroppedItem;
|
||||
return $this->entity instanceof Item;
|
||||
}
|
||||
|
||||
}
|
@ -21,7 +21,7 @@
|
||||
|
||||
namespace pocketmine\event\entity;
|
||||
|
||||
use pocketmine\entity\DroppedItem;
|
||||
use pocketmine\entity\Item;
|
||||
use pocketmine\event\Cancellable;
|
||||
|
||||
class ItemDespawnEvent extends EntityEvent implements Cancellable{
|
||||
@ -30,15 +30,15 @@ class ItemDespawnEvent extends EntityEvent implements Cancellable{
|
||||
public static $nextEvent = 0;
|
||||
|
||||
/**
|
||||
* @param DroppedItem $item
|
||||
* @param Item $item
|
||||
*/
|
||||
public function __construct(DroppedItem $item){
|
||||
public function __construct(Item $item){
|
||||
$this->entity = $item;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return DroppedItem
|
||||
* @return Item
|
||||
*/
|
||||
public function getEntity(){
|
||||
return $this->entity;
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
namespace pocketmine\event\entity;
|
||||
|
||||
use pocketmine\entity\DroppedItem;
|
||||
use pocketmine\entity\Item;
|
||||
|
||||
class ItemSpawnEvent extends EntityEvent{
|
||||
public static $handlerList = null;
|
||||
@ -29,15 +29,15 @@ class ItemSpawnEvent extends EntityEvent{
|
||||
public static $nextEvent = 0;
|
||||
|
||||
/**
|
||||
* @param DroppedItem $item
|
||||
* @param Item $item
|
||||
*/
|
||||
public function __construct(DroppedItem $item){
|
||||
public function __construct(Item $item){
|
||||
$this->entity = $item;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return DroppedItem
|
||||
* @return Item
|
||||
*/
|
||||
public function getEntity(){
|
||||
return $this->entity;
|
||||
|
Reference in New Issue
Block a user