Fix PlaceBlock Packet handle

This commit is contained in:
yefengeeeeeeeeeee 2025-04-27 17:21:27 +08:00
parent c8fc4139f8
commit aad00314d7

View file

@ -2264,7 +2264,7 @@ class Player{
$packet->eid = $this->eid; $packet->eid = $this->eid;
$data = []; $data = [];
if ($packet->face >= 0 and $packet->face <= 5) { //Use Block, place if ($packet->face >= 0 and $packet->face <= 5) {
if ($this->entity->inAction === true) { if ($this->entity->inAction === true) {
$this->entity->inAction = false; $this->entity->inAction = false;
$this->entity->inActionCounter = 0; $this->entity->inActionCounter = 0;
@ -2274,7 +2274,7 @@ class Player{
if ($this->blocked === true or ($this->entity->position instanceof Vector3 and $blockVector->distance($this->entity->position) > 10)) { if ($this->blocked === true or ($this->entity->position instanceof Vector3 and $blockVector->distance($this->entity->position) > 10)) {
} else { } else {
$this->server->api->block->playerBlockAction($this, $blockVector, $packet->face, $packet->fx, $packet->fy, $packet->fz); $this->server->api->block->playerBlockAction($this, $blockVector, $packet->face, $packet->x, $packet->y, $packet->z);
break; break;
} }
$target = $this->level->getBlock($blockVector); $target = $this->level->getBlock($blockVector);