return non-zero when block breaks to air too fast

closes #3050
This commit is contained in:
payonel 2019-05-29 00:30:05 -07:00
parent a5bad54c23
commit c97a985fc1

View File

@ -423,8 +423,12 @@ class Player(val agent: internal.Agent) extends FakePlayer(agent.world.asInstanc
if (preEvent.isCanceled) return 0
val adjustedBreakTime = Math.max(0.05, preEvent.getBreakTime)
if (!PlayerInteractionManagerHelper.onBlockClicked(this, pos, side))
if (!PlayerInteractionManagerHelper.onBlockClicked(this, pos, side)) {
if (world.isAirBlock(pos)) {
return 1.0 / 20.0
}
return 0
}
EventHandler.scheduleServer(() => new DamageOverTime(this, pos, side, (adjustedBreakTime * 20).toInt).tick())