Workaround client-sede issue, remove this when fixed

This commit is contained in:
Shoghi Cervantes 2015-05-24 10:16:43 +02:00
parent c4d63326be
commit 66435d4f6a
No known key found for this signature in database
GPG Key ID: 78464DB0A7837F89
3 changed files with 10 additions and 4 deletions

View File

@ -2706,9 +2706,9 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
$pk = new TextPacket(); $pk = new TextPacket();
if(!$this->server->isLanguageForced()){ if(!$this->server->isLanguageForced()){
$pk->type = TextPacket::TYPE_TRANSLATION; $pk->type = TextPacket::TYPE_TRANSLATION;
$pk->message = $this->server->getLanguage()->translateString($message, [], "pocketmine."); $pk->message = $this->server->getLanguage()->translateString($message, $parameters, "pocketmine.");
foreach($parameters as $i => $p){ foreach($parameters as $i => $p){
$parameters[$i] = $this->server->getLanguage()->translateString($p, [], "pocketmine."); $parameters[$i] = $this->server->getLanguage()->translateString($p, $parameters, "pocketmine.");
} }
$pk->parameters = $parameters; $pk->parameters = $parameters;
}else{ }else{

View File

@ -2204,7 +2204,9 @@ class Server{
if($this->isRunning === false){ if($this->isRunning === false){
return; return;
} }
$this->sendUsage(SendUsageTask::TYPE_CLOSE); if($this->sendUsageTicker > 0){
$this->sendUsage(SendUsageTask::TYPE_CLOSE);
}
$this->hasStopped = false; $this->hasStopped = false;
ini_set("error_reporting", 0); ini_set("error_reporting", 0);

View File

@ -1008,6 +1008,10 @@ abstract class Entity extends Location implements Metadatable{
} }
protected function switchLevel(Level $targetLevel){ protected function switchLevel(Level $targetLevel){
if($this->closed){
return false;
}
if($this->isValid()){ if($this->isValid()){
$this->server->getPluginManager()->callEvent($ev = new EntityLevelChangeEvent($this, $this->level, $targetLevel)); $this->server->getPluginManager()->callEvent($ev = new EntityLevelChangeEvent($this, $this->level, $targetLevel));
if($ev->isCancelled()){ if($ev->isCancelled()){
@ -1496,7 +1500,7 @@ abstract class Entity extends Location implements Metadatable{
if($this->chunk !== null){ if($this->chunk !== null){
$this->chunk->removeEntity($this); $this->chunk->removeEntity($this);
} }
if($this->level instanceof Level){ if($this->level !== null){
$this->level->removeEntity($this); $this->level->removeEntity($this);
} }
} }