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

Add TeamEspHack #1049

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

LilyKensa
Copy link

@LilyKensa LilyKensa commented Aug 9, 2024

Description

Added a simple but cool feature, TeamEsp. It's basically just PlayerEsp but using the color of their name tags.

Testing

image

Additional Stuff

NPC Filtering

I also added a feature called FilterNpcLikeSetting because the white boxes on NPCs were annoying, as it loses the meaning of using TeamESP.

But I can't think of a good way to detect NPCs, so now it will only check the name patterns that NPCs will appear in Hypixel.

Teammates Filtering

It's weird to constantly target and attack your teammates, so I added FilterTeamates to ignore hem

Copy link

coderabbitai bot commented Aug 9, 2024

Walkthrough

Walkthrough

The recent changes introduce the TeamEspHack feature to the Wurst client, enhancing team member visualization in Minecraft games. This addition includes logic to prevent conflicts with the PlayerEspHack. Additionally, new filtering options for NPC-like entities and teammates improve entity management versatility. These updates refine user experience and provide greater customization in gameplay.

Changes

Files Change Summary
src/.../hack/HackList.java, src/.../hacks/PlayerEspHack.java, src/.../hacks/TeamEspHack.java Added TeamEspHack for team visualization. Updated PlayerEspHack to disable TeamEspHack when enabled, preventing conflicts.
src/.../settings/filterlists/EntityFilterList.java Updated genericCombat method to include a new filter for NPC-like entities, enhancing entity management capabilities.
src/.../settings/filters/FilterNpcLikeSetting.java, src/.../settings/filters/FilterTeammatesSetting.java Introduced FilterNpcLikeSetting for NPC-like entity filtering and FilterTeammatesSetting for excluding teammates based on display name colors.
src/.../hacks/AimAssistHack.java Added new filters to AimAssistHack to exclude teammates and NPC-like entities from targeting logic, improving gameplay experience.

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
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • 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 Configuration 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 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 for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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.

Actionable comments posted: 1

Outside diff range, codebase verification and nitpick comments (2)
src/main/java/net/wurstclient/settings/filters/FilterNpcLikeSetting.java (1)

14-52: Consider adding comments for clarity.

The logic for filtering NPC-like names is complex and could benefit from comments explaining each step.

// Check if entity is a player
// Extract the entity's name and check length
// Initialize counters for letters and digits
// Iterate over characters in the name
// Update counters and check for invalid characters
// Determine if the name matches NPC-like patterns
src/main/java/net/wurstclient/hacks/TeamEspHack.java (1)

10-45: Optimize Imports.

Some imports might not be necessary. Consider reviewing and removing unused imports to improve maintainability.

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 8304275 and 21ce72b.

Files ignored due to path filters (2)
  • src/main/resources/assets/wurst/translations/en_us.json is excluded by !**/*.json
  • src/main/resources/assets/wurst/translations/zh_tw.json is excluded by !**/*.json
Files selected for processing (5)
  • src/main/java/net/wurstclient/hack/HackList.java (1 hunks)
  • src/main/java/net/wurstclient/hacks/PlayerEspHack.java (1 hunks)
  • src/main/java/net/wurstclient/hacks/TeamEspHack.java (1 hunks)
  • src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java (1 hunks)
  • src/main/java/net/wurstclient/settings/filters/FilterNpcLikeSetting.java (1 hunks)
Additional comments not posted (11)
src/main/java/net/wurstclient/settings/filters/FilterNpcLikeSetting.java (3)

8-11: Constructor looks good.

The constructor correctly initializes the filter with the given description and checked state.


55-60: Method implementation is correct.

The genericCombat method correctly creates a FilterNpcLikeSetting with the intended description.


62-67: Method implementation is correct.

The genericVision method correctly creates a FilterNpcLikeSetting with the intended description.

src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java (1)

65-65: Addition of FilterNpcLikeSetting is appropriate.

The inclusion of FilterNpcLikeSetting.genericCombat(false) enhances the filtering capabilities of genericCombat without disrupting existing functionality.

src/main/java/net/wurstclient/hacks/PlayerEspHack.java (1)

80-80: Disabling teamEspHack is a sensible change.

This change prevents potential conflicts between PlayerEspHack and teamEspHack when both are enabled.

src/main/java/net/wurstclient/hacks/TeamEspHack.java (5)

