mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 03:59:43 +00:00
baby entities can spawn from eggs, minecarts
This commit is contained in:
parent
f5160df26f
commit
ea3ed14f8e
8 changed files with 146 additions and 6 deletions
|
|
@ -1833,6 +1833,29 @@ class Player{
|
|||
$data["entity"] = $this->entity;
|
||||
if($packet->action === InteractPacket::ACTION_HOLD){
|
||||
switch($target->class){
|
||||
case ENTITY_OBJECT:
|
||||
switch($target->type){
|
||||
case OBJECT_MINECART:
|
||||
if($target->linkedEntity != null){
|
||||
break;
|
||||
}
|
||||
$players = $this->server->api->player->getAll($this->level);
|
||||
$pk = new SetEntityLinkPacket;
|
||||
$pk->rider = $target->eid;
|
||||
$pk->riding = $this->entity->eid;
|
||||
$pk->type = 2;
|
||||
$this->server->api->player->broadcastPacket([$this], $pk);
|
||||
|
||||
$target->linkedEntity = $this->entity;
|
||||
$this->entity->isInMinecart = true;
|
||||
$pk = new SetEntityLinkPacket();
|
||||
$pk->rider = $target->eid;
|
||||
$pk->riding = 0;
|
||||
$pk->type = 2;
|
||||
$this->dataPacket($pk);
|
||||
$needsBreak = true;
|
||||
|
||||
}
|
||||
case ENTITY_MOB:
|
||||
$slot = $this->getSlot($this->slot);
|
||||
switch($target->type){
|
||||
|
|
@ -1856,6 +1879,27 @@ class Player{
|
|||
}
|
||||
}
|
||||
}
|
||||
if($packet->action === InteractPacket::ACTION_VEHICLE_EXIT){
|
||||
switch($target->class){
|
||||
case ENTITY_OBJECT:
|
||||
switch($target->type){
|
||||
case OBJECT_MINECART:
|
||||
$players = $this->server->api->player->getAll($this->level);
|
||||
$pk = new SetEntityLinkPacket();
|
||||
$pk->rider = targetEntity.getId();
|
||||
$pk->riding = this.id;
|
||||
$pk->type = 3;
|
||||
$this->server->api->player->broadcastPacket([$this], $pk);
|
||||
$this->entity->isInMinecart = false;
|
||||
$target->linkedEntity = null;
|
||||
$pk = new SetEntityLinkPacket();
|
||||
$pk->rider = $target->eid;
|
||||
$pk->riding = 0;
|
||||
$pk->type = 3;
|
||||
$this->dataPacket($pk);
|
||||
}
|
||||
}
|
||||
}
|
||||
if($needsBreak){
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue