1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-11 17:51:04 +00:00

Add a callback: minetest.register_on_craft(itemstack, player,

old_craft_grid, craft_inv) and
minetest.register_craft_predict(itemstack, player, old_craft_grid,
craft_inv)
This commit is contained in:
Novatux 2013-10-26 11:25:28 +02:00
parent 2f10cfb226
commit bd6d4666ab
6 changed files with 93 additions and 0 deletions

View file

@ -4775,7 +4775,10 @@ void Server::UpdateCrafting(u16 peer_id)
// Get a preview for crafting
ItemStack preview;
InventoryLocation loc;
loc.setPlayer(player->getName());
getCraftingResult(&player->inventory, preview, false, this);
m_env->getScriptIface()->item_CraftPredict(preview, player->getPlayerSAO(), (&player->inventory)->getList("craft"), loc);
// Put the new preview in
InventoryList *plist = player->inventory.getList("craftpreview");