my mod is making my inventory disappear when using the normal furnace?

User avatar
durtective6
Member
 
Posts: 167
Joined: Sun Aug 12, 2012 14:19
In-game: derplez

my mod is making my inventory disappear when using the normal furnace?

by durtective6 » Thu Dec 12, 2013 20:18

when i run my mod (depends on crafter) your inventory disappears when smelting something:
Image

is there anyway to fix this? thanks for any help.
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

by Krock » Thu Dec 12, 2013 20:25

you deleted this line in the formspec:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
"list[current_player;main;0,5;8,4;]"
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

User avatar
durtective6
Member
 
Posts: 167
Joined: Sun Aug 12, 2012 14:19
In-game: derplez

by durtective6 » Thu Dec 12, 2013 20:28

nope, its still there.
dunno why its affecting defaults furnace tho :/
Last edited by durtective6 on Thu Dec 12, 2013 20:28, edited 1 time in total.
 

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

by kaeza » Thu Dec 12, 2013 20:30

Could be useful to see some code.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

User avatar
durtective6
Member
 
Posts: 167
Joined: Sun Aug 12, 2012 14:19
In-game: derplez

by durtective6 » Thu Dec 12, 2013 20:31

here
[spoiler]
techno={}

techno.oven_formspec =
"size[8,7]"..
"image[4,1;1,1;default_furnace_fire_bg.png]"..
"list[current_name;fuel;3,1;1,1;]"..
"list[current_name;src;0,0;1,1;]"..
"list[current_name;dst;6,0;2,2;]"..
"list[current_player;main;0,3;8,4;]"


minetest.register_node("techno:alchemist_oven", {
description = "Alchemist Oven",
tiles = {"alchemy_oven_top.png", "alchemy_oven_side.png", "alchemy_oven_side.png",
"alchemy_oven_side.png", "alchemy_oven_side.png", "alchemy_oven_front.png"},
paramtype2 = "facedir",
groups = {cracky=2},
legacy_facedir_simple = true,
sounds = default.node_sound_stone_defaults(),
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
meta:set_string("formspec", techno.oven_formspec)
meta:set_string("infotext", "alchemist oven")
local inv = meta:get_inventory()
inv:set_size("fuel", 1)
inv:set_size("src", 4)
inv:set_size("dst", 4)
end,
can_dig = function(pos,player)
local meta = minetest.env:get_meta(pos);
local inv = meta:get_inventory()
if not inv:is_empty("fuel") then
return false
elseif not inv:is_empty("dst") then
return false
elseif not inv:is_empty("src") then
return false
end
return true
end,
})

minetest.register_node("techno:alchemist_oven_active", {
description = "Alchemist Oven",
tiles = {"alchemy_oven_top.png", "alchemy_oven_side.png", "alchemy_oven_side.png",
"alchemy_oven_side.png", "alchemy_oven_side.png", "alchemy_oven_front_active.png"},
paramtype2 = "facedir",
light_source = 8,
drop = "techno:alchemist_oven",
groups = {cracky=2, not_in_creative_inventory=1},
legacy_facedir_simple = true,
sounds = default.node_sound_stone_defaults(),
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
meta:set_string("formspec", techno.oven_formspec)
meta:set_string("infotext", "alchemist oven");
local inv = meta:get_inventory()
inv:set_size("fuel", 1)
inv:set_size("src", 4)
inv:set_size("dst", 4)
end,
can_dig = function(pos,player)
local meta = minetest.env:get_meta(pos);
local inv = meta:get_inventory()
if not inv:is_empty("fuel") then
return false
elseif not inv:is_empty("dst") then
return false
elseif not inv:is_empty("src") then
return false
end
return true
end,
})


minetest.register_abm({
nodenames = {"techno:alchemist_oven","techno:alchemist_oven_active"},
interval = 2.0,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
-- Init the values
local meta = minetest.env:get_meta(pos)
for i, name in ipairs({
"fuel_totaltime",
"fuel_time",
"src_totaltime",
"src_time"
}) do
if meta:get_string(name) == "" then
meta:set_float(name, 0.0)
end
end

-- Get the source materials
local inv = meta:get_inventory()
local srclist = inv:get_list("src")
local cooked = nil
if srclist then
cooked = crafter.get_craft_result({method = "alchemy", width = 2, items = srclist})
--cooked = default.get_craft_result({method = "cooking", width = 1, items = srclist})
end

local was_active = false
local consume = false

if meta:get_float("fuel_time") < meta:get_float("fuel_totaltime") then
was_active = true
meta:set_float("fuel_time", meta:get_float("fuel_time") + 1)
meta:set_float("src_time", meta:get_float("src_time") + 1)
if cooked and cooked.item and not cooked.item:is_empty() and meta:get_float("src_time") >= cooked.time then
-- check if there's room for output in "dst" list
if inv:room_for_item("dst",cooked.item) then
consume = true
-- Put result in "dst" list
inv:add_item("dst", cooked.item)
-- take stuff from "src" list
for i=1,4 do
srcstack = inv:get_stack("src", i)
if not srcstack:is_empty() then
srcstack:take_item(1)
inv:set_stack("src", i, srcstack)
end
end
else
print("Could not insert '"..cooked.item:to_string().."'")
end
meta:set_string("src_time", 0)
end
end

if meta:get_float("fuel_time") < meta:get_float("fuel_totaltime") then
local percent = math.floor(meta:get_float("fuel_time") /
meta:get_float("fuel_totaltime") * 100)
meta:set_string("infotext","Alchemist Oven active: "..percent.."%")
hacky_swap_node(pos,"techno:alchemist_oven_active")
meta:set_string("formspec",
"size[8,7]"..
"image[4,1;1,1;default_furnace_fire_bg.png^[lowpart:"..
(100-percent)..":default_furnace_fire_fg.png]"..
"list[current_name;fuel;3,1;1,1;]"..
"list[current_name;src;0,0;1,1;]"..
"list[current_name;dst;6,0;2,2;]"..
"list[current_player;main;0,3;8,4;]")
return
end

local fuel = nil
local cooked = nil
local fuellist = inv:get_list("fuel")
local srclist = inv:get_list("src")

if srclist then
cooked = crafter.get_craft_result({method = "alchemy", width = 2, items = srclist})
end
if fuellist then
fuel = minetest.get_craft_result({method = "fuel", width = 1, items = fuellist})
end

if fuel.time <= 0 then
meta:set_string("infotext","Alchemist Oven is out of fuel")
hacky_swap_node(pos,"techno:alchemist_oven")
meta:set_string("formspec", techno.oven_formspec)
return
end

if cooked.item:is_empty() then
if was_active then
meta:set_string("infotext","Alchemist Oven is empty")
hacky_swap_node(pos,"techno:alchemist_oven")
meta:set_string("formspec", techno.oven_formspec)
end
return
end

meta:set_string("fuel_totaltime", fuel.time)
meta:set_string("fuel_time", 0)
if consume then
local stack = inv:get_stack("fuel", 1)
stack:take_item()
inv:set_stack("fuel", 1, stack)
end
end,
})

minetest.register_craft({
output = 'techno:alchemist_oven',
recipe = {
{'default:clay', 'default:clay', 'default:clay'},
{'default:clay', '', 'default:clay'},
{'default:stone', 'default:stone', 'default:stone'},
}
})
[/spoiler]
Last edited by durtective6 on Thu Dec 12, 2013 21:04, edited 1 time in total.
 


Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 4 guests

cron