-
-
Notifications
You must be signed in to change notification settings - Fork 496
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
feat: Added velocity hit feature #4878
base: nextgen
Are you sure you want to change the base?
Conversation
get detekted!!! |
Actually no, load the default gomme config and enable this feature. Never got banned, just adjust the extended reach |
Did laugh |
Do what you want I don't care at all |
No what he means is the code quality tool "Detekt". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job. I had a similar idea but didn't get to do it so far, but this looks promising. The code needs clean up though, formatting is quite off and a lot of useless semicolons and empty spaces.
Thank you it's my first contribution in kotlin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks Good To Me ™️, just fix the (unfunny joke start) "detektions" (unfunny joke end)
...in/kotlin/net/ccbluex/liquidbounce/features/module/modules/combat/killaura/ModuleKillAura.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes should fix the detekt errors:
...ccbluex/liquidbounce/features/module/modules/combat/killaura/features/KillAuraVelocityHit.kt
Outdated
Show resolved
Hide resolved
...ccbluex/liquidbounce/features/module/modules/combat/killaura/features/KillAuraVelocityHit.kt
Outdated
Show resolved
Hide resolved
...ccbluex/liquidbounce/features/module/modules/combat/killaura/features/KillAuraVelocityHit.kt
Outdated
Show resolved
Hide resolved
...ccbluex/liquidbounce/features/module/modules/combat/killaura/features/KillAuraVelocityHit.kt
Outdated
Show resolved
Hide resolved
...ccbluex/liquidbounce/features/module/modules/combat/killaura/features/KillAuraVelocityHit.kt
Outdated
Show resolved
Hide resolved
...in/kotlin/net/ccbluex/liquidbounce/features/module/modules/combat/velocity/ModuleVelocity.kt
Outdated
Show resolved
Hide resolved
...in/kotlin/net/ccbluex/liquidbounce/features/module/modules/combat/velocity/ModuleVelocity.kt
Outdated
Show resolved
Hide resolved
...ccbluex/liquidbounce/features/module/modules/combat/killaura/features/KillAuraVelocityHit.kt
Outdated
Show resolved
Hide resolved
Co-authored-by: DataModel <183248792+DataM0del@users.noreply.github.com>
Can you show us a demo of how it works? |
...in/kotlin/net/ccbluex/liquidbounce/features/module/modules/combat/killaura/ModuleKillAura.kt
Fixed
Show resolved
Hide resolved
Co-authored-by: DataModel <183248792+DataM0del@users.noreply.github.com>
Yeah add me on discord: alexdoth |
Please send the video clip here, if you have one. Is it for 1.8 or 1.9 combat? Because I have tried it for 1.9 combat and it did not really do what I thought it does. |
It's for 1.8 combat. The feature only extends the reach if the player is lagging or fake lagging. You can also disable this behavior by unchecking the "OnlyWhileLagging" option. In the video, I just set the range extension to 1 and enabled "OnlyWhileLagging". It's more like a legit feature since it only does something in a specific edge case where you are getting combos. I just added the chat messages in the video to demonstrates at which specific time it worked and not. It will be removed in future PRs. |
I'd like to point out that this feature is already covered by Backtrack. If you want to nevertheless add this feature because the current Backtrack can't reliably trigger it, then I suggest adding it in Backtrack itself to prevent code pollution. If anyone is confused, don't be afraid to ask. |
I'm a bit confused, to be honest, because it modifies the behavior of the KillAura, not backtrack. The result would be the same (getting some extra hits on other players), but I think some users will be confused about why the KillAura is hitting further away than set, only to see that backtrack modifies the reach. This feature also works if there is no network "issue". |
Mb, I assumed most of the context from the description so I didn't look too much into the code. |
@1zun4 will it be merged? |
import net.ccbluex.liquidbounce.utils.client.PacketQueueManager | ||
import net.minecraft.network.packet.s2c.play.* | ||
|
||
object KillAuraVelocityHit : ToggleableConfigurable(ModuleKillAura, "VelocityHit", false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documentation! What does this feature do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting idea.
get() = super.running && isPossible | ||
|
||
@Suppress("unused") | ||
private val packetHandler = sequenceHandler<PacketEvent>(priority = 1) { event -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use one of the priority categories.
private var considerVelocityHit = false | ||
private var damageReceived = false | ||
private var onGroundTicks = 0 | ||
private var isPossible = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documentation!
isPossible
is not a very good name
private var isPossible = false | ||
|
||
private var timer = Chronometer() | ||
private var lastPacketTime = Lists.newLinkedList<Long>() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are only a handful use cases for linked lists.
The ArrayDeque
is the one that you are searching for. It is a ring buffer and has O(1) time complexity when inserting at/removing from the head and tail!
And documentation!
packet is EntityDamageS2CPacket && packet.entityId == player.id -> { | ||
damageReceived = true | ||
} | ||
packet is EntityVelocityUpdateS2CPacket && packet.entityId == player.id && damageReceived -> { | ||
considerVelocityHit = true | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you have implemented a state machine, but you use two separate flags to keep track of what state the state machine is currently in.
I'd recommend using an enum for the states, for example:
enum PacketListenerState {
IDLE,
/**
* The player received damage, but no velocity packet was received (yet)
*/
DAMAGE_RECEIVED,
/**
* A hit with velocity was received.
*/
VELOCITY_DAMAGE_RECEIVED
}
var lagging = isLagging() || PacketQueueManager.isLagging | ||
|
||
if (!whenLag) { | ||
lagging = true | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure that this code does what it should?
var lagging = isLagging() || PacketQueueManager.isLagging | |
if (!whenLag) { | |
lagging = true | |
} | |
var lagging = isLagging() || PacketQueueManager.isLagging || !whenLag |
object KillAuraVelocityHit : ToggleableConfigurable(ModuleKillAura, "VelocityHit", false) { | ||
|
||
val extendRange by float("ExtendRange", 1.0f, 0.1f..2.0f) | ||
private val whenLag by boolean("OnlyWhileLagging", false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bad name
if ((player.isOnGround && isPossible) || (player.fallDistance > 0.3 && isPossible)) { | ||
onGroundTicks++ | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if ((player.isOnGround && isPossible) || (player.fallDistance > 0.3 && isPossible)) { | |
onGroundTicks++ | |
} | |
if (isPossible && (player.isOnGround || player.fallDistance > 0.3)) { | |
onGroundTicks++ | |
} |
Velocity hit feature for KillAura.
The feature
This feature grants an extra hit if the player is lagging while receiving a combo from an opponent.