mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-13 15:05:33 +00:00
Merge branch 'master' into 0.10
This commit is contained in:
commit
d2f4a14d66
@ -863,7 +863,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
|||||||
|
|
||||||
$time = $this->level->getTime() % Level::TIME_FULL;
|
$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){
|
foreach($this->level->getPlayers() as $p){
|
||||||
if($p->sleeping === false){
|
if($p->sleeping === false){
|
||||||
return;
|
return;
|
||||||
@ -2424,6 +2424,9 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
|||||||
|
|
||||||
case EntityDamageEvent::CAUSE_BLOCK_EXPLOSION:
|
case EntityDamageEvent::CAUSE_BLOCK_EXPLOSION:
|
||||||
case EntityDamageEvent::CAUSE_ENTITY_EXPLOSION:
|
case EntityDamageEvent::CAUSE_ENTITY_EXPLOSION:
|
||||||
|
$message = $this->getName() . " blew up";
|
||||||
|
break;
|
||||||
|
|
||||||
case EntityDamageEvent::CAUSE_MAGIC:
|
case EntityDamageEvent::CAUSE_MAGIC:
|
||||||
case EntityDamageEvent::CAUSE_CUSTOM:
|
case EntityDamageEvent::CAUSE_CUSTOM:
|
||||||
|
|
||||||
|
@ -1988,7 +1988,7 @@ class Server{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function __debugInfo(){
|
public function __debugInfo(){
|
||||||
return get_class($this);
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
private function tickProcessor(){
|
private function tickProcessor(){
|
||||||
|
@ -1175,7 +1175,7 @@ abstract class Entity extends Location implements Metadatable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function close(){
|
public function close(){
|
||||||
if($this->closed === false){
|
if(!$this->closed){
|
||||||
$this->server->getPluginManager()->callEvent(new EntityDespawnEvent($this));
|
$this->server->getPluginManager()->callEvent(new EntityDespawnEvent($this));
|
||||||
$this->closed = true;
|
$this->closed = true;
|
||||||
unset($this->level->updateEntities[$this->id]);
|
unset($this->level->updateEntities[$this->id]);
|
||||||
|
@ -205,7 +205,7 @@ class Explosion{
|
|||||||
$tnt->spawnToAll();
|
$tnt->spawnToAll();
|
||||||
}elseif(mt_rand(0, 100) < $yield){
|
}elseif(mt_rand(0, 100) < $yield){
|
||||||
foreach($block->getDrops($air) as $drop){
|
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);
|
$this->level->setBlockIdAt($block->x, $block->y, $block->z, 0);
|
||||||
|
@ -170,7 +170,7 @@ class Chunk extends BaseChunk{
|
|||||||
$entities = [];
|
$entities = [];
|
||||||
|
|
||||||
foreach($this->getEntities() as $entity){
|
foreach($this->getEntities() as $entity){
|
||||||
if(!($entity instanceof Player) and $entity->closed !== true){
|
if(!($entity instanceof Player) and !$entity->closed){
|
||||||
$entity->saveNBT();
|
$entity->saveNBT();
|
||||||
$entities[] = $entity->namedtag;
|
$entities[] = $entity->namedtag;
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ abstract class Tile extends Position{
|
|||||||
public $z;
|
public $z;
|
||||||
public $attach;
|
public $attach;
|
||||||
public $metadata;
|
public $metadata;
|
||||||
public $closed;
|
public $closed = false;
|
||||||
public $namedtag;
|
public $namedtag;
|
||||||
protected $lastUpdate;
|
protected $lastUpdate;
|
||||||
protected $server;
|
protected $server;
|
||||||
@ -69,7 +69,6 @@ abstract class Tile extends Position{
|
|||||||
$this->chunk = $chunk;
|
$this->chunk = $chunk;
|
||||||
$this->setLevel($chunk->getProvider()->getLevel());
|
$this->setLevel($chunk->getProvider()->getLevel());
|
||||||
$this->namedtag = $nbt;
|
$this->namedtag = $nbt;
|
||||||
$this->closed = false;
|
|
||||||
$this->name = "";
|
$this->name = "";
|
||||||
$this->lastUpdate = microtime(true);
|
$this->lastUpdate = microtime(true);
|
||||||
$this->id = Tile::$tileCount++;
|
$this->id = Tile::$tileCount++;
|
||||||
@ -112,7 +111,7 @@ abstract class Tile extends Position{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function close(){
|
public function close(){
|
||||||
if($this->closed === false){
|
if(!$this->closed){
|
||||||
$this->closed = true;
|
$this->closed = true;
|
||||||
unset($this->level->updateTiles[$this->id]);
|
unset($this->level->updateTiles[$this->id]);
|
||||||
if($this->chunk instanceof FullChunk){
|
if($this->chunk instanceof FullChunk){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user