Added encode and decode methods for more packets

This commit is contained in:
Dylan K. Taylor
2017-05-15 15:56:59 +01:00
parent 162a08b8cb
commit 0a4d62b405
57 changed files with 244 additions and 78 deletions

View File

@ -86,7 +86,7 @@ class Arrow extends Projectile{
public function spawnTo(Player $player){
$pk = new AddEntityPacket();
$pk->type = Arrow::NETWORK_ID;
$pk->eid = $this->getId();
$pk->entityRuntimeId = $this->getId();
$pk->x = $this->x;
$pk->y = $this->y;
$pk->z = $this->z;

View File

@ -145,7 +145,7 @@ class FallingSand extends Entity{
public function spawnTo(Player $player){
$pk = new AddEntityPacket();
$pk->type = FallingSand::NETWORK_ID;
$pk->eid = $this->getId();
$pk->entityRuntimeId = $this->getId();
$pk->x = $this->x;
$pk->y = $this->y;
$pk->z = $this->z;

View File

@ -511,7 +511,7 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
$pk = new AddPlayerPacket();
$pk->uuid = $this->getUniqueId();
$pk->username = $this->getName();
$pk->eid = $this->getId();
$pk->entityRuntimeId = $this->getId();
$pk->x = $this->x;
$pk->y = $this->y;
$pk->z = $this->z;

View File

@ -228,7 +228,7 @@ class Item extends Entity{
public function spawnTo(Player $player){
$pk = new AddItemEntityPacket();
$pk->eid = $this->getId();
$pk->entityRuntimeId = $this->getId();
$pk->x = $this->x;
$pk->y = $this->y;
$pk->z = $this->z;

View File

@ -146,7 +146,7 @@ class PrimedTNT extends Entity implements Explosive{
public function spawnTo(Player $player){
$pk = new AddEntityPacket();
$pk->type = PrimedTNT::NETWORK_ID;
$pk->eid = $this->getId();
$pk->entityRuntimeId = $this->getId();
$pk->x = $this->x;
$pk->y = $this->y;
$pk->z = $this->z;

View File

@ -62,7 +62,7 @@ class Snowball extends Projectile{
public function spawnTo(Player $player){
$pk = new AddEntityPacket();
$pk->type = Snowball::NETWORK_ID;
$pk->eid = $this->getId();
$pk->entityRuntimeId = $this->getId();
$pk->x = $this->x;
$pk->y = $this->y;
$pk->z = $this->z;

View File

@ -148,7 +148,7 @@ class Squid extends WaterAnimal implements Ageable{
public function spawnTo(Player $player){
$pk = new AddEntityPacket();
$pk->eid = $this->getId();
$pk->entityRuntimeId = $this->getId();
$pk->type = Squid::NETWORK_ID;
$pk->x = $this->x;
$pk->y = $this->y;

View File

@ -52,7 +52,7 @@ class Villager extends Creature implements NPC, Ageable{
public function spawnTo(Player $player){
$pk = new AddEntityPacket();
$pk->eid = $this->getId();
$pk->entityRuntimeId = $this->getId();
$pk->type = Villager::NETWORK_ID;
$pk->x = $this->x;
$pk->y = $this->y;

View File

@ -39,7 +39,7 @@ class Zombie extends Monster{
public function spawnTo(Player $player){
$pk = new AddEntityPacket();
$pk->eid = $this->getId();
$pk->entityRuntimeId = $this->getId();
$pk->type = Zombie::NETWORK_ID;
$pk->x = $this->x;
$pk->y = $this->y;