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

Item cooldown display #332

Merged
merged 10 commits into from
Oct 9, 2023
Merged

Conversation

Grayray75
Copy link
Contributor

@Grayray75 Grayray75 commented Sep 29, 2023

Adds an cooldown display to certain items.

Currently supported Items are:

  • Jungle Axe
  • Treecapitator
  • Grappling Hook

There is a special case with the Treecapitator where its cooldown is reduced when a legendary monkey pet is equipped. I will add support for this case in a future PR, as it requires keeping track of which pet the player currently has equipped, which is beyond the scope of this PR.

The cooldown is displayed in two ways:

  • in the hotbar using the vanilla cooldown renderer and
  • the attack indicator

This PR remains a draft until #328 is merged.

Preview

2023-10-03.14-28-54.mp4

@Grayray75 Grayray75 marked this pull request as ready for review October 3, 2023 12:32
Copy link
Collaborator

@kevinthegreat1 kevinthegreat1 left a comment

Choose a reason for hiding this comment

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

Made some changes, and it should be good to go.

Copy link
Collaborator

@AzureAaron AzureAaron left a comment

Choose a reason for hiding this comment

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

This needs translation strings for the config.

Also is it intended that if u break a non wood block the treecap cooldown shows?

@Grayray75
Copy link
Contributor Author

This needs translation strings for the config.

I totally forgot about those.

Also is it intended that if u break a non wood block the treecap cooldown shows?

No, this isn't indented and I added a check for that.

@ghost
Copy link

ghost commented Oct 7, 2023

Why is this not just a mixin into net/minecraft/entity/player/ItemCooldownManager::getCooldownProgress directly?

@kevinthegreat1 kevinthegreat1 added reviews needed This PR needs reviews changes requested This PR need changes new feature new feature This issue or PR is a new feature and removed new feature1 labels Oct 7, 2023
@Grayray75
Copy link
Contributor Author

Grayray75 commented Oct 8, 2023

Why is this not just a mixin into net/minecraft/entity/player/ItemCooldownManager::getCooldownProgress directly?

Mixin directly into getCooldownProgress would prevent the player from using the item if it's on cooldown.

@ghost
Copy link

ghost commented Oct 8, 2023

Ah I see. It might not be desired since the player may still want to break logs without the treecap effect and could potentially unintentionally fall foul of Hypixel rules about blocking clicks.

@kevinthegreat1 kevinthegreat1 removed reviews needed This PR needs reviews changes requested This PR need changes labels Oct 8, 2023
@kevinthegreat1 kevinthegreat1 added the merge me please Pull requests that are ready to merge label Oct 8, 2023
@LifeIsAParadox LifeIsAParadox merged commit a07b748 into SkyblockerMod:master Oct 9, 2023
1 check passed
@LifeIsAParadox LifeIsAParadox removed the merge me please Pull requests that are ready to merge label Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature This issue or PR is a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants