mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
fixed division by zero when breaking tnt, (hopefully?) fixed empty chests
This commit is contained in:
parent
6c7bcf014b
commit
a62986a8d6
3 changed files with 7 additions and 5 deletions
|
|
@ -271,12 +271,13 @@ abstract class Block extends Position{
|
|||
|
||||
public function getDestroyProgress(Player $player){
|
||||
if($this->breakTime < 0) return 0;
|
||||
if($this->breakTime == 0) return INF; //instabreak
|
||||
$id = $this->getID();
|
||||
$meta = $this->getMetadata();
|
||||
if($player->canDestroy($id, $meta)){
|
||||
return $player->getDestroySpeed($id, $meta) / $this->breakTime / 30;
|
||||
}
|
||||
if($this->breakTime == 0) return INF; //instabreak
|
||||
|
||||
return (1 / $this->breakTime) / 100;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue