mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
Merge branch 'kotyaralih:master' into master
This commit is contained in:
commit
f2e82b77de
6 changed files with 90 additions and 60 deletions
|
|
@ -501,9 +501,16 @@ class BlockAPI{
|
|||
$hand->position($block);
|
||||
//$face = -1;
|
||||
}
|
||||
|
||||
if($hand->isSolid === true and $block->boundingBox->intersectsWith($player->entity->boundingBox) && ($hand->getID() != BED_BLOCK && $hand->getID() != CARPET)){
|
||||
return $this->cancelAction($block, $player, false); //Entity in block
|
||||
|
||||
if($hand->isSolid === true && ($hand->getID() != BED_BLOCK && $hand->getID() != CARPET)){
|
||||
$aabb = $hand->getAABB($block->level, $block->x, $block->y, $block->z);
|
||||
$playerbb = $player->entity->boundingBox;
|
||||
//$aabb->intersectsWith($playerbb) is not good enough for this case
|
||||
//minY+0.21 is used to stop sneaking from triggering action cancelling
|
||||
if(($aabb->maxX > $playerbb->minX && $aabb->minX < $playerbb->maxX) && ($aabb->maxY > ($playerbb->minY+0.21) && $aabb->minY < $playerbb->maxY) && ($aabb->maxZ > $playerbb->minZ && $aabb->minZ < $playerbb->maxZ)){
|
||||
return $this->cancelAction($block, $player, false); //Entity in block
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if($this->server->api->dhandle("player.block.place", ["player" => $player, "block" => $block, "target" => $target, "item" => $item]) === false){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue