mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-05 09:39:56 +00:00
Fixed EntityMoveEvent not being cancelled correctly on players
This commit is contained in:
parent
60011a5ecf
commit
fba12c6ddf
@ -1368,7 +1368,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
|||||||
|
|
||||||
$this->setRotation($packet->yaw, $packet->pitch);
|
$this->setRotation($packet->yaw, $packet->pitch);
|
||||||
//$this->inBlock = $this->checkObstruction($this->x, ($this->boundingBox->minY + $this->boundingBox->maxY) / 2, $this->z);
|
//$this->inBlock = $this->checkObstruction($this->x, ($this->boundingBox->minY + $this->boundingBox->maxY) / 2, $this->z);
|
||||||
$this->move($dx, $dy, $dz);
|
$revert = !$this->move($dx, $dy, $dz);
|
||||||
|
|
||||||
$diffX = $this->x - $newPos->x;
|
$diffX = $this->x - $newPos->x;
|
||||||
$diffZ = $this->z - $newPos->z;
|
$diffZ = $this->z - $newPos->z;
|
||||||
|
@ -715,7 +715,7 @@ abstract class Entity extends Position implements Metadatable{
|
|||||||
//$collision = [];
|
//$collision = [];
|
||||||
//$this->checkBlockCollision($collision);
|
//$this->checkBlockCollision($collision);
|
||||||
if($dx == 0 and $dz == 0 and $dy == 0){
|
if($dx == 0 and $dz == 0 and $dy == 0){
|
||||||
return;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//if($this->inBlock){ //TODO: noclip
|
//if($this->inBlock){ //TODO: noclip
|
||||||
@ -887,8 +887,11 @@ abstract class Entity extends Position implements Metadatable{
|
|||||||
($this->boundingBox->minZ + $this->boundingBox->maxZ) / 2
|
($this->boundingBox->minZ + $this->boundingBox->maxZ) / 2
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$result = true;
|
||||||
|
|
||||||
if(!$this->setPosition($pos)){
|
if(!$this->setPosition($pos)){
|
||||||
$this->boundingBox->setBB($axisalignedbb);
|
$this->boundingBox->setBB($axisalignedbb);
|
||||||
|
$result = false;
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
if($this instanceof Player){
|
if($this instanceof Player){
|
||||||
@ -922,6 +925,8 @@ abstract class Entity extends Position implements Metadatable{
|
|||||||
//TODO: vehicle collision events (first we need to spawn them!)
|
//TODO: vehicle collision events (first we need to spawn them!)
|
||||||
|
|
||||||
Timings::$entityMoveTimer->stopTiming();
|
Timings::$entityMoveTimer->stopTiming();
|
||||||
|
|
||||||
|
return $result;
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -913,6 +913,7 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
}
|
}
|
||||||
$this->changedBlocks[$index][$Y][] = clone $block;
|
$this->changedBlocks[$index][$Y][] = clone $block;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($update === true){
|
if($update === true){
|
||||||
$this->updateAround($pos, self::BLOCK_UPDATE_NORMAL);
|
$this->updateAround($pos, self::BLOCK_UPDATE_NORMAL);
|
||||||
$block->onUpdate(self::BLOCK_UPDATE_NORMAL);
|
$block->onUpdate(self::BLOCK_UPDATE_NORMAL);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user