TejasLamba2006 / Raven-XD

raven b4, but free.
0 stars 0 forks source link

feat: Replace AutoClicker with LeftClicker and RighClicker #4

Closed TejasLamba2006 closed 1 month ago

TejasLamba2006 commented 1 month ago

This commit replaces the AutoClicker module with a new module called LeftClicker. The new LeftClicker provides similar functionality while also offering additional features like inventory fill and the ability to right-click.

Summary by CodeRabbit

coderabbitai[bot] commented 1 month ago
Walkthrough ## Walkthrough The recent update introduces two new modules, `LeftClicker` and `RightClicker`, which automate left and right mouse clicks in Minecraft. The `AutoClicker` module was commented out, and several adjustments were made to event priority and method logic to ensure compatibility with these new modules. Additionally, duplicated code and settings adjustments were addressed in the `ModuleManager` and `Utils` classes. ## Changes | File Path | Summary | |------------------------------------------------|----------------------------------------------------------------------------------------------| | `src/.../ModuleManager.java` | Commented out `AutoClicker`, added `LeftClicker` and `RightClicker`, removed duplicate code | | `src/.../combat/HitSelect.java` | Changed event priority from `LOWEST` to `HIGHEST` | | `src/.../combat/LeftClicker.java` | Added functionality for automated left clicks with various settings and triggers | | `src/.../player/RightClicker.java` | Added functionality for automated right clicks with various settings and triggers | | `src/.../utility/Utils.java` | Adjusted logic for `ilc()` and `holdingWeapon()` methods | ## Sequence Diagram(s) ```mermaid sequenceDiagram participant User participant Minecraft participant LeftClicker participant RightClicker User->>Minecraft: Initiate Click Minecraft->>LeftClicker: Check Left Click alt LeftClick Enabled and Conditions Met LeftClicker->>Minecraft: Execute Left Click Action end User->>Minecraft: Initiate Right Click Minecraft->>RightClicker: Check Right Click alt RightClick Enabled and Conditions Met RightClicker->>Minecraft: Execute Right Click Action end ``` ## Poem > In the world of clicks, a change anew, > Left and Right, they now pursue, > Automated taps both day and night, > To aid in battles, a seamless fight. > The AutoClicker now takes rest, > As new modules strive their best!

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?

Share - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)
Tips ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit .` - `Generate unit testing code for this file.` - `Open a follow-up GitHub issue for this discussion.` - Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples: - `@coderabbitai generate unit testing code for this file.` - `@coderabbitai modularize this function.` - PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples: - `@coderabbitai generate interesting stats about this repository and render them as a table.` - `@coderabbitai show all the console.log statements in this repository.` - `@coderabbitai read src/utils.ts and generate unit testing code.` - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.` - `@coderabbitai help me debug CodeRabbit configuration file.` 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 as PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai full review` to do a full review from scratch and review all the files again. - `@coderabbitai summary` to regenerate the summary of the PR. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository. - `@coderabbitai help` to get help. Additionally, you can add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. ### CodeRabbit Configration File (`.coderabbit.yaml`) - You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository. - Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information. - If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json` ### Documentation and Community - Visit our [Documentation](https://coderabbit.ai/docs) for detailed information on how to use CodeRabbit. - Join our [Discord Community](https://discord.com/invite/GsXnASn26c) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.
TejasLamba2006 commented 1 month ago

@coderabbitai full review

do keep in mind to check for bugs and things that can lead to crashes or get the player banned

coderabbitai[bot] commented 1 month ago

ModuleManager.java

Review:

Potential Issues:

  1. Ensure LeftClicker and RightClicker do not interfere with each other.
  2. Verify no duplicate module registrations (e.g., AutoRespawn).

HitSelect.java

Review:

Potential Issues:

  1. Changing event priority might cause unintended behavior with other event handlers.
  2. Ensure onAttack logic properly synchronizes with the new clicker modules.

LeftClicker.java

Review:

Potential Issues:

  1. Ensure jitter settings are not detected as suspicious by anti-cheat systems.
  2. Verify block-breaking logic to avoid potential exploits.
  3. Ensure inventory interactions do not cause crashes or unexpected behavior.

RightClicker.java

Review:

Potential Issues:

  1. Similar to LeftClicker, ensure jitter settings are safe.
  2. Verify right-click logic, especially with blocksOnly setting, to avoid exploits or crashes.

Utils.java

Review:

Potential Issues:

  1. Ensure the logic in ilc() correctly checks the state of LeftClicker.
  2. Verify holdingWeapon() properly handles the new conditions.

Detailed Analysis and Recommendations:

ModuleManager.java

//public static AutoClicker autoClicker;
public static LeftClicker leftClicker;
public static RightClicker rightClicker;

HitSelect.java

@SubscribeEvent(priority = EventPriority.HIGHEST)
public void onAttack(@NotNull AttackEntityEvent event) {
    ...
}

LeftClicker.java

public void onRenderTick(@NotNull RenderTickEvent ev) {
    ...
}

RightClicker.java

public void onRenderTick(@NotNull RenderTickEvent ev) {
    ...
}

Utils.java

public static boolean ilc() {
    if (ModuleManager.leftClicker.isEnabled()) {
        return Mouse.isButtonDown(0);
    } else return CPSCalculator.f() > 1 && System.currentTimeMillis() - CPSCalculator.LL < 300L;
}

Summary

The PR introduces significant changes to the clicker modules, which require careful review to ensure they do not introduce bugs, crashes, or actions that could get the player banned. The primary concerns are proper integration, avoiding potential anti-cheat detection, and ensuring robust and crash-free implementations.

@TejasLamba2006: I have conducted a full review of the PR. Here are the detailed findings and recommendations:

  1. Module Integration:

    • Ensure LeftClicker and RightClicker are properly initialized and registered.
    • Remove the duplicated addition of AutoRespawn.
  2. Event Priority:

    • Verify that changing the event priority in HitSelect does not conflict with other event handlers.
  3. Anti-Cheat Concerns:

    • Ensure jitter settings and automated clicks are subtle enough to avoid detection by anti-cheat systems.
  4. Robustness:

    • Verify the logic for block-breaking and inventory interactions in LeftClicker and RightClicker to avoid potential exploits or crashes.
  5. Utility Functions:

    • Ensure updates in Utils.java correctly handle the new clicker modules and edge cases.

Would you like to proceed with these recommendations or need further assistance?

Analysis chain ---
Scripts executed The following scripts were executed for the analysis: Script: ```shell #!/bin/bash # Gathering necessary information for a full review of the PR. # Fetching the content of ModuleManager.java to verify changes. cat ModuleManager.java # Fetching the content of HitSelect.java to verify changes. cat HitSelect.java # Fetching the content of LeftClicker.java to verify the new module. cat LeftClicker.java # Fetching the content of RightClicker.java to verify the new module. cat RightClicker.java # Fetching the content of Utils.java to verify updates. cat Utils.java ``` Length of output: 349 --- Script: ```shell #!/bin/bash # Gathering necessary information for a full review of the PR. # Finding and displaying the content of ModuleManager.java fd -e java -g 'ModuleManager.java' --exec cat {} # Finding and displaying the content of HitSelect.java fd -e java -g 'HitSelect.java' --exec cat {} # Finding and displaying the content of LeftClicker.java fd -e java -g 'LeftClicker.java' --exec cat {} # Finding and displaying the content of RightClicker.java fd -e java -g 'RightClicker.java' --exec cat {} # Finding and displaying the content of Utils.java fd -e java -g 'Utils.java' --exec cat {} ``` Length of output: 65466
Actions performed Full review triggered.