mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-31 09:17:42 +00:00
Added 64-bit entity data field
This commit is contained in:
parent
b5b46bfd7e
commit
6af87814e3
@ -647,6 +647,12 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->spawned = true;
|
$this->spawned = true;
|
||||||
|
|
||||||
|
$this->sendSettings();
|
||||||
|
$this->sendData($this);
|
||||||
|
$this->sendPotionEffects($this);
|
||||||
|
$this->inventory->sendContents($this);
|
||||||
|
$this->inventory->sendArmorContents($this);
|
||||||
|
|
||||||
$pk = new PlayStatusPacket();
|
$pk = new PlayStatusPacket();
|
||||||
$pk->status = PlayStatusPacket::PLAYER_SPAWN;
|
$pk->status = PlayStatusPacket::PLAYER_SPAWN;
|
||||||
@ -663,12 +669,6 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
|||||||
|
|
||||||
$this->teleport($ev->getRespawnPosition());
|
$this->teleport($ev->getRespawnPosition());
|
||||||
|
|
||||||
$this->sendSettings();
|
|
||||||
$this->sendData($this);
|
|
||||||
$this->sendPotionEffects($this);
|
|
||||||
$this->inventory->sendContents($this);
|
|
||||||
$this->inventory->sendArmorContents($this);
|
|
||||||
|
|
||||||
$this->server->getPluginManager()->callEvent($ev = new PlayerJoinEvent($this, TextFormat::YELLOW . $this->getName() . " joined the game"));
|
$this->server->getPluginManager()->callEvent($ev = new PlayerJoinEvent($this, TextFormat::YELLOW . $this->getName() . " joined the game"));
|
||||||
if(strlen(trim($ev->getJoinMessage())) > 0){
|
if(strlen(trim($ev->getJoinMessage())) > 0){
|
||||||
$this->server->broadcastMessage($ev->getJoinMessage());
|
$this->server->broadcastMessage($ev->getJoinMessage());
|
||||||
|
@ -76,6 +76,7 @@ abstract class Entity extends Location implements Metadatable{
|
|||||||
const DATA_TYPE_SLOT = 5;
|
const DATA_TYPE_SLOT = 5;
|
||||||
const DATA_TYPE_POS = 6;
|
const DATA_TYPE_POS = 6;
|
||||||
const DATA_TYPE_ROTATION = 7;
|
const DATA_TYPE_ROTATION = 7;
|
||||||
|
const DATA_TYPE_LONG = 8;
|
||||||
|
|
||||||
const DATA_FLAGS = 0;
|
const DATA_FLAGS = 0;
|
||||||
const DATA_AIR = 1;
|
const DATA_AIR = 1;
|
||||||
|
@ -116,6 +116,9 @@ class Binary{
|
|||||||
$m .= self::writeLInt($d[1][1]);
|
$m .= self::writeLInt($d[1][1]);
|
||||||
$m .= self::writeLInt($d[1][2]);
|
$m .= self::writeLInt($d[1][2]);
|
||||||
break;
|
break;
|
||||||
|
case Entity::DATA_TYPE_LONG:
|
||||||
|
$m .= self::writeLLong($d[1]);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$m .= "\x7f";
|
$m .= "\x7f";
|
||||||
@ -179,6 +182,10 @@ class Binary{
|
|||||||
$offset += 4;
|
$offset += 4;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case Entity::DATA_TYPE_LONG:
|
||||||
|
$r = self::readLLong(substr($value, $offset, 4));
|
||||||
|
$offset += 8;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return [];
|
return [];
|
||||||
|
|
||||||
@ -430,4 +437,4 @@ class Binary{
|
|||||||
return strrev(self::writeLong($value));
|
return strrev(self::writeLong($value));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user