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

Added AutoRespawn to DeathScreen #792

Merged

Conversation

TheWienerMaster
Copy link
Contributor

Description

Resolves #717

Demonstration

891ee94d910c8c692b3121189b464c04.mp4

@github-actions
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

@Alexander01998
Copy link
Member

Still relevant.

@TheWienerMaster
Copy link
Contributor Author

.

@Alexander01998 Alexander01998 added type:enhancement New feature or request area:gui Improves the graphical user interface. category:combat labels Nov 10, 2023
Copy link

coderabbitai bot commented Nov 10, 2023

Walkthrough

Walkthrough

The changes introduced in the Minecraft mod primarily focus on enhancing the user experience during the death screen phase. A new feature has been added to allow automatic respawning, which can be enabled via a button on the death screen. This feature is controlled by a new CheckboxSetting and its visibility is determined by the shouldShowButton() method. The changes are mainly implemented in the DeathScreenMixin and AutoRespawnHack classes.

Changes

File Path Change Summary
.../mixin/DeathScreenMixin.java Introduced new methods addAutoRespawnButton and pressAutoRespawn to handle the creation and event handling of the auto respawn button. Also added an onInit method to initialize the button when the screen is loaded. Imported ButtonWidget and AutoRespawnHack classes.
.../hacks/AutoRespawnHack.java Added a new CheckboxSetting for the auto respawn button on the death screen. Introduced a new method shouldShowButton() to determine the visibility of the button. Included a reference to WurstClient.INSTANCE to check if the client is enabled.

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 7540e15 and c7f8505.
Files selected for processing (1)
  • src/main/java/net/wurstclient/mixin/DeathScreenMixin.java (2 hunks)
Additional comments: 4
src/main/java/net/wurstclient/mixin/DeathScreenMixin.java (4)
  • 14-23: Imports look fine and are necessary for the new functionality.

  • 38-45: The addAutoRespawnButton method is correctly called during the initialization of the screen. Ensure that WurstClient.INSTANCE.isEnabled() is the correct condition to check before adding the button.

  • 46-54: The addAutoRespawnButton method correctly creates a new button and adds it to the screen. The button's action is set to call the pressAutoRespawn method.

  • 55-61: The pressAutoRespawn method toggles the AutoRespawnHack on and off. Ensure that this is the desired behavior when the button is pressed.

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

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between c7f8505 and 5e22f6b.
Files selected for processing (2)
  • src/main/java/net/wurstclient/hacks/AutoRespawnHack.java (2 hunks)
  • src/main/java/net/wurstclient/mixin/DeathScreenMixin.java (2 hunks)
Additional comments: 3
src/main/java/net/wurstclient/hacks/AutoRespawnHack.java (2)
  • 9-29: The new CheckboxSetting for the auto respawn button on the death screen is correctly initialized and added to the settings. The description is clear and the default value is set to true, which means the button will be displayed by default.

  • 50-54: The shouldShowButton() method correctly checks if the client is enabled, the AutoRespawn feature is not already enabled, and the checkbox setting for the button is checked. This ensures that the button is only displayed when it is needed.

src/main/java/net/wurstclient/mixin/DeathScreenMixin.java (1)
  • 24-25: Ensure that the DeathScreenMixin class is correctly extending the Screen class and that the @Mixin(DeathScreen.class) annotation is correctly applied. This is crucial for the Mixin to work properly.

@Alexander01998 Alexander01998 added this to the v7.39 milestone Nov 11, 2023
@Alexander01998 Alexander01998 added the status:merged This pull request has been merged, even if GitHub says otherwise. label Nov 11, 2023
@Alexander01998 Alexander01998 merged commit 132ab78 into Wurst-Imperium:master Nov 16, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:gui Improves the graphical user interface. category:combat status:merged This pull request has been merged, even if GitHub says otherwise. type:enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AutoRespawn toggle button on the death screen
2 participants