mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 00:25:19 +02: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:
@@ -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");
|
||||
|
Reference in New Issue
Block a user