Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 42
add Pause When Eating to Breaking and Interact. Packet mine still progresses while your eatting but wont actually finish to your done eatting.This is because you cant eat when placing and and stuff.#309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base:1.21.11
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -87,6 +87,7 @@ import com.lambda.util.extension.tickDelta | ||
| import com.lambda.util.item.ItemUtils.block | ||
| import com.lambda.util.math.lerp | ||
| import com.lambda.util.player.PlayerUtils.gamemode | ||
| import com.lambda.util.player.PlayerUtils.isEating | ||
| import com.lambda.util.player.PlayerUtils.swingHand | ||
| import net.minecraft.block.BlockState | ||
| import net.minecraft.client.sound.PositionedSoundInstance | ||
| @@ -747,6 +748,7 @@ object BreakManager : Manager<BreakRequest>( | ||
| val swing = breakConfig.swing | ||
| if (progress >= info.getBreakThreshold()) { | ||
| if (breakConfig.pauseWhenEating && player.isEating) return | ||
| if (info.swapInfo.swap && !swapped) return | ||
| if (info.type == Primary && !PacketLimitHandler.canSendPackets(1, PacketType.PlayerAction)) return | ||
| @@ -815,7 +817,7 @@ object BreakManager : Manager<BreakRequest>( | ||
| val blockState = blockState(ctx.blockPos) | ||
| val progress = blockState.calcBreakDelta(ctx.blockPos) | ||
| val instantBreakable = progress >= info.getBreakThreshold() | ||
| val instantBreakable = progress >= info.getBreakThreshold() && !(breakConfig.pauseWhenEating && player.isEating) | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i'd probably move the check from here to just before startBreaking is actually called. This would also catch rebreaks too, and we dont need to start instant breakable blocks before they should be broken as they break in one tick anyway | ||
| var packetCount = 1 | ||
| if (breakConfig.breakMode == BreakMode.Packet) packetCount++ | ||
Uh oh!
There was an error while loading. Please reload this page.