-
-
Notifications
You must be signed in to change notification settings - Fork 418
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
base: master
Are you sure you want to change the base?
Add TeamEspHack #1049
Conversation
WalkthroughWalkthroughThe recent changes introduce the Changes
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 as PR comments)
Additionally, you can add 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: 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 patternssrc/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
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 aFilterNpcLikeSetting
with the intended description.
62-67
: Method implementation is correct.The
genericVision
method correctly creates aFilterNpcLikeSetting
with the intended description.src/main/java/net/wurstclient/settings/filterlists/EntityFilterList.java (1)
65-65
: Addition ofFilterNpcLikeSetting
is appropriate.The inclusion of
FilterNpcLikeSetting.genericCombat(false)
enhances the filtering capabilities ofgenericCombat
without disrupting existing functionality.src/main/java/net/wurstclient/hacks/PlayerEspHack.java (1)
80-80
: DisablingteamEspHack
is a sensible change.This change prevents potential conflicts between
PlayerEspHack
andteamEspHack
when both are enabled.src/main/java/net/wurstclient/hacks/TeamEspHack.java (5)
51-73
: Settings Initialization Looks Good.The settings for
EspStyle
andEspBoxSize
are initialized correctly. They are added to the hack settings.
75-90
: Event Handling is Correct.The
onEnable
andonDisable
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 ofTeamEspHack
is Seamless.The addition of
TeamEspHack
to theHackList
is straightforward and follows the existing pattern. Ensure that it integrates well with other hacks.
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(); | ||
} | ||
} |
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.
Efficient Box Rendering.
The renderBoxes
method efficiently calculates player positions and colors. Consider caching results if performance becomes an issue.
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: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
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, extendingEntityFilterCheckbox
, 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
andgenericVision
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)
andFilterNpcLikeSetting.genericCombat(false)
enhances theAimAssistHack
by allowing it to exclude teammates and NPC-like entities, improving targeting accuracy.
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:
|
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" |
Description
Added a simple but cool feature,
TeamEsp
. It's basically justPlayerEsp
but using the color of their name tags.Testing
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 usingTeamESP
.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