Skip to content

expose item data to client #1401

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

Merged
merged 2 commits into from
May 11, 2024
Merged

expose item data to client #1401

merged 2 commits into from
May 11, 2024

Conversation

chrisfarms
Copy link
Contributor

@chrisfarms chrisfarms commented May 11, 2024

what

ItemKind contracts can SET_DATA_ITEM just like BuildingKind contracts can SET_DATA_BUILDING to let them store data on-chain and read back in the client.... however we were not previously exposing the item data to the plugins so it was useless.

this exposes the item data so that plugins can do interesting stuff with it.

it updates the cocktail hut so that so "sips" are no longer just a client-local thing and are now a globally shared on-chain counter of all sips ever by everyone.

somewhat hilariously though, there's a bug in the implementation of ITEM_USE that means you can only "use" items that are in either bag-0-slot-0 or bag-1-slot-1 😂 ... so that's a bit annoying and I had to make the cocktail plugin ask you to move the cocktail before using it

Screenshot 2024-05-11 at 14 35 01

issue raised for that #1400 but it would be a contract change so not possible to fix quickly

ItemKind contracts can SET_DATA_ITEM just like BuildingKind contracts
can SET_DATA_BUILDING to let them store data on-chain and read back in
the client.... however we were not previously exposing the item data to
the plugins so it was useless.

this exposes the item data so that plugins can do interesting stuff with
it.

it updates the cocktail hut so that so "sips" are no longer just a
client-local thing and are now a globally shared on-chain counter of all
sips ever by everyone.

somewhat hilariously though, there's a bug in the implementation of
ITEM_USE that means you can only "use" items that are in either
bag-0-slot-0 or bag-1-slot-1 😂 ... so that's a bit annoying
Copy link
Contributor

@5p0rt5BEArD 5p0rt5BEArD left a comment

Choose a reason for hiding this comment

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

lgtm

@chrisfarms chrisfarms merged commit 2fde1d3 into main May 11, 2024
3 checks passed
@chrisfarms chrisfarms deleted the item-data branch May 11, 2024 17:19
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.

2 participants