-
Notifications
You must be signed in to change notification settings - Fork 18
Feature: Fast break #9
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
Closed
Closed
Changes from 2 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
636cac9
Feature: Fast break
emyfops 7b9c7d0
Feature: Fast place
emyfops 1c9ed2e
Refactor: Range math
emyfops 50fb02d
More range type
emyfops 7ef0637
Added pages, render settings and cooldown mine
emyfops 22913e9
Removed fast place, already implemented
emyfops 48f0e6e
Merge branch 'master' into feature/fastbreak
emyfops e8d2c07
Fast break is implemented in a separate module
emyfops 13d1665
Merge branch 'feature/renderer' into feature/fastbreak
emyfops 2a85049
Merge remote-tracking branch 'origin/master' into feature/fastbreak
Avanatiker File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
common/src/main/kotlin/com/lambda/module/modules/player/FastBreak.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| package com.lambda.module.modules.player | ||
|
|
||
| import com.lambda.event.events.PacketEvent | ||
| import com.lambda.event.events.TickEvent | ||
| import com.lambda.event.listener.SafeListener.Companion.listener | ||
| import com.lambda.module.Module | ||
| import com.lambda.module.tag.ModuleTag | ||
| import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket | ||
|
|
||
| object FastBreak : Module( | ||
| name = "FastBreak", | ||
| description = "Break blocks faster.", | ||
| defaultTags = setOf( | ||
| ModuleTag.PLAYER, ModuleTag.WORLD, ModuleTag.BYPASS | ||
| ) | ||
| ) { | ||
| private val breakThreshold by setting("Break Threshold", 0.8f, 0.5f..1.0f, 0.1f) | ||
|
|
||
| init { | ||
| listener<PacketEvent.Send.Pre> { | ||
| if (it.packet !is PlayerActionC2SPacket) return@listener | ||
| if (it.packet.action != PlayerActionC2SPacket.Action.STOP_DESTROY_BLOCK) return@listener | ||
|
|
||
| connection.sendPacket(PlayerActionC2SPacket( | ||
| PlayerActionC2SPacket.Action.ABORT_DESTROY_BLOCK, | ||
| it.packet.pos.up(2024-4-18), | ||
| it.packet.direction | ||
| )) | ||
| } | ||
|
|
||
| listener<TickEvent.Pre> { | ||
| if (!interaction.isBreakingBlock) | ||
| return@listener | ||
|
|
||
| if (interaction.currentBreakingProgress >= breakThreshold) | ||
| interaction.currentBreakingProgress = 1.0f | ||
| } | ||
| } | ||
| } |
20 changes: 20 additions & 0 deletions
20
common/src/main/kotlin/com/lambda/module/modules/player/FastPlace.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| package com.lambda.module.modules.player | ||
|
|
||
| import com.lambda.event.events.TickEvent | ||
| import com.lambda.event.listener.SafeListener.Companion.listener | ||
| import com.lambda.module.Module | ||
| import com.lambda.module.tag.ModuleTag | ||
|
|
||
| object FastPlace : Module( | ||
| name = "FastPlace", | ||
| description = "Place blocks faster.", | ||
| defaultTags = setOf( | ||
| ModuleTag.PLAYER, ModuleTag.WORLD | ||
| ) | ||
| ) { | ||
| init { | ||
| listener<TickEvent.Pre> { | ||
| mc.itemUseCooldown = 0 | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.