Skip to content
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

BarrierEsp #743

Merged
merged 9 commits into from
Nov 16, 2023
Merged

BarrierEsp #743

merged 9 commits into from
Nov 16, 2023

Conversation

jkacsa01
Copy link
Contributor

Description

#715

Warning: It's only works when the Particles is set to all

@Alexander01998 Alexander01998 linked an issue Sep 18, 2023 that may be closed by this pull request

This comment was marked as resolved.

Copy link

coderabbitai bot commented Nov 6, 2023

Walkthrough
## Walkthrough

The changes introduced a new hack called `BarrierEspHack` to the `WurstClient` application. This hack is added to the `HackList` and its functionality is implemented via a mixin class `ClientWorldMixin` that modifies the `getBlockParticle` method in `ClientWorld`. The hack's status is checked and the return value of the method is altered based on the hack's status and certain game conditions.

## Changes

| File Path | Change Summary |
| --- | --- |
| `.../hack/BarrierEspHack.java`<br>`.../hacks/BarrierEspHack.java` | Added a new Java class `BarrierEspHack` that extends the `Hack` class, sets the hack name to "BarrierESP", and includes search tags. |
| `.../hack/HackList.java` | Included the new `BarrierEspHack` class in the `HackList` with no changes to existing code. |
| `.../mixin/ClientWorldMixin.java` | Added a mixin class `ClientWorldMixin` that intercepts the `getBlockParticle` method in `ClientWorld`. It checks the status of `BarrierEspHack` and modifies the return value based on the hack's status and game conditions. |

Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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 a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Note: For conversation with the bot, please use the review comments on code diffs or files.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between cefa68a and 104b16b.
Files ignored due to filter (1)
  • src/main/resources/wurst.mixins.json
Files selected for processing (3)
  • src/main/java/net/wurstclient/hack/BarrierEspHack.java (1 hunks)
  • src/main/java/net/wurstclient/hack/HackList.java (1 hunks)
  • src/main/java/net/wurstclient/mixin/ClientWorldMixin.java (1 hunks)
Files skipped from review due to trivial changes (1)
  • src/main/java/net/wurstclient/hack/HackList.java
Additional comments: 2
src/main/java/net/wurstclient/hack/BarrierEspHack.java (1)
  • 1-9: The BarrierEspHack class is well-defined and extends the Hack class as expected. However, it's currently empty and doesn't override or implement any methods. If there are any methods in the Hack class that should be overridden or implemented in this class, they should be added. If not, this class is fine as it is.
src/main/java/net/wurstclient/mixin/ClientWorldMixin.java (1)
  • 1-23: The mixin class ClientWorldMixin is correctly implemented. It injects a method getBlockParticle into the ClientWorld class. The injected method checks if the barrierEspHack is enabled in the WurstClient instance and returns Blocks.BARRIER if it is. The original return value of the getBlockParticle method is overridden.

However, it's important to note that this change will affect all particles in the game when the hack is enabled, not just barrier blocks. If this is the intended behavior, then the implementation is correct. If not, you may need to refine the logic to only affect barrier blocks.

@jkacsa01
Copy link
Contributor Author

jkacsa01 commented Nov 6, 2023

Review Status

Yes, I forgot to add a check that is it a barrier or a light block. Sorry about that.
I going to fix it and make a description of this hack.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 104b16b and cff5067.
Files ignored due to filter (1)
  • src/main/resources/assets/wurst/lang/en_us.json
Files selected for processing (1)
  • src/main/java/net/wurstclient/hacks/BarrierEspHack.java (1 hunks)
Additional comments: 1
src/main/java/net/wurstclient/hacks/BarrierEspHack.java (1)
  • 1-11: The BarrierEspHack class is currently a stub with no functionality beyond setting the name of the hack. Ensure that the implementation of the hack's functionality is planned for a future commit.

@jkacsa01
Copy link
Contributor Author

jkacsa01 commented Nov 6, 2023

I realized that we don't need a check for light blocks because it indicates barrier blocks only.

@Alexander01998 Alexander01998 added type:enhancement New feature or request type:new feature A new hack/command/etc. category:render labels Nov 12, 2023
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between cff5067 and 81650c8.
Files ignored due to filter (1)
  • src/main/resources/assets/wurst/lang/en_us.json
Files selected for processing (2)
  • src/main/java/net/wurstclient/hacks/BarrierEspHack.java (1 hunks)
  • src/main/java/net/wurstclient/mixin/ClientWorldMixin.java (1 hunks)
Files skipped from review due to trivial changes (1)
  • src/main/java/net/wurstclient/hacks/BarrierEspHack.java
Additional comments: 3
src/main/java/net/wurstclient/mixin/ClientWorldMixin.java (3)
  • 1-7: Ensure that the copyright notice is up-to-date and correctly attributed.

  • 35-37: The method signature in the @Inject annotation seems incorrect. It should include the method parameters. Please verify this.

  • 47-47: This line changes the return value of the getBlockParticle method to Blocks.BARRIER when the conditions are met. Ensure that this does not cause any unintended side effects in the game.

src/main/java/net/wurstclient/mixin/ClientWorldMixin.java Outdated Show resolved Hide resolved
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 4

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 81650c8 and 959a2f4.
Files selected for processing (1)
  • src/main/java/net/wurstclient/mixin/ClientWorldMixin.java (1 hunks)
Additional comments: 1
src/main/java/net/wurstclient/mixin/ClientWorldMixin.java (1)
  • 1-7: Ensure that the copyright notice is up-to-date and correctly attributed.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 959a2f4 and 344b0db.
Files selected for processing (1)
  • src/main/java/net/wurstclient/mixin/ClientWorldMixin.java (1 hunks)
Additional comments: 4
src/main/java/net/wurstclient/mixin/ClientWorldMixin.java (4)
  • 35-37: The method signature in the @Inject annotation seems correct. The previous comment was incorrect.

  • 40-41: The barrierEspHack is a final field and cannot be null. The previous comment was incorrect.

  • 45-47: The interactionManager and player are accessed without null checks in the original ClientWorld.getBlockParticle() method, so it's safe to assume they won't be null here. The previous comment was incorrect.

  • 49-49: The setReturnValue method does not throw an exception if the CallbackInfoReturnable is already cancelled. The previous comment was incorrect.

@Alexander01998 Alexander01998 added this to the v7.39 milestone Nov 12, 2023
@Alexander01998 Alexander01998 added the status:merged This pull request has been merged, even if GitHub says otherwise. label Nov 12, 2023
@Alexander01998 Alexander01998 mentioned this pull request Nov 12, 2023
@Alexander01998 Alexander01998 merged commit 10172e4 into Wurst-Imperium:master Nov 16, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:render status:merged This pull request has been merged, even if GitHub says otherwise. type:enhancement New feature or request type:new feature A new hack/command/etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BarrierESP hack
2 participants