Comments (5)
Maybe also check on certain events, like actually crafting the item. ;-)
I think polling the inventory all the time is not a pretty solution, I suppose there are still ways for the mod to βmissβ items. But it might be OK for a workaround.
Will test later.
What we would actually need would be an engine call to detect when the contents of the player inventory changed. This would make things much simpler.
from craftguide.
Maybe also check on certain events, like actually crafting the item
from craftguide.
Progressive mode currently only updates the "discovered" recipes whenever the filter is applied (when the craftguide is opened). It does this by adding undiscovered items in the player's inventory to the discovered list. The planks are never discovered because you don't open the craftguide with them in your inventory.
It would be better to "discover" an item the moment it appears in a player's inventory, but there is no Minetest callback for this. The current system could be improved by discovering items on_dignode
, but this won't cover all cases so it would still be necessary to periodically check the player's inventory for undiscovered items. Doing this check when the guide is opened makes no sense because a player could find all the items in the game and put them in a chest, then open the guide with an empty inv, and they will have discovered nothing.
from craftguide.
We could check the current player inventory inside minetest.register_globalstep
, and if an item is not inside data.inv_items
: update the progressive items list according to that.
from craftguide.
96c3047
Can you test please?
from craftguide.
Related Issues (20)
- Craftguide inventory graphical issue HOT 8
- Searching the craftguide based on category HOT 2
- Runtime error on first run on new map HOT 4
- Server crashes on logout when mod is active. HOT 4
- Switch between Progressive and Complete mode within Game HOT 1
- Multiple crashes while trying to use craftguide for the first time HOT 1
- Invalid command: craft HOT 1
- Attempt to index local 'meta' (a nil value) HOT 4
- Mod crashes HOT 2
- Allegedly greatly increased load times HOT 2
- crash with latest version HOT 3
- Deal with items that have no recipe HOT 1
- Some recipes not being shown HOT 5
- mesecons_materials + basic_materials - Silicon lump recipe not shown HOT 10
- core.register_alias and core.register_alias_force should not be redefined HOT 9
- Misplaced 3x3 recipes HOT 1
- sfinv mode recipe out of border and other issues HOT 2
- sfinv_only mode does not work with progressive_mode HOT 1
- Craftguide data caching is not persistent HOT 26
- Inventory_plus support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from craftguide.