Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

This commit fixed Client spoof to be injectable directly to the minecraft library, also adds new types of client spoofs #55

Merged
merged 1 commit into from
Jul 9, 2024

Conversation

TejasLamba2006
Copy link
Collaborator

@TejasLamba2006 TejasLamba2006 commented Jul 8, 2024

Summary by CodeRabbit

  • New Features

    • Introduced client spoofing functionality with new modes (GEYSER, LABYMOD) and customized player settings.
    • Added support for modifying game behavior on server join.
  • Enhancements

    • Updated spoof mode handling for improved flexibility and user experience.
  • Compatibility

    • Added support for Mixins version 0.7.11 to ensure compatibility with new features.

…raft library, also adds new types of client spoofs
Copy link

coderabbitai bot commented Jul 8, 2024

Walkthrough

The changes introduce the functionality to intercept the game's handling of joining a server to modify player settings and spoof client information. This involves adding a mixin to hook into the network handling, enhancing the ClientSpoofer module with new spoofing modes and logic, and updating the mixins configuration file to reflect these additions.

Changes

File(s) Change Summary
MixinClientSpoofer.java Added a mixin for NetHandlerPlayClient to intercept handleJoinGame method.
ClientSpoofer.java Introduced BrandInfo class, new spoof modes, updated onUpdate, onSendPacket methods, added Raven import.
mixins.raven.json Added minVersion field, and new entries for network.MixinClientSpoofer and injectors.

Sequence Diagram(s)

sequenceDiagram
    participant Player
    participant GameClient
    participant MixinClientSpoofer
    participant NetHandlerPlayClient
    participant Server

    Player->>GameClient: Join Server
    GameClient->>Server: Send Join Request
    Server->>GameClient: Response with S01PacketJoinGame
    GameClient->>MixinClientSpoofer: handleJoinGame(packetIn, callbackInfo)
    MixinClientSpoofer->>NetHandlerPlayClient: Modify join game behavior
    NetHandlerPlayClient->>GameClient: Complete Join Process
    GameClient->>Player: Player joined server with modified settings
Loading

Poem

In lines of code where changes bloom,
Our spoofing ways find new room.
With mixins bright and settings grand,
We tweak the game, a helping hand.
As rabbits code with gentle cheer,
New modes and tricks shall now appear! 🌟🐇


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 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 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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 30f93b0 and e51930a.

Files selected for processing (3)
  • src/main/java/keystrokesmod/mixins/impl/network/MixinClientSpoofer.java (1 hunks)
  • src/main/java/keystrokesmod/module/impl/other/ClientSpoofer.java (3 hunks)
  • src/main/resources/mixins.raven.json (2 hunks)
Additional comments not posted (8)
src/main/resources/mixins.raven.json (3)

3-3: LGTM!

The addition of the minVersion field is correct and syntactically valid.


38-38: LGTM!

The addition of network.MixinClientSpoofer to the client section is correct and ensures the mixin is recognized by the client.


41-43: LGTM!

The addition of the injectors section with defaultRequire set to 1 is correct and syntactically valid.

src/main/java/keystrokesmod/mixins/impl/network/MixinClientSpoofer.java (1)

1-56: LGTM!

The mixin class MixinClientSpoofer and the method handleJoinGame are correctly implemented. The method processes the join game packet and modifies player settings appropriately. The custom payload packet sent using the ClientSpoofer class is also correctly handled.

src/main/java/keystrokesmod/module/impl/other/ClientSpoofer.java (4)

4-4: LGTM!

The import statement for Raven is correct and syntactically valid.


23-23: LGTM!

The addition of the currentSpoof field and the updates to the onUpdate method are correct. The method correctly updates currentSpoof and handles different cases based on the mode. The logic for enabling and disabling modules is also correct.

Also applies to: 30-39


49-51: LGTM!

The getBrandName method correctly returns BrandInfo based on the current spoof mode. The BrandInfo class is correctly implemented with brand and channel fields.

Also applies to: 54-60


65-83: LGTM!

The changes to the SpoofMode enum correctly add new modes and update the constructor to include the channel parameter. The getNames method is correctly updated to return an array of mode names.

@xanning
Copy link

xanning commented Jul 8, 2024

very pro module only 4 hours was needed 👍

@TejasLamba2006
Copy link
Collaborator Author

TejasLamba2006 commented Jul 8, 2024

Fixes #31

@TejasLamba2006
Copy link
Collaborator Author

TejasLamba2006 commented Jul 8, 2024

very pro module only 4 hours was needed 👍

wdym? also if ur talking about me taking this much time, no I went out for dinner and I dont code in one sitting

@xanning
Copy link

xanning commented Jul 8, 2024

very pro module only 4 hours was needed 👍

wdym? also if ur talking about me taking this much time, no I went out for dinner and I dont code in one sitting

Clear sarcasm

@xia-mc
Copy link
Owner

xia-mc commented Jul 9, 2024

No Compat issue by overwrite?

@xia-mc xia-mc merged commit 55b5afd into xia-mc:master Jul 9, 2024
1 check passed
@TejasLamba2006
Copy link
Collaborator Author

Hey sorry for the late reply, no there won't be any combat issues.

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

Successfully merging this pull request may close these issues.

3 participants