mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 03:59:43 +00:00
local entity ids
This commit is contained in:
parent
1ea54bc95b
commit
565a9420fd
13 changed files with 179 additions and 51 deletions
|
|
@ -60,6 +60,7 @@ abstract class Creature extends Living{
|
|||
if($player->eid === $this->eid or $this->closed !== false or ($player->level !== $this->level and $this->class !== ENTITY_PLAYER)){
|
||||
return false;
|
||||
}
|
||||
$player->addEntity($this);
|
||||
$pk = new AddMobPacket;
|
||||
$pk->eid = $this->eid;
|
||||
$pk->type = $this->type;
|
||||
|
|
|
|||
|
|
@ -1150,6 +1150,9 @@ class Entity extends Position
|
|||
if($this->player->gamemode === SPECTATOR){
|
||||
break;
|
||||
}
|
||||
|
||||
$player->addEntity($this);
|
||||
|
||||
$pk = new AddPlayerPacket();
|
||||
$pk->clientID = 0; // $this->player->clientID;
|
||||
$pk->username = $this->player->username;
|
||||
|
|
@ -1162,8 +1165,8 @@ class Entity extends Position
|
|||
$pk->itemID = 0;
|
||||
$pk->itemAuxValue = 0;
|
||||
$pk->metadata = $this->getMetadata();
|
||||
$player->entityQueueDataPacket($pk, 2, true);
|
||||
|
||||
$player->entityQueueDataPacket($pk);
|
||||
|
||||
$pk = new PlayerEquipmentPacket();
|
||||
$pk->eid = $this->eid;
|
||||
$pk->item = $this->player->getSlot($this->player->slot)->getID();
|
||||
|
|
@ -1517,7 +1520,7 @@ class Entity extends Position
|
|||
public function sendMoveUpdate()
|
||||
{
|
||||
if($this->class === ENTITY_PLAYER){
|
||||
$this->player->teleport(new Vector3($this->x, $this->y, $this->z), false, false, true, false);
|
||||
//$this->player->teleport(new Vector3($this->x, $this->y, $this->z), false, false, true, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -201,6 +201,8 @@ abstract class Projectile extends Entity{
|
|||
|
||||
public function spawn($player)
|
||||
{
|
||||
$player->addEntity($this);
|
||||
|
||||
$pk = new AddEntityPacket();
|
||||
$pk->eid = $this->eid;
|
||||
$pk->type = $this->type;
|
||||
|
|
|
|||
|
|
@ -262,6 +262,7 @@ class Arrow extends Entity{
|
|||
|
||||
public function spawn($player){
|
||||
if($this->type === OBJECT_ARROW){
|
||||
$player->addEntity($this);
|
||||
$pk = new AddEntityPacket;
|
||||
$pk->eid = $this->eid;
|
||||
$pk->type = $this->type;
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ class FallingSand extends Entity{
|
|||
}
|
||||
public function spawn($player)
|
||||
{
|
||||
$player->addEntity($this);
|
||||
$pk = new AddEntityPacket();
|
||||
$pk->eid = $this->eid;
|
||||
$pk->type = $this->type;
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ class ItemEntity extends Entity{
|
|||
|
||||
public function spawn($player)
|
||||
{
|
||||
$player->addEntity($this);
|
||||
$pk = new AddItemEntityPacket();
|
||||
$pk->eid = $this->eid;
|
||||
$pk->x = $this->x;
|
||||
|
|
|
|||
|
|
@ -427,6 +427,7 @@ class Minecart extends Vehicle{
|
|||
}
|
||||
|
||||
public function spawn($player){
|
||||
$player->addEntity($this);
|
||||
$pk = new AddEntityPacket;
|
||||
$pk->eid = $this->eid;
|
||||
$pk->type = $this->type;
|
||||
|
|
|
|||
|
|
@ -198,6 +198,7 @@ class Painting extends Entity{
|
|||
}
|
||||
|
||||
public function spawn($player){
|
||||
$player->addEntity($this);
|
||||
$pk = new AddPaintingPacket;
|
||||
$pk->eid = $this->eid;
|
||||
$pk->x = (int) $this->xPos;
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ class PrimedTNT extends Entity{
|
|||
}
|
||||
|
||||
public function spawn($player){
|
||||
$player->addEntity($this);
|
||||
$pk = new AddEntityPacket;
|
||||
$pk->eid = $this->eid;
|
||||
$pk->type = $this->type;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue