mirror of
https://github.com/minetest-mods/technic.git
synced 2024-12-26 19:00:29 +01:00
commit
a9a8f3be34
@ -4,6 +4,7 @@ time_pick = 3
|
|||||||
if technic.config:getBool("enable_item_pickup") then
|
if technic.config:getBool("enable_item_pickup") then
|
||||||
minetest.register_globalstep(function(dtime)
|
minetest.register_globalstep(function(dtime)
|
||||||
for _,player in ipairs(minetest.get_connected_players()) do
|
for _,player in ipairs(minetest.get_connected_players()) do
|
||||||
|
if player and player:get_hp() > 0 then
|
||||||
local pos = player:getpos()
|
local pos = player:getpos()
|
||||||
pos.y = pos.y+0.5
|
pos.y = pos.y+0.5
|
||||||
local inv = player:get_inventory()
|
local inv = player:get_inventory()
|
||||||
@ -27,6 +28,7 @@ if technic.config:getBool("enable_item_pickup") then
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -2,3 +2,4 @@ default
|
|||||||
moreores
|
moreores
|
||||||
pipeworks
|
pipeworks
|
||||||
mesecons
|
mesecons
|
||||||
|
moretrees
|
||||||
|
BIN
technic/textures/technic_hv_battery_box_bottom.png
Normal file
BIN
technic/textures/technic_hv_battery_box_bottom.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 653 B |
BIN
technic/textures/technic_hv_battery_box_side0.png
Normal file
BIN
technic/textures/technic_hv_battery_box_side0.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 777 B |
BIN
technic/textures/technic_hv_battery_box_top.png
Normal file
BIN
technic/textures/technic_hv_battery_box_top.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 792 B |
@ -7,7 +7,8 @@
|
|||||||
local pos=minetest.get_pointed_thing_position(pointed_thing,above)
|
local pos=minetest.get_pointed_thing_position(pointed_thing,above)
|
||||||
local node=minetest.env:get_node(pos)
|
local node=minetest.env:get_node(pos)
|
||||||
local node_name=node.name
|
local node_name=node.name
|
||||||
if node_name == "farming_plus:rubber_tree_full" or node_name == "farming:rubber_tree_full" or node_name == "technic:rubber_tree_full" then
|
if node_name == "moretrees:rubber_tree_trunk" then
|
||||||
|
node.name = "moretrees:rubber_tree_trunk_empty"
|
||||||
user:get_inventory():add_item("main",ItemStack("technic:raw_latex"))
|
user:get_inventory():add_item("main",ItemStack("technic:raw_latex"))
|
||||||
minetest.env:set_node(pos,node)
|
minetest.env:set_node(pos,node)
|
||||||
local item=itemstack:to_table()
|
local item=itemstack:to_table()
|
||||||
@ -47,3 +48,13 @@
|
|||||||
description = "Rubber Fiber",
|
description = "Rubber Fiber",
|
||||||
inventory_image = "technic_rubber.png",
|
inventory_image = "technic_rubber.png",
|
||||||
})
|
})
|
||||||
|
|
||||||
|
minetest.register_abm({
|
||||||
|
nodenames = {"moretrees:rubber_tree_trunk_empty"},
|
||||||
|
interval = 60,
|
||||||
|
chance = 15,
|
||||||
|
action = function(pos, node)
|
||||||
|
node.name = "moretrees:rubber_tree_trunk"
|
||||||
|
minetest.env:set_node(pos, node)
|
||||||
|
end
|
||||||
|
})
|
||||||
|
@ -75,8 +75,8 @@ local inv = minetest.create_detached_inventory(player:get_player_name().."craftr
|
|||||||
return 0
|
return 0
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
inv:set_size("output", 1)
|
inv:set_size("output", 1)
|
||||||
inv:set_size("build", 3*3)
|
inv:set_size("build", 3*3)
|
||||||
|
|
||||||
-- refill slot
|
-- refill slot
|
||||||
unified_inventory.refill = minetest.create_detached_inventory(player_name.."refill", {
|
unified_inventory.refill = minetest.create_detached_inventory(player_name.."refill", {
|
||||||
@ -93,7 +93,6 @@ unified_inventory.refill = minetest.create_detached_inventory(player_name.."refi
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
unified_inventory.refill:set_size("main", 1)
|
unified_inventory.refill:set_size("main", 1)
|
||||||
end)
|
|
||||||
|
|
||||||
-- trash slot
|
-- trash slot
|
||||||
unified_inventory.trash = minetest.create_detached_inventory("trash", {
|
unified_inventory.trash = minetest.create_detached_inventory("trash", {
|
||||||
@ -111,18 +110,12 @@ unified_inventory.trash = minetest.create_detached_inventory("trash", {
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
unified_inventory.trash:set_size("main", 1)
|
unified_inventory.trash:set_size("main", 1)
|
||||||
|
end)
|
||||||
|
|
||||||
-- set_inventory_formspec
|
-- set_inventory_formspec
|
||||||
unified_inventory.set_inventory_formspec = function(player,formspec)
|
unified_inventory.set_inventory_formspec = function(player,formspec)
|
||||||
if player then
|
if player then
|
||||||
if minetest.setting_getbool("creative_mode") then
|
|
||||||
-- if creative mode is on then wait a bit
|
|
||||||
minetest.after(0.01,function()
|
|
||||||
player:set_inventory_formspec(formspec)
|
player:set_inventory_formspec(formspec)
|
||||||
end)
|
|
||||||
else
|
|
||||||
player:set_inventory_formspec(formspec)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user