-
-
Notifications
You must be signed in to change notification settings - Fork 420
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
ElytraLock, a useful module for tracking fleeing players through the air. #1107
Conversation
|
WalkthroughThis pull request introduces a new feature called The The changes are focused on extending the game client's capabilities with a specialized elytra-related targeting mechanism, introducing new classes and methods to support this functionality. Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 2
🧹 Nitpick comments (2)
src/main/java/net/wurstclient/hacks/ElytraLockHack.java (1)
58-58
: Typo in the setting description.There's a typo in the description for the "Angle" priority. The word "Aimes" should be "Aims".
Apply this diff to fix the typo:
- + "\u00a7lAngle\u00a7r - Aimes at the entity that requires the least head movement.\n" + + "\u00a7lAngle\u00a7r - Aims at the entity that requires the least head movement.\n"src/main/java/net/wurstclient/settings/filterlists/ElytraLockFilterList.java (1)
37-39
: Inconsistent description forFilterPassiveWaterSetting
.The description mentions "when auto-placing," which seems out of context for this hack. It should probably say "when locking in" to be consistent with other filter descriptions.
Apply this diff to correct the description:
- builder.add(new FilterPassiveWaterSetting("Won't target passive water" - + " mobs like fish, squid, dolphins and axolotls when auto-placing", true)); + builder.add(new FilterPassiveWaterSetting("Won't target passive water" + + " mobs like fish, squid, dolphins and axolotls when locking in.", true));
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
src/main/java/net/wurstclient/hack/HackList.java
(1 hunks)src/main/java/net/wurstclient/hacks/ElytraLockHack.java
(1 hunks)src/main/java/net/wurstclient/settings/filterlists/ElytraLockFilterList.java
(1 hunks)
🔇 Additional comments (2)
src/main/java/net/wurstclient/hacks/ElytraLockHack.java (1)
140-144
: Verify the calculation ofvelocity
usinggetItemUseTimeLeft()
.In the context of elytra flight, using
player.getItemUseTimeLeft()
may not provide the intended value for calculatingvelocity
. This method relates to the remaining use time of an item, like drawing a bow or eating food. Please verify that this is the correct method for obtainingvelocity
during elytra flight.src/main/java/net/wurstclient/hack/HackList.java (1)
92-92
: LGTM! The ElytraLockHack integration follows the established patterns.The new field is properly declared and positioned alphabetically in the HackList class. It will be automatically initialized and managed by the existing reflection-based system.
Let's verify the claimed compatibility with ExtraElytra module:
✅ Verification successful
Verified: ElytraLockHack is compatible with ExtraElytra
The implementation uses standard Minecraft APIs for elytra state detection and only handles player rotation, without modifying elytra mechanics. This ensures it works safely alongside other elytra-related modules.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for potential conflicts between ElytraLock and ExtraElytra # Search for any shared resource access or conflicting operations ast-grep --pattern 'class ElytraLockHack { $$$ onElytra$_() { $$$ } $$$ }' # Look for any direct interactions between the modules rg -l "ElytraLock.*ExtraElytra|ExtraElytra.*ElytraLock"Length of output: 146
Script:
#!/bin/bash # First, find the ElytraLockHack implementation fd -e java ElytraLock # Then look for any mentions of ExtraElytra in these files rg -A 5 -B 5 "ExtraElytra" $(fd -e java ElytraLock) # Also search for any elytra-related method calls that might show interaction ast-grep --pattern 'class ElytraLockHack { $$$ public void on$_() { $$$ } $$$ }'Length of output: 436
Script:
#!/bin/bash # Examine ElytraLockHack implementation cat src/main/java/net/wurstclient/hacks/ElytraLockHack.java # Look for any elytra-related event handlers or state checks rg -A 5 "isWearingElytra|elytra\.is|elytra\." src/main/java/net/wurstclient/hacks/ElytraLockHack.javaLength of output: 10052
double posX = target.getX() + (target.getX() - target.lastRenderX) * d | ||
- player.getX(); | ||
double posY = target.getY() + (target.getY() - target.lastRenderY) * d | ||
+ target.getHeight() * 0.5 - player.getY() | ||
- player.getEyeHeight(player.getPose()); | ||
double posZ = target.getZ() + (target.getZ() - target.lastRenderZ) * d | ||
- player.getZ(); |
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.
Reference to non-existent fields lastRenderX
, lastRenderY
, lastRenderZ
.
The fields lastRenderX
, lastRenderY
, and lastRenderZ
do not exist in the Entity
class. Accessing these fields will cause a compilation error. You may need to use prevX
, prevY
, and prevZ
, or appropriate methods to get the previous position of the entity.
Apply this diff to fix the issue:
- double posX = target.getX() + (target.getX() - target.lastRenderX) * d
+ double posX = target.getX() + (target.getX() - target.prevX) * d
- double posY = target.getY() + (target.getY() - target.lastRenderY) * d
+ double posY = target.getY() + (target.getY() - target.prevY) * d
- double posZ = target.getZ() + (target.getZ() - target.lastRenderZ) * d
+ double posZ = target.getZ() + (target.getZ() - target.prevZ) * d
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
double posX = target.getX() + (target.getX() - target.lastRenderX) * d | |
- player.getX(); | |
double posY = target.getY() + (target.getY() - target.lastRenderY) * d | |
+ target.getHeight() * 0.5 - player.getY() | |
- player.getEyeHeight(player.getPose()); | |
double posZ = target.getZ() + (target.getZ() - target.lastRenderZ) * d | |
- player.getZ(); | |
double posX = target.getX() + (target.getX() - target.prevX) * d | |
- player.getX(); | |
double posY = target.getY() + (target.getY() - target.prevY) * d | |
+ target.getHeight() * 0.5 - player.getY() | |
- player.getEyeHeight(player.getPose()); | |
double posZ = target.getZ() + (target.getZ() - target.prevZ) * d | |
- player.getZ(); |
float v = 1 / velocity; | ||
matrixStack.scale(v, v, v); | ||
|
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.
Potential division by zero in scaling operation.
In the calculation float v = 1 / velocity;
, if velocity
equals zero, this will result in a division by zero error. Ensure that velocity
is never zero before performing this operation.
Apply this diff to handle the potential division by zero:
+ if (velocity == 0)
+ velocity = 0.0001F; // Set to a small positive value to avoid division by zero
float v = 1 / velocity;
Committable suggestion skipped: line range outside the PR's diff.
This module will aim towards players while using an elytra, making for a very effective tracker. This module works similarly to BowAimbot, but differs in some notable ways. This module is also effective against phantoms, even without killaura.
Activation:
Cooldown:
Filters:
Testing: