D00Med's commit 6.5.17
>added melons and pumpkins >torches don't glow at certain times >improved pipe and cable code. >added piston (no texture yet)
@ -51,10 +51,12 @@ dofile(farming.path.."/hoes.lua")
|
||||
dofile(farming.path.."/grass.lua")
|
||||
dofile(farming.path.."/wheat.lua")
|
||||
dofile(farming.path.."/cotton.lua")
|
||||
dofile(farming.path.."/melon.lua")
|
||||
dofile(farming.path.."/carrot.lua")
|
||||
dofile(farming.path.."/potato.lua")
|
||||
dofile(farming.path.."/corn.lua")
|
||||
dofile(farming.path.."/raddish.lua")
|
||||
dofile(farming.path.."/pumpkin.lua")
|
||||
dofile(farming.path.."/sugar.lua")
|
||||
dofile(farming.path.."/mapgen.lua")
|
||||
dofile(farming.path.."/compatibility.lua") -- Farming Plus compatibility
|
||||
|
350
mods/farming/melon.lua
Normal file
@ -0,0 +1,350 @@
|
||||
|
||||
--melon crop, textures by D00Med
|
||||
|
||||
minetest.register_craftitem("farming:melon", {
|
||||
description = "Melon Slice",
|
||||
inventory_image = "farming_melon.png",
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
return farming.place_seed(itemstack, placer, pointed_thing, "farming:melon_1")
|
||||
end,
|
||||
on_use = minetest.item_eat(2),
|
||||
})
|
||||
|
||||
minetest.register_node("farming:melon_1", {
|
||||
drawtype = "plantlike",
|
||||
tiles = {"farming_melon_1.png"},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
waving = 1,
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
drop = "",
|
||||
selection_box = farming.select,
|
||||
groups = {
|
||||
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
|
||||
not_in_creative_inventory = 1, growing = 1
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("farming:melon_2", {
|
||||
drawtype = "plantlike",
|
||||
tiles = {"farming_melon_2.png"},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
waving = 1,
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
drop = "",
|
||||
selection_box = farming.select,
|
||||
groups = {
|
||||
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
|
||||
not_in_creative_inventory = 1, growing = 1
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("farming:melon_3", {
|
||||
tiles = {
|
||||
"farming_melon_3_top.png",
|
||||
"farming_melon_3_top.png",
|
||||
"farming_melon_3.png",
|
||||
},
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.1875, -0.5, -0.1875, 0.1875, -0.125, 0.1875}, -- NodeBox1
|
||||
{-0.5, -0.5, 0.03, 0.5, 0.5, 0.03}, -- NodeBox2
|
||||
{0.03, -0.5, -0.5, 0.03, 0.5, 0.5}, -- NodeBox4
|
||||
}
|
||||
},
|
||||
waving = 1,
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
drop = "",
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.1875, -0.5, -0.1875, 0.1875, -0.125, 0.1875}, -- NodeBox1
|
||||
}
|
||||
},
|
||||
groups = {
|
||||
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
|
||||
not_in_creative_inventory = 1, growing = 1
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("farming:melon_4", {
|
||||
tiles = {
|
||||
"farming_melon_4_top.png",
|
||||
"farming_melon_4_top.png",
|
||||
"farming_melon_4.png",
|
||||
},
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.3125, -0.5, -0.3125, 0.3125, 0.125, 0.3125}, -- NodeBox1
|
||||
{-0.5, -0.5, 0.03, 0.5, 0.5, 0.03}, -- NodeBox2
|
||||
{0.03, -0.5, -0.5, 0.03, 0.5, 0.5}, -- NodeBox4
|
||||
}
|
||||
},
|
||||
waving = 1,
|
||||
sunlight_propagates = true,
|
||||
walkable = true,
|
||||
buildable_to = true,
|
||||
drop = {
|
||||
items = {
|
||||
{items = {'farming:melon'}, rarity = 1},
|
||||
}
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.3125, -0.5, -0.3125, 0.3125, 0.125, 0.3125}, -- NodeBox1
|
||||
}
|
||||
},
|
||||
groups = {
|
||||
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
|
||||
not_in_creative_inventory = 1, growing = 1
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("farming:melon_5", {
|
||||
tiles = {
|
||||
"farming_melon_5_top.png",
|
||||
"farming_melon_5_top.png",
|
||||
"farming_melon_5.png",
|
||||
},
|
||||
waving = 1,
|
||||
drop = {
|
||||
items = {
|
||||
{items = {'farming:melon'}, rarity = 1},
|
||||
{items = {'farming:melon'}, rarity = 1},
|
||||
{items = {'farming:melon'}, rarity = 1},
|
||||
{items = {'farming:melon'}, rarity = 1},
|
||||
{items = {'farming:melon'}, rarity = 1},
|
||||
{items = {'farming:melon'}, rarity = 1},
|
||||
{items = {'farming:melon'}, rarity = 1},
|
||||
{items = {'farming:melon'}, rarity = 1},
|
||||
{items = {'farming:melon'}, rarity = 1},
|
||||
}
|
||||
},
|
||||
groups = {
|
||||
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
|
||||
not_in_creative_inventory = 1, growing = 1
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
minetest.set_node(pos, {name="farming:cut_melon_1", param2=node.param2})
|
||||
clicker:set_hp(clicker:get_hp()+1)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("farming:melon_block", {
|
||||
description = "Melon",
|
||||
tiles = {
|
||||
"farming_melon_5_top.png",
|
||||
"farming_melon_5_top.png",
|
||||
"farming_melon_5.png",
|
||||
},
|
||||
groups = {
|
||||
snappy = 3, flammable = 2, plant = 1, attached_node = 1, growing = 1
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
minetest.set_node(pos, {name="farming:cut_melon_1", param2=node.param2})
|
||||
clicker:set_hp(clicker:get_hp()+1)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "default:melon_5 1",
|
||||
recipe = {
|
||||
{"farming:melon", "farming:melon", "farming:melon"},
|
||||
{"farming:melon", "farming:melon", "farming:melon"},
|
||||
{"farming:melon", "farming:melon", "farming:melon"}
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_node("farming:melon_6", {
|
||||
tiles = {
|
||||
"farming_melon_6_top.png",
|
||||
"farming_melon_6_top.png",
|
||||
"farming_melon_6.png",
|
||||
},
|
||||
waving = 1,
|
||||
drop = "",
|
||||
groups = {
|
||||
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
|
||||
not_in_creative_inventory = 1, growing = 1
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("farming:cut_melon_1", {
|
||||
tiles = {
|
||||
"farming_melon_5_top.png",
|
||||
"farming_melon_5_top.png",
|
||||
"farming_melon_5.png",
|
||||
"farming_melon_cut_4.png^[transformFX",
|
||||
"farming_melon_5.png",
|
||||
"farming_melon_cut_1.png"
|
||||
},
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.1875, -0.5, -0.5, 0.5, 0.5, 0}, -- NodeBox1
|
||||
{-0.5, -0.5, 0, 0.5, 0.5, 0.5}, -- NodeBox2
|
||||
}
|
||||
},
|
||||
drop = {
|
||||
items = {
|
||||
{items = {'farming:melon'}, rarity = 1},
|
||||
{items = {'farming:melon'}, rarity = 1},
|
||||
{items = {'farming:melon'}, rarity = 1},
|
||||
{items = {'farming:melon'}, rarity = 1},
|
||||
{items = {'farming:melon'}, rarity = 1},
|
||||
{items = {'farming:melon'}, rarity = 1},
|
||||
{items = {'farming:melon'}, rarity = 1},
|
||||
}
|
||||
},
|
||||
groups = {snappy=3, flammable=2, plant=1, attached_node=1, not_in_creative_inventory=1},
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
minetest.set_node(pos, {name="farming:cut_melon_2", param2=node.param2})
|
||||
clicker:set_hp(clicker:get_hp()+1)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("farming:cut_melon_2", {
|
||||
tiles = {
|
||||
"farming_melon_5_top.png",
|
||||
"farming_melon_5_top.png",
|
||||
"farming_melon_5.png",
|
||||
"farming_melon_cut_4.png^[transformFX",
|
||||
"farming_melon_5.png",
|
||||
"farming_melon_cut_2.png"
|
||||
},
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{0.125, -0.5, -0.5, 0.5, 0.5, 0}, -- NodeBox1
|
||||
{-0.5, -0.5, 0, 0.5, 0.5, 0.5}, -- NodeBox2
|
||||
}
|
||||
},
|
||||
drop = {
|
||||
items = {
|
||||
{items = {'farming:melon'}, rarity = 1},
|
||||
{items = {'farming:melon'}, rarity = 1},
|
||||
{items = {'farming:melon'}, rarity = 1},
|
||||
{items = {'farming:melon'}, rarity = 1},
|
||||
{items = {'farming:melon'}, rarity = 1},
|
||||
}
|
||||
},
|
||||
groups = {snappy=3, flammable=2, plant=1, attached_node=1, not_in_creative_inventory=1},
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
minetest.set_node(pos, {name="farming:cut_melon_3", param2=node.param2})
|
||||
clicker:set_hp(clicker:get_hp()+1)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("farming:cut_melon_3", {
|
||||
tiles = {
|
||||
"farming_melon_5_top.png",
|
||||
"farming_melon_5_top.png",
|
||||
"farming_melon_5.png",
|
||||
"farming_melon_cut_4.png^[transformFX",
|
||||
"farming_melon_5.png",
|
||||
"farming_melon_cut_3.png"
|
||||
},
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, 0, 0.5, 0.5, 0.5}, -- NodeBox2
|
||||
}
|
||||
},
|
||||
drop = {
|
||||
items = {
|
||||
{items = {'farming:melon'}, rarity = 1},
|
||||
{items = {'farming:melon'}, rarity = 1},
|
||||
{items = {'farming:melon'}, rarity = 1},
|
||||
{items = {'farming:melon'}, rarity = 1},
|
||||
}
|
||||
},
|
||||
groups = {snappy=3, flammable=2, plant=1, attached_node=1, not_in_creative_inventory=1},
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
minetest.set_node(pos, {name="farming:cut_melon_4", param2=node.param2})
|
||||
clicker:set_hp(clicker:get_hp()+1)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("farming:cut_melon_4", {
|
||||
tiles = {
|
||||
"farming_melon_5_top.png",
|
||||
"farming_melon_5_top.png",
|
||||
"farming_melon_5.png",
|
||||
"farming_melon_cut_3.png",
|
||||
"farming_melon_5.png",
|
||||
"farming_melon_cut_3.png"
|
||||
},
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.1875, -0.5, 0, 0.5, 0.5, 0.5}, -- NodeBox2
|
||||
}
|
||||
},
|
||||
drop = {
|
||||
items = {
|
||||
{items = {'farming:melon'}, rarity = 1},
|
||||
{items = {'farming:melon'}, rarity = 1},
|
||||
}
|
||||
},
|
||||
groups = {snappy=3, flammable=2, plant=1, attached_node=1, not_in_creative_inventory=1},
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
minetest.set_node(pos, {name="farming:cut_melon_5", param2=node.param2})
|
||||
clicker:set_hp(clicker:get_hp()+1)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("farming:cut_melon_5", {
|
||||
tiles = {
|
||||
"farming_melon_5_top.png",
|
||||
"farming_melon_5_top.png",
|
||||
"farming_melon_5.png",
|
||||
"farming_melon_cut_3.png",
|
||||
"farming_melon_5.png",
|
||||
"farming_melon_cut_3.png"
|
||||
},
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{0.125, -0.5, 0, 0.5, 0.5, 0.5}, -- NodeBox2
|
||||
}
|
||||
},
|
||||
drop = {
|
||||
items = {
|
||||
{items = {'farming:melon'}, rarity = 1},
|
||||
}
|
||||
},
|
||||
groups = {snappy=3, flammable=2, plant=1, attached_node=1, not_in_creative_inventory=1},
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
minetest.remove_node(pos)
|
||||
clicker:set_hp(clicker:get_hp()+1)
|
||||
end,
|
||||
})
|
350
mods/farming/pumpkin.lua
Normal file
@ -0,0 +1,350 @@
|
||||
|
||||
--pumpkin crop, textures by D00Med
|
||||
|
||||
minetest.register_craftitem("farming:pumpkin", {
|
||||
description = "Pumpkin Slice",
|
||||
inventory_image = "farming_pumpkin.png",
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
return farming.place_seed(itemstack, placer, pointed_thing, "farming:pumpkin_1")
|
||||
end,
|
||||
on_use = minetest.item_eat(2),
|
||||
})
|
||||
|
||||
minetest.register_node("farming:pumpkin_1", {
|
||||
drawtype = "plantlike",
|
||||
tiles = {"farming_melon_1.png"},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
waving = 1,
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
drop = "",
|
||||
selection_box = farming.select,
|
||||
groups = {
|
||||
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
|
||||
not_in_creative_inventory = 1, growing = 1
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("farming:pumpkin_2", {
|
||||
drawtype = "plantlike",
|
||||
tiles = {"farming_melon_2.png"},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
waving = 1,
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
drop = "",
|
||||
selection_box = farming.select,
|
||||
groups = {
|
||||
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
|
||||
not_in_creative_inventory = 1, growing = 1
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("farming:pumpkin_3", {
|
||||
tiles = {
|
||||
"farming_pumpkin_3_top.png",
|
||||
"farming_pumpkin_3_top.png",
|
||||
"farming_pumpkin_3.png",
|
||||
},
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.1875, -0.5, -0.1875, 0.1875, -0.125, 0.1875}, -- NodeBox1
|
||||
{-0.5, -0.5, 0.03, 0.5, 0.5, 0.03}, -- NodeBox2
|
||||
{0.03, -0.5, -0.5, 0.03, 0.5, 0.5}, -- NodeBox4
|
||||
}
|
||||
},
|
||||
waving = 1,
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
drop = "",
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.1875, -0.5, -0.1875, 0.1875, -0.125, 0.1875}, -- NodeBox1
|
||||
}
|
||||
},
|
||||
groups = {
|
||||
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
|
||||
not_in_creative_inventory = 1, growing = 1
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("farming:pumpkin_4", {
|
||||
tiles = {
|
||||
"farming_pumpkin_4_top.png",
|
||||
"farming_pumpkin_4_top.png",
|
||||
"farming_pumpkin_4.png",
|
||||
},
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.3125, -0.5, -0.3125, 0.3125, 0.125, 0.3125}, -- NodeBox1
|
||||
{-0.5, -0.5, 0.03, 0.5, 0.5, 0.03}, -- NodeBox2
|
||||
{0.03, -0.5, -0.5, 0.03, 0.5, 0.5}, -- NodeBox4
|
||||
}
|
||||
},
|
||||
waving = 1,
|
||||
sunlight_propagates = true,
|
||||
walkable = true,
|
||||
buildable_to = true,
|
||||
drop = {
|
||||
items = {
|
||||
{items = {'farming:pumpkin'}, rarity = 1},
|
||||
}
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.3125, -0.5, -0.3125, 0.3125, 0.125, 0.3125}, -- NodeBox1
|
||||
}
|
||||
},
|
||||
groups = {
|
||||
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
|
||||
not_in_creative_inventory = 1, growing = 1
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("farming:pumpkin_5", {
|
||||
tiles = {
|
||||
"farming_pumpkin_5_top.png",
|
||||
"farming_pumpkin_5_top.png",
|
||||
"farming_pumpkin_5.png",
|
||||
},
|
||||
waving = 1,
|
||||
drop = {
|
||||
items = {
|
||||
{items = {'farming:pumpkin'}, rarity = 1},
|
||||
{items = {'farming:pumpkin'}, rarity = 1},
|
||||
{items = {'farming:pumpkin'}, rarity = 1},
|
||||
{items = {'farming:pumpkin'}, rarity = 1},
|
||||
{items = {'farming:pumpkin'}, rarity = 1},
|
||||
{items = {'farming:pumpkin'}, rarity = 1},
|
||||
{items = {'farming:pumpkin'}, rarity = 1},
|
||||
{items = {'farming:pumpkin'}, rarity = 1},
|
||||
{items = {'farming:pumpkin'}, rarity = 1},
|
||||
}
|
||||
},
|
||||
groups = {
|
||||
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
|
||||
not_in_creative_inventory = 1, growing = 1
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
minetest.set_node(pos, {name="farming:cut_pumpkin_1", param2=node.param2})
|
||||
clicker:set_hp(clicker:get_hp()+1)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("farming:pumpkin_block", {
|
||||
description = "Pumpkin",
|
||||
tiles = {
|
||||
"farming_pumpkin_5_top.png",
|
||||
"farming_pumpkin_5_top.png",
|
||||
"farming_pumpkin_5.png",
|
||||
},
|
||||
groups = {
|
||||
snappy = 3, flammable = 2, plant = 1, attached_node = 1, growing = 1
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
minetest.set_node(pos, {name="farming:cut_pumpkin_1", param2=node.param2})
|
||||
clicker:set_hp(clicker:get_hp()+1)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "default:pumpkin_5 1",
|
||||
recipe = {
|
||||
{"farming:pumpkin", "farming:pumpkin", "farming:pumpkin"},
|
||||
{"farming:pumpkin", "farming:pumpkin", "farming:pumpkin"},
|
||||
{"farming:pumpkin", "farming:pumpkin", "farming:pumpkin"}
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_node("farming:pumpkin_6", {
|
||||
tiles = {
|
||||
"farming_pumpkin_6_top.png",
|
||||
"farming_pumpkin_6_top.png",
|
||||
"farming_pumpkin_6.png",
|
||||
},
|
||||
waving = 1,
|
||||
drop = "",
|
||||
groups = {
|
||||
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
|
||||
not_in_creative_inventory = 1, growing = 1
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("farming:cut_pumpkin_1", {
|
||||
tiles = {
|
||||
"farming_pumpkin_5_top.png",
|
||||
"farming_pumpkin_5_top.png",
|
||||
"farming_pumpkin_5.png",
|
||||
"farming_pumpkin_cut_4.png^[transformFX",
|
||||
"farming_pumpkin_5.png",
|
||||
"farming_pumpkin_cut_1.png"
|
||||
},
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.1875, -0.5, -0.5, 0.5, 0.5, 0}, -- NodeBox1
|
||||
{-0.5, -0.5, 0, 0.5, 0.5, 0.5}, -- NodeBox2
|
||||
}
|
||||
},
|
||||
drop = {
|
||||
items = {
|
||||
{items = {'farming:pumpkin'}, rarity = 1},
|
||||
{items = {'farming:pumpkin'}, rarity = 1},
|
||||
{items = {'farming:pumpkin'}, rarity = 1},
|
||||
{items = {'farming:pumpkin'}, rarity = 1},
|
||||
{items = {'farming:pumpkin'}, rarity = 1},
|
||||
{items = {'farming:pumpkin'}, rarity = 1},
|
||||
{items = {'farming:pumpkin'}, rarity = 1},
|
||||
}
|
||||
},
|
||||
groups = {snappy=3, flammable=2, plant=1, attached_node=1, not_in_creative_inventory=1},
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
minetest.set_node(pos, {name="farming:cut_pumpkin_2", param2=node.param2})
|
||||
clicker:set_hp(clicker:get_hp()+1)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("farming:cut_pumpkin_2", {
|
||||
tiles = {
|
||||
"farming_pumpkin_5_top.png",
|
||||
"farming_pumpkin_5_top.png",
|
||||
"farming_pumpkin_5.png",
|
||||
"farming_pumpkin_cut_4.png^[transformFX",
|
||||
"farming_pumpkin_5.png",
|
||||
"farming_pumpkin_cut_2.png"
|
||||
},
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{0.125, -0.5, -0.5, 0.5, 0.5, 0}, -- NodeBox1
|
||||
{-0.5, -0.5, 0, 0.5, 0.5, 0.5}, -- NodeBox2
|
||||
}
|
||||
},
|
||||
drop = {
|
||||
items = {
|
||||
{items = {'farming:pumpkin'}, rarity = 1},
|
||||
{items = {'farming:pumpkin'}, rarity = 1},
|
||||
{items = {'farming:pumpkin'}, rarity = 1},
|
||||
{items = {'farming:pumpkin'}, rarity = 1},
|
||||
{items = {'farming:pumpkin'}, rarity = 1},
|
||||
}
|
||||
},
|
||||
groups = {snappy=3, flammable=2, plant=1, attached_node=1, not_in_creative_inventory=1},
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
minetest.set_node(pos, {name="farming:cut_pumpkin_3", param2=node.param2})
|
||||
clicker:set_hp(clicker:get_hp()+1)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("farming:cut_pumpkin_3", {
|
||||
tiles = {
|
||||
"farming_pumpkin_5_top.png",
|
||||
"farming_pumpkin_5_top.png",
|
||||
"farming_pumpkin_5.png",
|
||||
"farming_pumpkin_cut_4.png^[transformFX",
|
||||
"farming_pumpkin_5.png",
|
||||
"farming_pumpkin_cut_3.png"
|
||||
},
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, 0, 0.5, 0.5, 0.5}, -- NodeBox2
|
||||
}
|
||||
},
|
||||
drop = {
|
||||
items = {
|
||||
{items = {'farming:pumpkin'}, rarity = 1},
|
||||
{items = {'farming:pumpkin'}, rarity = 1},
|
||||
{items = {'farming:pumpkin'}, rarity = 1},
|
||||
{items = {'farming:pumpkin'}, rarity = 1},
|
||||
}
|
||||
},
|
||||
groups = {snappy=3, flammable=2, plant=1, attached_node=1, not_in_creative_inventory=1},
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
minetest.set_node(pos, {name="farming:cut_pumpkin_4", param2=node.param2})
|
||||
clicker:set_hp(clicker:get_hp()+1)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("farming:cut_pumpkin_4", {
|
||||
tiles = {
|
||||
"farming_pumpkin_5_top.png",
|
||||
"farming_pumpkin_5_top.png",
|
||||
"farming_pumpkin_5.png",
|
||||
"farming_pumpkin_cut_3.png",
|
||||
"farming_pumpkin_5.png",
|
||||
"farming_pumpkin_cut_3.png"
|
||||
},
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.1875, -0.5, 0, 0.5, 0.5, 0.5}, -- NodeBox2
|
||||
}
|
||||
},
|
||||
drop = {
|
||||
items = {
|
||||
{items = {'farming:pumpkin'}, rarity = 1},
|
||||
{items = {'farming:pumpkin'}, rarity = 1},
|
||||
}
|
||||
},
|
||||
groups = {snappy=3, flammable=2, plant=1, attached_node=1, not_in_creative_inventory=1},
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
minetest.set_node(pos, {name="farming:cut_pumpkin_5", param2=node.param2})
|
||||
clicker:set_hp(clicker:get_hp()+1)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("farming:cut_pumpkin_5", {
|
||||
tiles = {
|
||||
"farming_pumpkin_5_top.png",
|
||||
"farming_pumpkin_5_top.png",
|
||||
"farming_pumpkin_5.png",
|
||||
"farming_pumpkin_cut_3.png",
|
||||
"farming_pumpkin_5.png",
|
||||
"farming_pumpkin_cut_3.png"
|
||||
},
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{0.125, -0.5, 0, 0.5, 0.5, 0.5}, -- NodeBox2
|
||||
}
|
||||
},
|
||||
drop = {
|
||||
items = {
|
||||
{items = {'farming:pumpkin'}, rarity = 1},
|
||||
}
|
||||
},
|
||||
groups = {snappy=3, flammable=2, plant=1, attached_node=1, not_in_creative_inventory=1},
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
minetest.remove_node(pos)
|
||||
clicker:set_hp(clicker:get_hp()+1)
|
||||
end,
|
||||
})
|
BIN
mods/farming/textures/farming_melon.png
Normal file
After Width: | Height: | Size: 423 B |
BIN
mods/farming/textures/farming_melon_1.png
Normal file
After Width: | Height: | Size: 170 B |
BIN
mods/farming/textures/farming_melon_2.png
Normal file
After Width: | Height: | Size: 439 B |
BIN
mods/farming/textures/farming_melon_3.png
Normal file
After Width: | Height: | Size: 437 B |
BIN
mods/farming/textures/farming_melon_3_top.png
Normal file
After Width: | Height: | Size: 231 B |
BIN
mods/farming/textures/farming_melon_4.png
Normal file
After Width: | Height: | Size: 443 B |
BIN
mods/farming/textures/farming_melon_4_top.png
Normal file
After Width: | Height: | Size: 313 B |
BIN
mods/farming/textures/farming_melon_5.png
Normal file
After Width: | Height: | Size: 331 B |
BIN
mods/farming/textures/farming_melon_5_top.png
Normal file
After Width: | Height: | Size: 452 B |
BIN
mods/farming/textures/farming_melon_6.png
Normal file
After Width: | Height: | Size: 332 B |
BIN
mods/farming/textures/farming_melon_6_top.png
Normal file
After Width: | Height: | Size: 452 B |
BIN
mods/farming/textures/farming_melon_cut_1.png
Normal file
After Width: | Height: | Size: 497 B |
BIN
mods/farming/textures/farming_melon_cut_2.png
Normal file
After Width: | Height: | Size: 587 B |
BIN
mods/farming/textures/farming_melon_cut_3.png
Normal file
After Width: | Height: | Size: 659 B |
BIN
mods/farming/textures/farming_melon_cut_4.png
Normal file
After Width: | Height: | Size: 554 B |
Before Width: | Height: | Size: 749 B After Width: | Height: | Size: 422 B |
BIN
mods/farming/textures/farming_pumpkin_3.png
Normal file
After Width: | Height: | Size: 441 B |
BIN
mods/farming/textures/farming_pumpkin_3_top.png
Normal file
After Width: | Height: | Size: 228 B |
BIN
mods/farming/textures/farming_pumpkin_4.png
Normal file
After Width: | Height: | Size: 446 B |
BIN
mods/farming/textures/farming_pumpkin_4_top.png
Normal file
After Width: | Height: | Size: 319 B |
BIN
mods/farming/textures/farming_pumpkin_5.png
Normal file
After Width: | Height: | Size: 671 B |
BIN
mods/farming/textures/farming_pumpkin_5_top.png
Normal file
After Width: | Height: | Size: 775 B |
BIN
mods/farming/textures/farming_pumpkin_6.png
Normal file
After Width: | Height: | Size: 647 B |
BIN
mods/farming/textures/farming_pumpkin_6_top.png
Normal file
After Width: | Height: | Size: 755 B |
BIN
mods/farming/textures/farming_pumpkin_cut_1.png
Normal file
After Width: | Height: | Size: 689 B |
BIN
mods/farming/textures/farming_pumpkin_cut_2.png
Normal file
After Width: | Height: | Size: 707 B |
BIN
mods/farming/textures/farming_pumpkin_cut_3.png
Normal file
After Width: | Height: | Size: 711 B |
BIN
mods/farming/textures/farming_pumpkin_cut_4.png
Normal file
After Width: | Height: | Size: 701 B |
@ -1904,6 +1904,9 @@ minetest.register_abm({
|
||||
interval = 5,
|
||||
chance = 1,
|
||||
action = function(pos, node)
|
||||
if minetest.get_timeofday() <= 0.6 and minetest.get_timeofday() >= 0.2 then
|
||||
return
|
||||
end
|
||||
minetest.add_particle({
|
||||
pos = {x=pos.x, y=pos.y+0.1, z=pos.z},
|
||||
velocity = {x=0, y=0, z=0},
|
||||
@ -1925,6 +1928,9 @@ minetest.register_abm({
|
||||
interval = 5,
|
||||
chance = 1,
|
||||
action = function(pos, node)
|
||||
if minetest.get_timeofday() <= 0.6 and minetest.get_timeofday() >= 0.2 then
|
||||
return
|
||||
end
|
||||
local dir = minetest.facedir_to_dir(node.param2)
|
||||
minetest.add_particle({
|
||||
pos = {x=pos.x-0.25*dir.z, y=pos.y+0.1, z=pos.z-0.25*dir.x},
|
||||
|
@ -280,20 +280,64 @@ minetest.register_abm({
|
||||
action = function(pos, node)
|
||||
local steam_source = minetest.find_node_near(pos, 1, {
|
||||
"default:furnace_active2",
|
||||
"stm_nodes:pipe_active",
|
||||
"stm_nodes:reactor_active"
|
||||
})
|
||||
if steam_source then
|
||||
minetest.set_node(pos, {name="stm_nodes:pipe_active", param2=node.param2})
|
||||
end
|
||||
local boiler_output = minetest.find_node_near(pos, 1, {"stm_nodes:boiler_output"})
|
||||
if not boiler_output or minetest.get_item_group(minetest.get_node(vector.add(boiler_output, {x=0,y=-1,z=0})).name, "boiler") == 0 then
|
||||
return
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"stm_nodes:boiler_output"},
|
||||
interval = 1,
|
||||
chance = 1,
|
||||
action = function(pos, node)
|
||||
local active = true
|
||||
|
||||
local steam_input = minetest.find_node_near(pos, 1, {"stm_nodes:pipe"})
|
||||
local source = minetest.get_node({x=pos.x, y=pos.y-3, z=pos.z})
|
||||
local source2 = minetest.get_node({x=pos.x, y=pos.y-2, z=pos.z})
|
||||
if source.name ~= "stm_nodes:furnace_active" and source2.name ~= "stm_nodes:furnace_active" then
|
||||
active = false
|
||||
steam_input = minetest.find_node_near(pos, 1, {"stm_nodes:pipe_active"})
|
||||
end
|
||||
local heat = minetest.find_node_near(vector.add(boiler_output, {x=0,y=-2,z=0}),
|
||||
1, {"stm_nodes:furnace_active", "default:furnace_active2"})
|
||||
if heat then
|
||||
minetest.set_node(pos, {name="stm_nodes:pipe_active", param2=node.param2})
|
||||
|
||||
if not minetest.find_node_near(pos, 2, {"stm_nodes:boiler", "stm_nodes:large_boiler_top"}) then
|
||||
active = false
|
||||
steam_input = minetest.find_node_near(pos, 1, {"stm_nodes:pipe_active"})
|
||||
end
|
||||
|
||||
if steam_input == nil then
|
||||
return
|
||||
end
|
||||
|
||||
if not active then
|
||||
for i = 1, 20 do
|
||||
local name = minetest.get_node(steam_input).name
|
||||
if name == "stm_nodes:pipe_active" then
|
||||
minetest.set_node(steam_input, {name="stm_nodes:pipe", param2=minetest.get_node(steam_input).param2})
|
||||
end
|
||||
local nextpos = minetest.find_node_near(steam_input, 1, {"stm_nodes:pipe_active",})
|
||||
if not nextpos then
|
||||
return
|
||||
end
|
||||
steam_input = nextpos
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
for i = 1, 20 do
|
||||
local name = minetest.get_node(steam_input).name
|
||||
if name == "stm_nodes:pipe" then
|
||||
minetest.set_node(steam_input, {name="stm_nodes:pipe_active", param2=minetest.get_node(steam_input).param2})
|
||||
end
|
||||
local nextpos = minetest.find_node_near(steam_input, 1, {"stm_nodes:pipe",})
|
||||
if not nextpos then
|
||||
return
|
||||
end
|
||||
steam_input = nextpos
|
||||
end
|
||||
end
|
||||
})
|
||||
@ -303,17 +347,8 @@ minetest.register_abm({
|
||||
interval = 5,
|
||||
chance = 1,
|
||||
action = function(pos, node)
|
||||
if not minetest.find_node_near(pos, 1, {"stm_nodes:pipe_active"}) then
|
||||
minetest.set_node(pos, {name = "stm_nodes:pipe", param2 = node.param2})
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"stm_nodes:pipe"},
|
||||
interval = 1,
|
||||
chance = 1,
|
||||
action = function(pos, node)
|
||||
if minetest.find_node_near(pos, 1, {"default:furnace_active2"}) then
|
||||
minetest.set_node(pos, {name="stm_nodes:pipe_active", param2=node.param2})
|
||||
end
|
||||
end
|
||||
})
|
||||
@ -815,7 +850,7 @@ minetest.register_abm({
|
||||
end
|
||||
|
||||
local cable = minetest.find_node_near(pos, 1, {"stm_nodes:cable", "stm_nodes:cable_active", "stm_nodes:cable_ceiling", "stm_nodes:cable_ceiling_active"})
|
||||
local power = minetest.find_node_near(pos, 7, {"stm_nodes:generator_active", "stm_nodes:sustainer"})
|
||||
local power = minetest.find_node_near(pos, 10, {"stm_nodes:generator_active", "stm_nodes:sustainer"})
|
||||
if not cable then
|
||||
minetest.set_node(pos, {name=newname, param2=node.param2})
|
||||
elseif not power then
|
||||
@ -1237,7 +1272,7 @@ minetest.register_abm({
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"stm_nodes:light"},
|
||||
interval = 5,
|
||||
interval = 2,
|
||||
chance = 1,
|
||||
action = function(pos, node)
|
||||
if minetest.find_node_near(pos, 1, {"stm_nodes:lever2_off",}) then
|
||||
@ -1305,7 +1340,7 @@ minetest.register_abm({
|
||||
texture = "stm_nodes_steam.png",
|
||||
})
|
||||
end
|
||||
local sustainer = minetest.find_node_near(pos, 9, {"stm_nodes:sustainer",})
|
||||
local sustainer = minetest.find_node_near(pos, 11, {"stm_nodes:sustainer",})
|
||||
if sustainer then
|
||||
minetest.set_node(sustainer, {name="stm_nodes:sustainer_inactive",})
|
||||
end
|
||||
@ -1319,6 +1354,7 @@ minetest.register_abm({
|
||||
action = function(pos, node)
|
||||
local motor = minetest.find_node_near(pos, 1, {"stm_nodes:motor",})
|
||||
local steam_input = minetest.find_node_near(pos, 1, {"stm_nodes:pipe_active", "stm_nodes_boiler_output"})
|
||||
if motor ~= nil then
|
||||
minetest.add_particlespawner({
|
||||
amount = 4,
|
||||
time = 2,
|
||||
@ -1336,6 +1372,7 @@ minetest.register_abm({
|
||||
vertical = false,
|
||||
texture = "stm_nodes_steam.png",
|
||||
})
|
||||
end
|
||||
if not motor or not steam_input then
|
||||
minetest.after(1, function()
|
||||
if pos ~= nil then
|
||||
@ -1358,12 +1395,18 @@ minetest.register_abm({
|
||||
if minetest.find_node_near(pos, 1, {"stm_nodes:lever2_off",}) then
|
||||
return
|
||||
end
|
||||
local generator = minetest.find_node_near(pos, 8, {"stm_nodes:generator_active",})
|
||||
local sustainer = minetest.find_node_near(pos, 8, {"stm_nodes:sustainer",})
|
||||
local sustainer2 = minetest.find_node_near(pos, 8, {"stm_nodes:sustainer",})
|
||||
local generator = minetest.find_node_near(pos, 11, {"stm_nodes:generator_active",})
|
||||
local sustainer = minetest.find_node_near(pos, 11, {"stm_nodes:sustainer",})
|
||||
local sustainer2 = minetest.find_node_near(pos, 11, {"stm_nodes:sustainer",})
|
||||
if not sustainer and not sustainer2 and not generator then
|
||||
return
|
||||
end
|
||||
if sustainer and not minetest.find_node_near(sustainer, 11, {"stm_nodes:generator_active", "stm_nodes:sustainer"}) then
|
||||
minetest.set_node(pos, {name="stm_nodes:sustainer_inactive", param2=node.param2})
|
||||
end
|
||||
if sustainer2 and not minetest.find_node_near(sustainer2, 11, {"stm_nodes:generator_active", "stm_nodes:sustainer"}) then
|
||||
minetest.set_node(pos, {name="stm_nodes:sustainer_inactive", param2=node.param2})
|
||||
end
|
||||
if generator or sustainer ~= sustainer2 then
|
||||
if minetest.find_node_near(pos, 1, {"stm_nodes:cable_active", "stm_nodes:cable_ceiling_active"}) then
|
||||
minetest.set_node(pos, {name="stm_nodes:sustainer", param2=node.param2})
|
||||
@ -1377,7 +1420,7 @@ minetest.register_abm({
|
||||
interval = 4,
|
||||
chance = 1,
|
||||
action = function(pos, node)
|
||||
if minetest.get_node(pos).name == "stm_nodes:sustainer" and not minetest.find_node_near(pos, 8, {"stm_nodes:sustainer", "stm_nodes:generator_active"}) then
|
||||
if minetest.get_node(pos).name == "stm_nodes:sustainer" and not minetest.find_node_near(pos, 11, {"stm_nodes:sustainer", "stm_nodes:generator_active"}) then
|
||||
minetest.set_node(pos, {name="stm_nodes:sustainer_inactive"})
|
||||
return
|
||||
end
|
||||
@ -1390,6 +1433,8 @@ minetest.register_abm({
|
||||
if not power then
|
||||
return
|
||||
end
|
||||
|
||||
for i = 1, 11 do
|
||||
local name = minetest.get_node(power).name
|
||||
if name == "stm_nodes:cable" then
|
||||
minetest.set_node(power, {name="stm_nodes:cable_active", param2=minetest.get_node(power).param2})
|
||||
@ -1401,74 +1446,7 @@ minetest.register_abm({
|
||||
return
|
||||
end
|
||||
power = nextpos
|
||||
|
||||
local name = minetest.get_node(power).name
|
||||
if name == "stm_nodes:cable" then
|
||||
minetest.set_node(power, {name="stm_nodes:cable_active", param2=minetest.get_node(power).param2})
|
||||
else
|
||||
minetest.set_node(power, {name="stm_nodes:cable_ceiling_active", param2=minetest.get_node(power).param2})
|
||||
end
|
||||
local nextpos = minetest.find_node_near(power, 1, {"stm_nodes:cable", "stm_nodes:cable_ceiling"})
|
||||
if not nextpos then
|
||||
return
|
||||
end
|
||||
power = nextpos
|
||||
|
||||
local name = minetest.get_node(power).name
|
||||
if name == "stm_nodes:cable" then
|
||||
minetest.set_node(power, {name="stm_nodes:cable_active", param2=minetest.get_node(power).param2})
|
||||
else
|
||||
minetest.set_node(power, {name="stm_nodes:cable_ceiling_active", param2=minetest.get_node(power).param2})
|
||||
end
|
||||
local nextpos = minetest.find_node_near(power, 1, {"stm_nodes:cable", "stm_nodes:cable_ceiling"})
|
||||
if not nextpos then
|
||||
return
|
||||
end
|
||||
power = nextpos
|
||||
|
||||
local name = minetest.get_node(power).name
|
||||
if name == "stm_nodes:cable" then
|
||||
minetest.set_node(power, {name="stm_nodes:cable_active", param2=minetest.get_node(power).param2})
|
||||
else
|
||||
minetest.set_node(power, {name="stm_nodes:cable_ceiling_active", param2=minetest.get_node(power).param2})
|
||||
end
|
||||
local nextpos = minetest.find_node_near(power, 1, {"stm_nodes:cable", "stm_nodes:cable_ceiling"})
|
||||
if not nextpos then
|
||||
return
|
||||
end
|
||||
power = nextpos
|
||||
|
||||
local name = minetest.get_node(power).name
|
||||
if name == "stm_nodes:cable" then
|
||||
minetest.set_node(power, {name="stm_nodes:cable_active", param2=minetest.get_node(power).param2})
|
||||
else
|
||||
minetest.set_node(power, {name="stm_nodes:cable_ceiling_active", param2=minetest.get_node(power).param2})
|
||||
end
|
||||
local nextpos = minetest.find_node_near(power, 1, {"stm_nodes:cable", "stm_nodes:cable_ceiling"})
|
||||
if not nextpos then
|
||||
return
|
||||
end
|
||||
power = nextpos
|
||||
|
||||
local name = minetest.get_node(power).name
|
||||
if name == "stm_nodes:cable" then
|
||||
minetest.set_node(power, {name="stm_nodes:cable_active", param2=minetest.get_node(power).param2})
|
||||
else
|
||||
minetest.set_node(power, {name="stm_nodes:cable_ceiling_active", param2=minetest.get_node(power).param2})
|
||||
end
|
||||
local nextpos = minetest.find_node_near(power, 1, {"stm_nodes:cable", "stm_nodes:cable_ceiling"})
|
||||
if not nextpos then
|
||||
return
|
||||
end
|
||||
power = nextpos
|
||||
|
||||
local name = minetest.get_node(power).name
|
||||
if name == "stm_nodes:cable" then
|
||||
minetest.set_node(power, {name="stm_nodes:cable_active", param2=minetest.get_node(power).param2})
|
||||
else
|
||||
minetest.set_node(power, {name="stm_nodes:cable_ceiling_active", param2=minetest.get_node(power).param2})
|
||||
end
|
||||
local nextpos = minetest.find_node_near(power, 1, {"stm_nodes:cable", "stm_nodes:cable_ceiling"})
|
||||
end
|
||||
})
|
||||
|
||||
@ -1517,6 +1495,186 @@ minetest.register_abm({
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("stm_nodes:piston", {
|
||||
description = "Piston",
|
||||
tiles = {
|
||||
"default_wood.png",
|
||||
"default_wood.png",
|
||||
"default_wood.png",
|
||||
"default_wood.png",
|
||||
"default_wood.png",
|
||||
"default_wood.png"
|
||||
},
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.4375, -0.4375, -0.5, 0.4375, 0.4375, -0.25}, -- NodeBox1
|
||||
{-0.5, -0.5, -0.25, 0.5, 0.5, 0.5}, -- NodeBox2
|
||||
}
|
||||
},
|
||||
groups = {cracky=1, electric=1},
|
||||
drop = "stm_nodes:piston"
|
||||
})
|
||||
|
||||
minetest.register_node("stm_nodes:piston_open", {
|
||||
tiles = {
|
||||
"default_wood.png",
|
||||
"default_wood.png",
|
||||
"default_wood.png",
|
||||
"default_wood.png",
|
||||
"default_wood.png",
|
||||
"default_wood.png"
|
||||
},
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.4375, -0.4375, -1.5, 0.4375, 0.4375, -1.25}, -- NodeBox1
|
||||
{-0.5, -0.5, -0.25, 0.5, 0.5, 0.5}, -- NodeBox2
|
||||
{-0.125, -0.125, -1.25, 0.125, 0.125, -0.25}, -- NodeBox3
|
||||
}
|
||||
},
|
||||
groups = {cracky=1, electric=1},
|
||||
drop = "stm_nodes:piston",
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"stm_nodes:piston"},
|
||||
interval = 1,
|
||||
chance = 1,
|
||||
action = function(pos, node)
|
||||
if minetest.find_node_near(pos, 1, {"stm_nodes:lever2_off",}) then
|
||||
return
|
||||
end
|
||||
local power = minetest.find_node_near(pos, 1, {"stm_nodes:cable_active", "stm_nodes:cable_ceiling_active",})
|
||||
if power then
|
||||
minetest.set_node(pos, {name="stm_nodes:piston_open", param2=node.param2})
|
||||
local dir = minetest.facedir_to_dir(node.param2)
|
||||
local movenode = minetest.get_node({x=pos.x-1*dir.x, y=pos.y, z=pos.z-1*dir.z})
|
||||
if minetest.get_node({x=pos.x-2*dir.x, y=pos.y, z=pos.z-2*dir.z}).name == "air" then
|
||||
minetest.set_node({x=pos.x-2*dir.x, y=pos.y, z=pos.z-2*dir.z}, {name=movenode.name, param2=movenode.param2})
|
||||
minetest.remove_node({x=pos.x-1*dir.x, y=pos.y, z=pos.z-1*dir.z})
|
||||
end
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"stm_nodes:piston_open"},
|
||||
interval = 1,
|
||||
chance = 1,
|
||||
action = function(pos, node)
|
||||
if minetest.find_node_near(pos, 1, {"stm_nodes:lever2_off",}) then
|
||||
minetest.set_node(pos, {name="stm_nodes:piston", param2=node.param2})
|
||||
end
|
||||
local power = minetest.find_node_near(pos, 1, {"stm_nodes:cable_active", "stm_nodes:cable_ceiling_active",})
|
||||
if not power then
|
||||
minetest.set_node(pos, {name="stm_nodes:piston", param2=node.param2})
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("stm_nodes:spiston", {
|
||||
description = "Sticky Piston",
|
||||
tiles = {
|
||||
"default_wood.png",
|
||||
"default_wood.png",
|
||||
"default_wood.png",
|
||||
"default_wood.png",
|
||||
"default_wood.png",
|
||||
"default_wood.png"
|
||||
},
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.4375, -0.4375, -0.5, 0.4375, 0.4375, -0.25}, -- NodeBox1
|
||||
{-0.5, -0.5, -0.25, 0.5, 0.5, 0.5}, -- NodeBox2
|
||||
}
|
||||
},
|
||||
groups = {cracky=1, electric=1},
|
||||
drop = "stm_nodes:piston"
|
||||
})
|
||||
|
||||
minetest.register_node("stm_nodes:spiston_open", {
|
||||
tiles = {
|
||||
"default_wood.png",
|
||||
"default_wood.png",
|
||||
"default_wood.png",
|
||||
"default_wood.png",
|
||||
"default_wood.png",
|
||||
"default_wood.png"
|
||||
},
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.4375, -0.4375, -1.5, 0.4375, 0.4375, -1.25}, -- NodeBox1
|
||||
{-0.5, -0.5, -0.25, 0.5, 0.5, 0.5}, -- NodeBox2
|
||||
{-0.125, -0.125, -1.25, 0.125, 0.125, -0.25}, -- NodeBox3
|
||||
}
|
||||
},
|
||||
groups = {cracky=1, electric=1},
|
||||
drop = "stm_nodes:spiston",
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"stm_nodes:spiston"},
|
||||
interval = 1,
|
||||
chance = 1,
|
||||
action = function(pos, node)
|
||||
if minetest.find_node_near(pos, 1, {"stm_nodes:lever2_off",}) then
|
||||
return
|
||||
end
|
||||
local power = minetest.find_node_near(pos, 1, {"stm_nodes:cable_active", "stm_nodes:cable_ceiling_active",})
|
||||
if power then
|
||||
minetest.set_node(pos, {name="stm_nodes:spiston_open", param2=node.param2})
|
||||
local dir = minetest.facedir_to_dir(node.param2)
|
||||
local movenode = minetest.get_node({x=pos.x-1*dir.x, y=pos.y, z=pos.z-1*dir.z})
|
||||
if minetest.get_node({x=pos.x-2*dir.x, y=pos.y, z=pos.z-2*dir.z}).name == "air" then
|
||||
minetest.set_node({x=pos.x-2*dir.x, y=pos.y, z=pos.z-2*dir.z}, {name=movenode.name, param2=movenode.param2})
|
||||
minetest.remove_node({x=pos.x-1*dir.x, y=pos.y, z=pos.z-1*dir.z})
|
||||
end
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"stm_nodes:spiston_open"},
|
||||
interval = 1,
|
||||
chance = 1,
|
||||
action = function(pos, node)
|
||||
if minetest.find_node_near(pos, 1, {"stm_nodes:lever2_off",}) then
|
||||
minetest.set_node(pos, {name="stm_nodes:spiston", param2=node.param2})
|
||||
local dir = minetest.facedir_to_dir(node.param2)
|
||||
local movenode = minetest.get_node({x=pos.x-2*dir.x, y=pos.y, z=pos.z-2*dir.z})
|
||||
if minetest.get_node({x=pos.x-1*dir.x, y=pos.y, z=pos.z-1*dir.z}).name == "air" then
|
||||
minetest.set_node({x=pos.x-1*dir.x, y=pos.y, z=pos.z-1*dir.z}, {name=movenode.name, param2=movenode.param2})
|
||||
minetest.remove_node({x=pos.x-2*dir.x, y=pos.y, z=pos.z-2*dir.z})
|
||||
end
|
||||
end
|
||||
local power = minetest.find_node_near(pos, 1, {"stm_nodes:cable_active", "stm_nodes:cable_ceiling_active",})
|
||||
if not power then
|
||||
minetest.set_node(pos, {name="stm_nodes:spiston", param2=node.param2})
|
||||
local dir = minetest.facedir_to_dir(node.param2)
|
||||
local movenode = minetest.get_node({x=pos.x-2*dir.x, y=pos.y, z=pos.z-2*dir.z})
|
||||
if minetest.get_node({x=pos.x-1*dir.x, y=pos.y, z=pos.z-1*dir.z}).name == "air" then
|
||||
minetest.set_node({x=pos.x-1*dir.x, y=pos.y, z=pos.z-1*dir.z}, {name=movenode.name, param2=movenode.param2})
|
||||
minetest.remove_node({x=pos.x-2*dir.x, y=pos.y, z=pos.z-2*dir.z})
|
||||
end
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
--electric, right-click activated
|
||||
|
||||
minetest.register_node("stm_nodes:bulb", {
|
||||
|