Compatibility with pthreads > 2.0.8

This commit is contained in:
Shoghi Cervantes
2014-10-02 16:58:37 +02:00
parent 539fa232f8
commit 602bdf27a5
12 changed files with 58 additions and 37 deletions

View File

@@ -661,13 +661,13 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
$this->inventory->sendContents($this);
$this->inventory->sendArmorContents($this);
$this->spawnToAll();
$this->server->getPluginManager()->callEvent($ev = new PlayerJoinEvent($this, TextFormat::YELLOW . $this->getName() . " joined the game"));
if(strlen(trim($ev->getJoinMessage())) > 0){
$this->server->broadcastMessage($ev->getJoinMessage());
}
$this->spawnToAll();
if($this->server->getUpdater()->hasUpdate() and $this->hasPermission(Server::BROADCAST_CHANNEL_ADMINISTRATIVE)){
$this->server->getUpdater()->showPlayerUpdate($this);
}
@@ -1171,8 +1171,8 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
$this->processMovement();
$hasUpdate = $this->entityBaseTick();
foreach($this->getLevel()->getNearbyEntities($this->boundingBox->grow(1, 1, 1), $this) as $entity){
$this->entityBaseTick();
foreach($this->level->getNearbyEntities($this->boundingBox->grow(1, 1, 1), $this) as $entity){
if($entity instanceof Arrow and $entity->onGround and $this->motionX == 0 and $this->motionY == 0 and $this->motionZ == 0){
if($entity->dead !== true){
$item = Item::get(Item::ARROW, 0, 1);
@@ -2418,6 +2418,8 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
$this->server->broadcast($ev->getDeathMessage(), Server::BROADCAST_CHANNEL_USERS);
}
$this->despawnFromAll();
}
public function setHealth($amount){