mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
fixed server crash using invalid nbt, fixed playerinputpacket and setentitylinkpacket being handled if the player did not spawn
This commit is contained in:
parent
7166d58916
commit
55efde1f5c
3 changed files with 81 additions and 6 deletions
|
|
@ -3275,23 +3275,27 @@ class Player{
|
|||
$t->spawn($this);
|
||||
}else{
|
||||
$nbt = new NBT();
|
||||
$nbt->load($packet->namedtag);
|
||||
$d = array_shift($nbt->tree);
|
||||
if($d["id"] !== TILE_SIGN){
|
||||
$d = $nbt->loadSignNBT($packet->namedtag);
|
||||
if($d === false){
|
||||
$t->spawn($this);
|
||||
}else{
|
||||
|
||||
$t->setText($d["Text1"], $d["Text2"], $d["Text3"], $d["Text4"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ProtocolInfo::SET_ENTITY_LINK_PACKET:
|
||||
if($this->spawned === false){
|
||||
break;
|
||||
}
|
||||
if($this->entity->riding != 0){
|
||||
$this->entity->setRiding(null);
|
||||
}
|
||||
break;
|
||||
case ProtocolInfo::PLAYER_INPUT_PACKET:
|
||||
if($this->spawned === false){
|
||||
break;
|
||||
}
|
||||
$this->isJumping = $packet->isJumping;
|
||||
$this->isSneaking = $packet->isSneaking;
|
||||
$this->entity->moveForward = $packet->moveForward;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue