mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 12:18:46 +00:00
Fixed player block breaking
This commit is contained in:
parent
370a1a0041
commit
e37b731e88
@ -1433,7 +1433,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
|||||||
$item = clone $this->inventory->getItemInHand();
|
$item = clone $this->inventory->getItemInHand();
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->getLevel()->useBreakOn($vector, $item) === true){
|
if($this->getLevel()->useBreakOn($vector, $item, $this) === true){
|
||||||
if(($this->gamemode & 0x01) === 0){
|
if(($this->gamemode & 0x01) === 0){
|
||||||
$this->inventory->setItemInHand($item);
|
$this->inventory->setItemInHand($item);
|
||||||
}
|
}
|
||||||
|
@ -726,7 +726,7 @@ class Level{
|
|||||||
$target = $this->getBlock($vector);
|
$target = $this->getBlock($vector);
|
||||||
|
|
||||||
if($player instanceof Player){
|
if($player instanceof Player){
|
||||||
$lastTime = $player->lastBreak - $player->getLag() / 1000;
|
$lastTime = $player->lastBreak - 0.2; //TODO: replace with true lag
|
||||||
if(($player->getGamemode() & 0x01) === 1 and ($lastTime + 0.15) >= microtime(true)){
|
if(($player->getGamemode() & 0x01) === 1 and ($lastTime + 0.15) >= microtime(true)){
|
||||||
return false;
|
return false;
|
||||||
}elseif(($lastTime + $target->getBreakTime($item)) >= microtime(true)){
|
}elseif(($lastTime + $target->getBreakTime($item)) >= microtime(true)){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user