mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
better entity linking system
This commit is contained in:
parent
c95a8d5cff
commit
d7763f445a
13 changed files with 353 additions and 227 deletions
|
|
@ -3117,7 +3117,7 @@ class Player{
|
|||
}
|
||||
break;
|
||||
case ProtocolInfo::SET_ENTITY_LINK_PACKET:
|
||||
if($this->entity->linkedEntity != 0){
|
||||
if($this->entity->riding != 0){
|
||||
$this->entity->stopRiding();
|
||||
}
|
||||
break;
|
||||
|
|
@ -3127,10 +3127,10 @@ class Player{
|
|||
$this->entity->moveForward = $packet->moveForward;
|
||||
$this->entity->moveStrafing = $packet->moveStrafe;
|
||||
|
||||
if($this->entity->linkedEntity != 0){
|
||||
$e = $this->entity->level->entityList[$this->entity->linkedEntity] ?? false;
|
||||
if($this->entity->riding != 0){
|
||||
$e = $this->entity->level->entityList[$this->entity->riding] ?? false;
|
||||
if($e === false) {
|
||||
ConsoleAPI::warn("Player is riding on entity that doesnt exist in world! ({$this->iusername}, {$this->entity->linkedEntity})");
|
||||
ConsoleAPI::warn("Player is riding on entity that doesnt exist in world! ({$this->iusername}, {$this->entity->riding})");
|
||||
$this->entity->stopRiding();
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue