mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-23 00:55:57 +00:00
Player: Extend acceptable block-break distance by 1
Survival reach distance is 6, but that's only a measure of how far the player must reach to hit any part of the target block. Measured from the centre, this again provides a possible corner reach which is too far away from the centre of the block by sqrt(3) / 2 blocks. Simple fix - allow an extra block's distance.
This commit is contained in:
parent
8fbd0e58f0
commit
55f405f5c2
@ -2324,7 +2324,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
||||
$item = $this->inventory->getItemInHand();
|
||||
$oldItem = clone $item;
|
||||
|
||||
if($this->canInteract($blockVector->add(0.5, 0.5, 0.5), $this->isCreative() ? 13 : 6) and $this->level->useBreakOn($blockVector, $item, $this, true)){
|
||||
if($this->canInteract($blockVector->add(0.5, 0.5, 0.5), $this->isCreative() ? 13 : 7) and $this->level->useBreakOn($blockVector, $item, $this, true)){
|
||||
if($this->isSurvival()){
|
||||
if(!$item->equalsExact($oldItem)){
|
||||
$this->inventory->setItemInHand($item);
|
||||
|
Loading…
x
Reference in New Issue
Block a user