-
-
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
New hack: MurderMystery + .mm command #963
New hack: MurderMystery + .mm command #963
Conversation
WalkthroughWalkthroughThe recent update enhances the WurstClient with a focus on the Murder Mystery game mode. It introduces the Changes
Recent Review DetailsConfiguration used: CodeRabbit UI Files selected for processing (1)
Additional Context UsedLearnings (1)
Additional comments not posted (7)
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 Configration 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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files ignored due to path filters (2)
src/main/resources/assets/wurst/lang/en_us.json
is excluded by:!**/*.json
src/main/resources/assets/wurst/lang/ru_ru.json
is excluded by:!**/*.json
Files selected for processing (4)
- src/main/java/net/wurstclient/command/CmdList.java (1 hunks)
- src/main/java/net/wurstclient/commands/MurderMysteryCmd.java (1 hunks)
- src/main/java/net/wurstclient/hack/HackList.java (1 hunks)
- src/main/java/net/wurstclient/hacks/MurderMysteryHack.java (1 hunks)
Additional comments: 17
src/main/java/net/wurstclient/commands/MurderMysteryCmd.java (6)
- 11-16: The command description and usage instructions are clear and informative, providing users with a good understanding of the command's purpose and how to use it.
- 22-25: The default action when no arguments are provided is to display statistics. This is a user-friendly default behavior, ensuring that users can quickly access information without needing to remember specific argument keywords.
- 28-29: Correctly throws a
CmdSyntaxError
if more than the expected number of arguments are provided, ensuring that users are informed of incorrect usage.- 31-43: The switch statement handles different command arguments effectively, providing clear paths for "stat" and "clear" operations, and defaulting to a syntax error for unrecognized arguments. This structure is logical and maintainable.
- 47-51: The
stat
method retrieves and displays the comma-separated lists of murderers and detectives. This method is concise and leverages theMurderMysteryHack
class effectively to obtain the necessary information.- 54-86: The
clear
method provides functionality to clear the lists of murderers, detectives, or both, based on the provided argument. The method is well-structured and includes appropriate error handling for unexpected arguments.src/main/java/net/wurstclient/command/CmdList.java (1)
- 49-49: The
MurderMysteryCmd
has been correctly instantiated and added to theCmdList
class. This ensures that the new command will be available for use within the Wurst client.src/main/java/net/wurstclient/hacks/MurderMysteryHack.java (9)
- 42-44: The
scale
setting allows users to adjust the size of the indicators, providing flexibility in how the hack is visually represented. This is a thoughtful addition that enhances user experience.- 46-49: The
murdererItems
anddetectiveItems
settings (lines 46-54) allow users to customize the items that identify murderers and detectives. This flexibility is valuable for accommodating different game variations or server-specific rules.- 56-63: The checkbox settings for showing indicators and reporting in chat (lines 56-71) provide users with control over the hack's behavior, allowing for a customizable experience based on personal preference or gameplay strategy.
- 73-81: The auto-clear settings for murderers and detectives lists (lines 73-81) are a practical feature that helps manage the lists efficiently, especially in scenarios where players frequently join or leave games.
- 122-137: The constructor initializes the hack with its name, category, settings, and event listeners for clearing lists on disconnect or join events. This setup is comprehensive and ensures that the hack is fully functional upon activation.
- 140-153: The methods for enabling and disabling the hack add and remove the necessary event listeners, ensuring that the hack's functionality is properly managed based on its active state.
- 156-169: The
onUpdate
method updates the list of players in the game, filtering out ineligible entities. This is crucial for maintaining an accurate list of potential murderers and detectives.- 203-270: The
onRender
method, responsible for rendering the indicators above players' heads, is well-implemented. It includes logic for scaling the indicators based on distance and player roles, enhancing the visual clarity and usefulness of the indicators.- 273-319: The
onReceivedPacket
method handlesEntityEquipmentUpdateS2CPacket
packets to identify murderers and detectives based on their held items. This method is central to the hack's functionality, effectively updating the player lists based on in-game actions.src/main/java/net/wurstclient/hack/HackList.java (1)
- 129-129: The
MurderMysteryHack
has been correctly instantiated and added to theHackList
class. This ensures that the new hack will be available for use within the Wurst client.
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- src/main/java/net/wurstclient/commands/MurderMysteryCmd.java (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- src/main/java/net/wurstclient/commands/MurderMysteryCmd.java
@coderabbitai review |
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (2)
- src/main/java/net/wurstclient/commands/MurderMysteryCmd.java (1 hunks)
- src/main/java/net/wurstclient/hacks/MurderMysteryHack.java (1 hunks)
Files skipped from review as they are similar to previous changes (2)
- src/main/java/net/wurstclient/commands/MurderMysteryCmd.java
- src/main/java/net/wurstclient/hacks/MurderMysteryHack.java
…ctive items describing (didn't know about that setting existence)
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- src/main/java/net/wurstclient/hacks/MurderMysteryHack.java (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- src/main/java/net/wurstclient/hacks/MurderMysteryHack.java
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- src/main/java/net/wurstclient/hacks/MurderMysteryHack.java (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- src/main/java/net/wurstclient/hacks/MurderMysteryHack.java
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- src/main/java/net/wurstclient/commands/MurderMysteryCmd.java (1 hunks)
Additional comments: 4
src/main/java/net/wurstclient/commands/MurderMysteryCmd.java (4)
- 18-23: The constructor is well-defined, providing clear information about the command's usage, including managing MurderMystery session statistics and clearing lists. This makes the command intuitive for users.
- 26-52: The
call
method is well-structured, handling different command arguments effectively. It's important to ensure thatWURST.getHax().murderMysteryHack
is always non-null to avoid potential NullPointerExceptions.- 54-59: The
stat
method effectively displays the lists of murderers and detectives. Consider ensuring that the messages are user-friendly and provide clear information to the player.- 61-94: The
clear
method is well-implemented, offering functionality to clear lists of murderers, detectives, or both. Ensure that the feedback messages to the user are clear and informative.
From now on, this PR branch will not be merged with master until further notice about including these changes. |
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:
|
Porting my PR to 1.21 update, idk why but texture indicators don't render. Trying to fix it |
Do you have discord? |
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:
|
Description
This is a hack for mini-game called Murder Mystery. Its goal is to listen for entity equipment update packages and, if in player's main hand item is one of defined in hack settings (separately for murderers and detectives), then add that player to corresponding list and start displaing a texture (i call it "indicator") of sword, bow or both (if murderer got the bow by collecting gold ingots) above player's head. Notifications about found murderers or detectives in chat can be enabled or disabled separatly, just as indicators for both sword and bow.
The only one reason i also implemented
.mm
command is because i found a server which uses a proxy for players transfering between servers (like bungeecord), and it was used for transfering them between waiting lobby and game arena. On mini-game end, when all players were teleported back to lobby, server didn't sentPlayerRespawnS2CPacket
to client. It was my only idea to somehow detect player transfering. So, manually clearing the murderers and detectives lists will be required in such rare case using.mm clear
. If you have any ideas, open an issue and mention me, thanks.Testing
Real game experience is the most suitable way to test this hack's functions. I was playing with it several hours, and there was one bug i catched some sort of randomly (
ConcurrentModificationException
, fixed by using fail-safeCopyOnWriteArrayList
forplayers
).I know, ruining game for players is vile, and don't really recommend doing it on purpose. Just for fun. I remember Impact client had similar feature, and i wanted to implement it in Wurst. It was interesting.
References
None.
Summary by CodeRabbit
MurderMysteryCmd
for managing Murder Mystery game statistics, including commands to display and clear lists of murderers and detectives.MurderMysteryHack
which enhances gameplay by displaying role indicators above players, listing game-specific items, and auto-clearing lists based on game events.