diff options
author | JP Guerrero <jeanpatrick.guerrero@gmail.com> | 2016-12-11 20:41:37 +0100 |
---|---|---|
committer | JP Guerrero <jeanpatrick.guerrero@gmail.com> | 2016-12-11 21:08:32 +0100 |
commit | f3ce043a5394a19f551a69cf7a0956cd8155407c (patch) | |
tree | 3b5ee3307b8efb2e68053f2e035730600967763b | |
parent | 3f832eac3df9302dee73cef39caed4c602a028a6 (diff) |
Fix enter/quit fields stuff (again)
-rw-r--r-- | init.lua | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -144,7 +144,7 @@ function craftguide:get_formspec(player_name) name..";"..name.."_inv;]" end - if data.item ~= "" and minetest.registered_items[data.item] then + if data.item and minetest.registered_items[data.item] then local is_fuel_only = minetest.get_craft_result({ method="fuel", width=1, items={data.item}}).time > 0 local tooltip = self:get_tooltip(data.item) @@ -253,9 +253,11 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) elseif data.pagenum == 0 then data.pagenum = data.pagemax end craftguide:get_formspec(player_name) else for item in pairs(fields) do - item = item:sub(1,-5) + if not item:find(":") then return end + item = item:sub(-4) == "_inv" and item:sub(1,-5) or item local is_fuel = minetest.get_craft_result({ method="fuel", width=1, items={item}}).time > 0 + if minetest.get_craft_recipe(item).items or is_fuel then if progressive_mode then local _, has_item = |