forked from mtcontrib/bitchange
Updatez
This commit is contained in:
parent
2d36903ffe
commit
fecfaaf975
@ -24,8 +24,10 @@ local function set_infotext(meta, mode)
|
|||||||
|
|
||||||
local formspec =
|
local formspec =
|
||||||
"size[8,9]"..
|
"size[8,9]"..
|
||||||
|
"label[1,1;Damaged tool:]]"..
|
||||||
"list[current_name;src;3.5,1;1,1;]"..
|
"list[current_name;src;3.5,1;1,1;]"..
|
||||||
"label[3.4,2;\\["..text2.."\\]]"..
|
"label[3.4,2;\\["..text2.."\\]]"..
|
||||||
|
"label[1.5,3;MineNinth:]]"..
|
||||||
"list[current_name;fuel;3.5,3;1,1;]"..
|
"list[current_name;fuel;3.5,3;1,1;]"..
|
||||||
"list[current_player;main;0,5;8,4;]"
|
"list[current_player;main;0,5;8,4;]"
|
||||||
meta:set_string("formspec", formspec)
|
meta:set_string("formspec", formspec)
|
||||||
@ -69,7 +71,7 @@ minetest.register_node("bitchange:toolrepair", {
|
|||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
elseif(listname == "fuel") then
|
elseif(listname == "fuel") then
|
||||||
if(stack:get_name() == "bitchange:minecoin") then
|
if(stack:get_name() == "bitchange:mineninth") then
|
||||||
return stack:get_count()
|
return stack:get_count()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -103,13 +105,14 @@ minetest.register_craft({
|
|||||||
|
|
||||||
minetest.register_abm({
|
minetest.register_abm({
|
||||||
nodenames = {"bitchange:toolrepair"},
|
nodenames = {"bitchange:toolrepair"},
|
||||||
interval = 8,
|
interval = 5,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
local src = inv:get_stack("src", 1)
|
local src = inv:get_stack("src", 1)
|
||||||
local wear = src:get_wear()
|
local wear = src:get_wear()
|
||||||
|
local repair = -1400
|
||||||
|
|
||||||
if(src:is_empty()
|
if(src:is_empty()
|
||||||
or wear == 0
|
or wear == 0
|
||||||
@ -120,18 +123,18 @@ minetest.register_abm({
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
local fuel = inv:get_stack("fuel", 1)
|
local fuel = inv:get_stack("fuel", 1)
|
||||||
if(fuel:is_empty() or fuel:get_name() ~= "bitchange:minecoin") then
|
if(fuel:is_empty() or fuel:get_name() ~= "bitchange:mineninth") then
|
||||||
set_infotext(meta, 1)
|
set_infotext(meta, 1)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if(wear - 4000 < 0) then
|
if(wear + repair < 0) then
|
||||||
src:add_wear(-4000 + wear)
|
src:add_wear(repair + wear)
|
||||||
else
|
else
|
||||||
src:add_wear(-4000)
|
src:add_wear(repair)
|
||||||
end
|
end
|
||||||
inv:set_stack("src", 1, src)
|
inv:set_stack("src", 1, src)
|
||||||
set_infotext(meta, 2)
|
set_infotext(meta, 2)
|
||||||
inv:remove_item("fuel", "bitchange:minecoin 1")
|
inv:remove_item("fuel", "bitchange:mineninth 1")
|
||||||
end
|
end
|
||||||
})
|
})
|
@ -111,6 +111,9 @@ minetest.register_node("bitchange:warehouse", {
|
|||||||
end,
|
end,
|
||||||
on_receive_fields = function(pos, formname, fields, sender)
|
on_receive_fields = function(pos, formname, fields, sender)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
|
if(not bitchange_has_access(meta:get_string("owner"), sender:get_player_name())) then
|
||||||
|
return
|
||||||
|
end
|
||||||
if(fields.inv_lv1) then
|
if(fields.inv_lv1) then
|
||||||
meta:set_string("formspec", "size[12,10;]"..
|
meta:set_string("formspec", "size[12,10;]"..
|
||||||
"label[0,0;Warehouse]"..
|
"label[0,0;Warehouse]"..
|
||||||
|
Loading…
Reference in New Issue
Block a user