51-73: Settings Initialization Looks Good.

The settings for EspStyle and EspBoxSize are initialized correctly. They are added to the hack settings.


75-90: Event Handling is Correct.

The onEnable and onDisable methods correctly manage event listeners, ensuring that resources are allocated and released properly.


118-144: Rendering Logic is Well-Structured.

The rendering logic sets up OpenGL state correctly and cleans up afterward. Ensure that performance is acceptable in real-world scenarios.


188-239: Tracer Rendering Logic is Clear.

The renderTracers method is well-implemented, with clear separation of concerns. Ensure that the rendering does not introduce lag.


1-8: Ensure License Compliance.

The file includes a GPL license header. Ensure that all dependencies and code contributions comply with this license.

src/main/java/net/wurstclient/hack/HackList.java (1)

175-175: Integration of TeamEspHack is Seamless.

The addition of TeamEspHack to the HackList is straightforward and follows the existing pattern. Ensure that it integrates well with other hacks.

Comment on lines +146 to +186
private void renderBoxes(MatrixStack matrixStack, float partialTicks,
RegionPos region)
{
float extraSize = boxSize.getExtraSize();

for(PlayerEntity e : players)
{
matrixStack.push();

Vec3d lerpedPos = EntityUtils.getLerpedPos(e, partialTicks)
.subtract(region.toVec3d());
matrixStack.translate(lerpedPos.x, lerpedPos.y, lerpedPos.z);

matrixStack.scale(e.getWidth() + extraSize,
e.getHeight() + extraSize, e.getWidth() + extraSize);

TextColor colorComponent = e.getDisplayName().getStyle().getColor();

float r = 0.8f, g = 0.8f, b = 0.8f;

if(colorComponent != null)
{
int teamColor = colorComponent.getRgb();

b = (float)(teamColor % 256);
g = (float)(teamColor % 65536 / 256);
r = (float)(teamColor / 65536);

b /= 256;
g /= 256;
r /= 256;
}

RenderSystem.setShaderColor(r, g, b, 0.5F);

Box bb = new Box(-0.5, 0, -0.5, 0.5, 1, 0.5);
RenderUtils.drawOutlinedBox(bb, matrixStack);

matrixStack.pop();
}
}
Copy link

Choose a reason for hiding this comment

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

Efficient Box Rendering.

The renderBoxes method efficiently calculates player positions and colors. Consider caching results if performance becomes an issue.

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.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 21ce72b and e27ce53.

Files selected for processing (3)
  • src/main/java/net/wurstclient/hacks/AimAssistHack.java (1 hunks)
  • src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java (1 hunks)
  • src/main/java/net/wurstclient/settings/filters/FilterTeammatesSetting.java (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java
Additional comments not posted (5)
src/main/java/net/wurstclient/settings/filters/FilterTeammatesSetting.java (4)

1-1: Ensure package naming consistency.

The package declaration is correct, but ensure that the package naming follows the project's conventions.


8-13: Class and constructor design is appropriate.

The class FilterTeammatesSetting is well-designed, extending EntityFilterCheckbox, and the constructor correctly initializes the superclass with a description and initial state.


15-34: Efficient teammate filtering logic.

The test method efficiently filters entities based on name tag color, using null checks and assertions to ensure robustness. The logic is clear and concise.


36-46: Factory methods provide clear descriptions.

The factory methods genericCombat and genericVision provide clear descriptions of their intended use, enhancing readability and maintainability.

src/main/java/net/wurstclient/hacks/AimAssistHack.java (1)

63-64: New filters enhance functionality.

The addition of FilterTeammatesSetting.genericCombat(false) and FilterNpcLikeSetting.genericCombat(false) enhances the AimAssistHack by allowing it to exclude teammates and NPC-like entities, improving targeting accuracy.

Copy link

This pull request has been open for a while with no recent activity. If you're still working on this or waiting for a review, please add a comment or commit within the next 7 days to keep it open. Otherwise, the pull request will be automatically closed to free up time for other tasks.

Pull requests should be closed if:

  • They have been superseded by another pull request
  • They are out of scope or don't align with the project
  • They have become obsolete due to other changes
  • They have bugs or conflicts that won't be resolved

@LilyKensa
Copy link
Author

I just realized that I don't need to create a new hack, I can just add a setting to PlayerESP like "Use Team Colors"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant