diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index 85265c25a7..b6e91472c4 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -863,7 +863,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{ $time = $this->level->getTime() % Level::TIME_FULL; - if($time >= Level::TIME_NIGHT and $time < Level::TIME_SUNRISE);{ + if($time >= Level::TIME_NIGHT and $time < Level::TIME_SUNRISE){ foreach($this->level->getPlayers() as $p){ if($p->sleeping === false){ return; @@ -2424,6 +2424,9 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{ case EntityDamageEvent::CAUSE_BLOCK_EXPLOSION: case EntityDamageEvent::CAUSE_ENTITY_EXPLOSION: + $message = $this->getName() . " blew up"; + break; + case EntityDamageEvent::CAUSE_MAGIC: case EntityDamageEvent::CAUSE_CUSTOM: @@ -2617,4 +2620,4 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{ } -} \ No newline at end of file +} diff --git a/src/pocketmine/Server.php b/src/pocketmine/Server.php index 1e3272ab3f..b4700540b7 100644 --- a/src/pocketmine/Server.php +++ b/src/pocketmine/Server.php @@ -1988,7 +1988,7 @@ class Server{ } public function __debugInfo(){ - return get_class($this); + return []; } private function tickProcessor(){ diff --git a/src/pocketmine/entity/Entity.php b/src/pocketmine/entity/Entity.php index 80209d80ca..2ebce59fcf 100644 --- a/src/pocketmine/entity/Entity.php +++ b/src/pocketmine/entity/Entity.php @@ -1175,7 +1175,7 @@ abstract class Entity extends Location implements Metadatable{ } public function close(){ - if($this->closed === false){ + if(!$this->closed){ $this->server->getPluginManager()->callEvent(new EntityDespawnEvent($this)); $this->closed = true; unset($this->level->updateEntities[$this->id]); diff --git a/src/pocketmine/level/Explosion.php b/src/pocketmine/level/Explosion.php index 4be81852b7..c22441dab6 100644 --- a/src/pocketmine/level/Explosion.php +++ b/src/pocketmine/level/Explosion.php @@ -205,7 +205,7 @@ class Explosion{ $tnt->spawnToAll(); }elseif(mt_rand(0, 100) < $yield){ foreach($block->getDrops($air) as $drop){ - $this->level->dropItem($block, Item::get(...$drop)); + $this->level->dropItem($block->add(0.5, 0.5, 0.5), Item::get(...$drop)); } } $this->level->setBlockIdAt($block->x, $block->y, $block->z, 0); diff --git a/src/pocketmine/level/format/anvil/Chunk.php b/src/pocketmine/level/format/anvil/Chunk.php index 0373a0d567..1fccad31f0 100644 --- a/src/pocketmine/level/format/anvil/Chunk.php +++ b/src/pocketmine/level/format/anvil/Chunk.php @@ -170,7 +170,7 @@ class Chunk extends BaseChunk{ $entities = []; foreach($this->getEntities() as $entity){ - if(!($entity instanceof Player) and $entity->closed !== true){ + if(!($entity instanceof Player) and !$entity->closed){ $entity->saveNBT(); $entities[] = $entity->namedtag; } diff --git a/src/pocketmine/tile/Tile.php b/src/pocketmine/tile/Tile.php index 2444e6b337..b87fd6a43b 100644 --- a/src/pocketmine/tile/Tile.php +++ b/src/pocketmine/tile/Tile.php @@ -49,7 +49,7 @@ abstract class Tile extends Position{ public $z; public $attach; public $metadata; - public $closed; + public $closed = false; public $namedtag; protected $lastUpdate; protected $server; @@ -69,7 +69,6 @@ abstract class Tile extends Position{ $this->chunk = $chunk; $this->setLevel($chunk->getProvider()->getLevel()); $this->namedtag = $nbt; - $this->closed = false; $this->name = ""; $this->lastUpdate = microtime(true); $this->id = Tile::$tileCount++; @@ -112,7 +111,7 @@ abstract class Tile extends Position{ } public function close(){ - if($this->closed === false){ + if(!$this->closed){ $this->closed = true; unset($this->level->updateTiles[$this->id]); if($this->chunk instanceof FullChunk){