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

1.4.4 CanOpen hook #3972

Open
wants to merge 11 commits into
base: 1.4.4
Choose a base branch
from
Open

Conversation

green-new
Copy link

What is the new feature?

Adds a CanOpen hook to the ModItem class for modded items to override to determine if this item is consumable. References this issue: #3802

Why should this be part of tModLoader?

Gives greater control over modded lootbags to creators.

Are there alternative designs?

You could check whether or not an item can be opened in the CanRightClick function within ItemLoader, but that design tends to mix functionality together and is not ideal.

Sample usage for the new feature

Added the ExampleKeyBag and ExampleGoldenKey to test the new feature. To add a bit to the conditions, the ExampleGoldenKey opens the ExampleKeyBag if and only the world is in Hardmode and there is a ExampleGoldenKey in the current player's inventory.

ExampleMod updates

See above.

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.

None yet

1 participant