Skip to content

Commit

Permalink
chores: better updateBreakingTime() method
Browse files Browse the repository at this point in the history
  • Loading branch information
smartcmd committed Jun 29, 2024
1 parent 89d05a8 commit ccbcfa4
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ protected void updateBreakingTime(EntityPlayer player) {
// Breaking time has changed, make adjustments
var currentTime = player.getWorld().getTick();
var timeLeft = stopBreakingTime - currentTime;
stopBreakingTime = currentTime + (timeLeft / needBreakingTime) * newBreakingTime;
stopBreakingTime = currentTime + timeLeft * (needBreakingTime / newBreakingTime);
needBreakingTime = newBreakingTime;
}

Expand Down

0 comments on commit ccbcfa4

Please sign in to comment.