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

[Chore] Prevent Specific Slimefun Items from being made Unbreakable #82

Merged

Conversation

JustAHuman-xD
Copy link
Collaborator

Testing Status

Currently this PR is not tested in any way, shouldn't need to do a crazy amount of testing

Description

This PR just prevents specific items from being made unbreakable, that way players aren't upset when it doesn't work. For now this only applies to infinity expansion strainers, idk if anything else should be prevented. This PR isn't really necessary so if you want feel free to just close it lol.

Proposed Changes

  • Added UnbreakableRune#isDisallowed which is called in the UnbreakableRune#findCompatibleItem method
    • Checks for a slimefun item, if there isnt one present it returns early. If there is, then get the id and the addon name. The format is checking the addon and then the id. In this case it just checks for infinty exp and containing _STRAINER, any other items that should be ignored can be added following that format

@Boomer-1
Copy link

as i mentioned in the discord, i would recommend that any blacklist be setup as a config option instead of hard coded.

@GallowsDove
Copy link
Owner

Code looks good, just make sure it works and it can be merged

@JustAHuman-xD
Copy link
Collaborator Author

Can confirm it works! I also added a message that way players are not confused

@GallowsDove GallowsDove merged commit 384b573 into GallowsDove:master Aug 6, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants