baby entities can spawn from eggs, minecarts

This commit is contained in:
GameHerobrine 2022-05-29 18:41:06 +03:00
parent f5160df26f
commit ea3ed14f8e
8 changed files with 146 additions and 6 deletions

View file

@ -78,7 +78,7 @@ abstract class ProtocolInfo{
const HURT_ARMOR_PACKET = 0xa6;
const SET_ENTITY_DATA_PACKET = 0xa7;
const SET_ENTITY_MOTION_PACKET = 0xa8;
//const SET_ENTITY_LINK_PACKET = 0xa9;
const SET_ENTITY_LINK_PACKET = 0xa9;
const SET_HEALTH_PACKET = 0xaa;
const SET_SPAWN_POSITION_PACKET = 0xab;
const ANIMATE_PACKET = 0xac;

View file

@ -22,7 +22,7 @@
class InteractPacket extends RakNetDataPacket{
const ACTION_HOLD = 1; //HOLD CLICK ON ENTITY
const ACTION_ATTACK = 2; //SIMPLE CLICK(ATTACK)
const ACTION_VEHICLE_EXIT = 3; //EXIT FROM ENTITY(MINECART)
public $action;
public $eid;
public $target;

View file

@ -0,0 +1,29 @@
<?php
/*
Lets hope it will work
*/
class SetEntityLinkPacket extends RakNetDataPacket{
const TYPE_REMOVE = 0;
const TYPE_RIDE = 1;
const TYPE_PASSENGER = 2;
public $rider;
public $riding;
public $type;
public function decode() {
}
public function encode() {
$this->reset();
$this->putLong($this->rider);
$this->putLong($this->riding);
$this->putByte($this->type);
}
public function pid(){
return ProtocolInfo::SET_ENTITY_LINK_PACKET;
}
}

View file

@ -346,6 +346,8 @@ class RakNetParser{
case ProtocolInfo::ENTITY_DATA_PACKET:
$data = new EntityDataPacket;
break;
case ProtocolInfo::SET_ENTITY_LINK_PACKET:
$data = new SetEntityLinkPacket;
default:
$data = new UnknownPacket();
$data->packetID = $pid;