cx384 / node_texture_modifier Goto Github PK
View Code? Open in Web Editor NEWminetest mod
minetest mod
Take a stack of items from the output, and right-click on a stack of a different item in the player inventory.
This causes the whole stack to be crafted, for only one of the input item.
This is caused by what is probably an engine bug, where this swap causes the on_take stack to have a get_no() == 1.
You need to check that the stack in the output slot has the same name as the moved stack, and if it doesn't, assume as many as possible have been crafted
When using the listring to move items from the output to the main inventory, items can be lost when you have a partial stack already in your inventory.
This is caused by how the engine handles the overflow of the stack in your inventory.
Quick example:
You are crafting 99 stone, and have a stack of 9 in your inventory already.
The engine will cause an on_take callback, and the moved stack will be reported as 99 stone - however, only 90 stone will be moved, and 9 will be left in the output slot.
Your mod then deducts 99 ingredients from the player to pay for the stack, and clears the output, losing 9 stone.
The engine then tries to cause another on_take callback, trying to move 9 of whatever item is still in the inventory slot the stone was in. Since this is empty the engine gives up.
You need to check that the sum of the moved stack and the items remaining in the output is < stack:get_max()
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.