Fixed player block breaking

This commit is contained in:
Shoghi Cervantes 2014-06-05 18:27:50 +02:00
parent 370a1a0041
commit e37b731e88
2 changed files with 2 additions and 2 deletions

View File

@ -1433,7 +1433,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
$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){
$this->inventory->setItemInHand($item);
}

View File

@ -726,7 +726,7 @@ class Level{
$target = $this->getBlock($vector);
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)){
return false;
}elseif(($lastTime + $target->getBreakTime($item)) >= microtime(true)){