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

villager inventory duplicates job items #48

Open
lmaddox opened this issue Dec 2, 2023 · 2 comments
Open

villager inventory duplicates job items #48

lmaddox opened this issue Dec 2, 2023 · 2 comments
Labels

Comments

@lmaddox
Copy link

lmaddox commented Dec 2, 2023

when the (job) item is removed from the global job_inv and added to the villager's job inv, the item is not removed from the global job_inv. This is probably correct behavior.

when the item is removed from the villager's job inv to the global job_inv, it is duplicated.

the duplicate items are cleared from the global job_inv when the server is restarted.

job_inv.on_put() contains a commented-out line that, when uncommented, fixes the behavior.

--inv:remove_item(listname, stack)
stack:clear()

Screenshot_2023-12-02_16_23_50

@theFox6
Copy link
Owner

theFox6 commented Dec 9, 2023

I believe I remember there being a way to lose jobs with that line in place, which is why I commented it out.
A better fix would probably be to check whether all jobs are within the inventory every now and then.
Maybe making them stackable and removing duplicates could be a good idea.

@theFox6 theFox6 added bug and removed enhancement labels Dec 9, 2023
@sfence
Copy link
Collaborator

sfence commented Dec 9, 2023

I believe I remember there being a way to lose jobs with that line in place, which is why I commented it out. A better fix would probably be to check whether all jobs are within the inventory every now and then. Maybe making them stackable and removing duplicates could be a good idea.

If you overwrite put and take function for the inventory or inventory list, items can be taken and returned without effect for items in the jobs inventory list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants