Added more colors and cleaned up code
30
README.md
@ -1,4 +1,28 @@
|
||||
mybricks
|
||||
========
|
||||
mymulch
|
||||
=======
|
||||
|
||||
mybricks adds an overlay to default nodes. Turns them into bricks, squares, small squares or tiles.
|
||||
Licenced as WTFPL.
|
||||
Created by Don
|
||||
Code for machine based off of Noncubic by yves_de_beck
|
||||
|
||||
mymulch adds mulch to the game. You craft it from leaves, sticks, flowers and plants in the composter and can color it in the Mulch dye machine.
|
||||
|
||||
Simply craft a composter and open it. Added any combination of leaves, flowers, plants and sticks. Click the "make" button and you get tan colored mulch.
|
||||
Put the tan colored mulch in the mulch dye machine with what ever color of dye you want and click the "color" button.
|
||||
|
||||
Mulch is soil so you can grow any plants that require group:soil.
|
||||
They are falling nodes. They need something under them just like gravel.
|
||||
|
||||
Craft a composter
|
||||
-----------------------
|
||||
|
||||
group:leaves group:wood group:leaves
|
||||
group:wood default:apple group:wood
|
||||
group:leaves group:wood group:leaves
|
||||
|
||||
Craft a mulch dye machine
|
||||
-----------------------
|
||||
|
||||
group:leaves group:wood group:leaves
|
||||
group:wood bucket:bucket_empty group:wood
|
||||
group:leaves group:wood group:leaves
|
||||
|
8
init.lua
@ -1,7 +1,7 @@
|
||||
mybricks = {}
|
||||
dofile(minetest.get_modpath("mybricks").."/bricks.lua")
|
||||
dofile(minetest.get_modpath("mybricks").."/machine.lua")
|
||||
dofile(minetest.get_modpath("mybricks").."/register.lua")
|
||||
mymulch = {}
|
||||
dofile(minetest.get_modpath("mymulch").."/mulch.lua")
|
||||
dofile(minetest.get_modpath("mymulch").."/machine.lua")
|
||||
dofile(minetest.get_modpath("mymulch").."/register.lua")
|
||||
|
||||
|
||||
|
||||
|
437
machine.lua
@ -1,34 +1,33 @@
|
||||
local material = {}
|
||||
local shape = {}
|
||||
local make_ok = {}
|
||||
local anzahl = {}
|
||||
local material = {}
|
||||
local shape = {}
|
||||
local make_ok = {}
|
||||
local make_okk = {}
|
||||
local anzahl = {}
|
||||
local anzahlk = {}
|
||||
local mulch = {}
|
||||
|
||||
minetest.register_node("mybricks:machine", {
|
||||
description = "Brick Machine",
|
||||
tiles = {"mybricks_machine.png"},
|
||||
minetest.register_node("mymulch:machine", {
|
||||
description = "Compost Machine",
|
||||
tiles = {"mymulch_machine.png"},
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {cracky=2},
|
||||
groups = {oddly_breakable_by_hand=2, cracky=3, dig_immediate=1},
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.1875, -0.5, 0.5, 0.0625, 0.5},
|
||||
{-0.5, -0.1875, -0.5, 0.5, 0.5, -0.3125},
|
||||
{-0.5, -0.5, -0.5, -0.3125, -0.1875, -0.3125},
|
||||
{0.3125, -0.5, -0.5, 0.5, -0.1875, -0.3125},
|
||||
{0.3125, -0.5, 0.3125, 0.5, -0.1875, 0.5},
|
||||
{-0.5, -0.5, 0.3125, -0.3125, -0.1875, 0.5},
|
||||
{-0.5, -0.1875, -0.5, -0.3125, 0.5, 0.5},
|
||||
{-0.5, -0.1875, 0.3125, 0.5, 0.5, 0.5},
|
||||
{0.3125, -0.1875, -0.5, 0.5, 0.5, 0.5},
|
||||
{0.3125, -0.5, -0.5, 0.5, 0.5, 0.5},
|
||||
{-0.5, -0.5, -0.5, -0.3125, 0.5, 0.5},
|
||||
{-0.5, -0.5, 0.3125, 0.5, 0.5, 0.5},
|
||||
{-0.5, -0.5, -0.5, 0.5, 0.5, -0.3125},
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.375, 0.5},
|
||||
}
|
||||
},
|
||||
|
||||
after_place_node = function(pos, placer)
|
||||
local meta = minetest.env:get_meta(pos);
|
||||
meta:set_string("owner", (placer:get_player_name() or ""));
|
||||
meta:set_string("infotext", "Brick Machine is empty (owned by " .. (placer:get_player_name() or "") .. ")");
|
||||
meta:set_string("infotext", "Mulch Machine (owned by " .. (placer:get_player_name() or "") .. ")");
|
||||
end,
|
||||
|
||||
can_dig = function(pos,player)
|
||||
@ -44,25 +43,25 @@ end,
|
||||
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.env:get_meta(pos)
|
||||
meta:set_string("formspec", "invsize[10,11;]"..
|
||||
"background[-0.15,-0.25;10.40,11.75;mybricks_background.png]"..
|
||||
"list[current_name;ingot;7,2;1,1;]"..
|
||||
"list[current_name;res;7,4;1,1;]"..
|
||||
"label[7,1.5;Input:]"..
|
||||
"label[7,3.5;Output:]"..
|
||||
"label[0,0;Choose Brick Stye:]"..
|
||||
"label[1.5,1.5;Brick]"..
|
||||
"image_button[1.5,2;1,1;mybricks_mach1.png;brick; ]"..
|
||||
"label[4,1.5;Squares]"..
|
||||
"image_button[4,2;1,1;mybricks_mach2.png;square; ]"..
|
||||
"label[1.5,3.5;Small Squares]"..
|
||||
"image_button[1.5,4;1,1;mybricks_mach3.png;square_sm; ]"..
|
||||
"label[4,3.5;Tiles]"..
|
||||
"image_button[4,4;1,1;mybricks_mach4.png;tile; ]"..
|
||||
"list[current_player;main;1,7;8,4;]")
|
||||
meta:set_string("infotext", "Brick Machine")
|
||||
meta:set_string("formspec", "invsize[10,9;]"..
|
||||
"background[-0.15,-0.25;10.40,9.75;mysiding_background.png]"..
|
||||
"label[0,0;Mulch:]"..
|
||||
"label[1,1;Craft Mulch]"..
|
||||
"list[current_name;craft1;1,2;1,1; ]"..
|
||||
"list[current_name;craft2;1,3;1,1; ]"..
|
||||
"list[current_name;craft3;2,2;1,1; ]"..
|
||||
"list[current_name;craft4;2,3;1,1; ]"..
|
||||
"button[4,2;1,1;make;Make]"..
|
||||
"label[6,1.5;Output:]"..
|
||||
"list[current_name;res;6,2;1,1;]"..
|
||||
"label[1,4;Add any leaves, sticks, flowers or plants to make mulch]"..
|
||||
"list[current_player;main;1,5;8,4;]")
|
||||
meta:set_string("infotext", "Siding Machine")
|
||||
local inv = meta:get_inventory()
|
||||
inv:set_size("ingot", 1)
|
||||
inv:set_size("craft1", 1)
|
||||
inv:set_size("craft2", 1)
|
||||
inv:set_size("craft3", 1)
|
||||
inv:set_size("craft4", 1)
|
||||
inv:set_size("res", 1)
|
||||
end,
|
||||
|
||||
@ -70,115 +69,318 @@ on_receive_fields = function(pos, formname, fields, sender)
|
||||
local meta = minetest.env:get_meta(pos)
|
||||
local inv = meta:get_inventory()
|
||||
|
||||
if fields["brick"]
|
||||
or fields["square"]
|
||||
or fields["square_sm"]
|
||||
or fields["tile"]
|
||||
then
|
||||
if fields["make"]
|
||||
then
|
||||
|
||||
if fields["brick"] then
|
||||
make_ok = "0"
|
||||
anzahl = "1"
|
||||
shape = "mybricks:brick_"
|
||||
if inv:is_empty("ingot") then
|
||||
if fields["make"] then
|
||||
make_okk = "0"
|
||||
anzahlk = "1"
|
||||
mulch = "mymulch:mulch_tan"
|
||||
if inv:is_empty("craft1") or
|
||||
inv:is_empty("craft2") or
|
||||
inv:is_empty("craft3") or
|
||||
inv:is_empty("craft4") then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
if fields["square"] then
|
||||
make_ok = "0"
|
||||
anzahl = "1"
|
||||
shape = "mybricks:brick_square_"
|
||||
if inv:is_empty("ingot") then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
if fields["square_sm"] then
|
||||
make_ok = "0"
|
||||
anzahl = "1"
|
||||
shape = "mybricks:brick_square_sm_"
|
||||
if inv:is_empty("ingot") then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
if fields["tile"] then
|
||||
make_ok = "0"
|
||||
anzahl = "1"
|
||||
shape = "mybricks:brick_tile_"
|
||||
if inv:is_empty("ingot") then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
local ingotstack = inv:get_stack("ingot", 1)
|
||||
|
||||
local ingotstack1 = inv:get_stack("craft1", 1)
|
||||
local ingotstack2 = inv:get_stack("craft2", 1)
|
||||
local ingotstack3 = inv:get_stack("craft3", 1)
|
||||
local ingotstack4 = inv:get_stack("craft4", 1)
|
||||
local resstack = inv:get_stack("res", 1)
|
||||
----------------------------------------------------------------------------------
|
||||
--register nodes
|
||||
----------------------------------------------------------------------------------
|
||||
if ingotstack:get_name()=="default:sandstone" then
|
||||
material = "default_sandstone"
|
||||
|
||||
|
||||
local leaves1 = minetest.registered_aliases[ingotstack1:get_name()]
|
||||
if not leaves1 then
|
||||
leaves1 = ingotstack1:get_name()
|
||||
end
|
||||
local leaves2 = minetest.registered_aliases[ingotstack2:get_name()]
|
||||
if not leaves2 then
|
||||
leaves2 = ingotstack2:get_name()
|
||||
end
|
||||
local leaves3 = minetest.registered_aliases[ingotstack3:get_name()]
|
||||
if not leaves3 then
|
||||
leaves3 = ingotstack3:get_name()
|
||||
end
|
||||
local leaves4 = minetest.registered_aliases[ingotstack4:get_name()]
|
||||
if not leaves4 then
|
||||
leaves4 = ingotstack4:get_name()
|
||||
end
|
||||
----------------------------------------------------------------------
|
||||
local flora1 = minetest.registered_aliases[ingotstack1:get_name()]
|
||||
if not flora1 then
|
||||
flora1 = ingotstack1:get_name()
|
||||
end
|
||||
local flora2 = minetest.registered_aliases[ingotstack2:get_name()]
|
||||
if not flora2 then
|
||||
flora2 = ingotstack2:get_name()
|
||||
end
|
||||
local flora3 = minetest.registered_aliases[ingotstack3:get_name()]
|
||||
if not flora3 then
|
||||
flora3 = ingotstack3:get_name()
|
||||
end
|
||||
local flora4 = minetest.registered_aliases[ingotstack4:get_name()]
|
||||
if not flora4 then
|
||||
flora4 = ingotstack4:get_name()
|
||||
end
|
||||
----------------------------------------------------------------------
|
||||
local stick1 = minetest.registered_aliases[ingotstack1:get_name()]
|
||||
if not stick1 then
|
||||
stick1 = ingotstack1:get_name()
|
||||
end
|
||||
local stick2 = minetest.registered_aliases[ingotstack2:get_name()]
|
||||
if not stick2 then
|
||||
stick2 = ingotstack2:get_name()
|
||||
end
|
||||
local stick3 = minetest.registered_aliases[ingotstack3:get_name()]
|
||||
if not stick3 then
|
||||
stick3 = ingotstack3:get_name()
|
||||
end
|
||||
local stick4 = minetest.registered_aliases[ingotstack4:get_name()]
|
||||
if not stick4 then
|
||||
stick4 = ingotstack4:get_name()
|
||||
end
|
||||
|
||||
-- Check group
|
||||
local iteml1 = minetest.registered_items[leaves1]
|
||||
local iteml2 = minetest.registered_items[leaves2]
|
||||
local iteml3 = minetest.registered_items[leaves3]
|
||||
local iteml4 = minetest.registered_items[leaves4]
|
||||
local itemf1 = minetest.registered_items[flora1]
|
||||
local itemf2 = minetest.registered_items[flora2]
|
||||
local itemf3 = minetest.registered_items[flora3]
|
||||
local itemf4 = minetest.registered_items[flora4]
|
||||
local items1 = minetest.registered_items[stick1]
|
||||
local items2 = minetest.registered_items[stick2]
|
||||
local items3 = minetest.registered_items[stick3]
|
||||
local items4 = minetest.registered_items[stick4]
|
||||
|
||||
if items1 and items1.groups and items1.groups["stick"] or
|
||||
itemf1 and itemf1.groups and itemf1.groups["flora"] or
|
||||
iteml1 and iteml1.groups and iteml1.groups["leaves"] and
|
||||
items2 and items2.groups and items2.groups["stick"] or
|
||||
itemf2 and itemf2.groups and itemf2.groups["flora"] or
|
||||
iteml2 and iteml2.groups and iteml2.groups["leaves"] and
|
||||
items3 and items3.groups and items3.groups["stick"] or
|
||||
itemf3 and itemf3.groups and itemf3.groups["flora"] or
|
||||
iteml3 and iteml3.groups and iteml3.groups["leaves"] and
|
||||
items4 and items4.groups and items4.groups["stick"] or
|
||||
itemf4 and itemf4.groups and itemf4.groups["flora"] or
|
||||
iteml4 and iteml4.groups and iteml4.groups["leaves"] then
|
||||
material = "tan"
|
||||
make_okk = "1"
|
||||
|
||||
end
|
||||
----------------------------------------------------------------------
|
||||
----------------------------------------------------------------------
|
||||
|
||||
if make_okk == "1" then
|
||||
local give = {}
|
||||
for i = 0, anzahlk-1 do
|
||||
give[i+1]=inv:add_item("res",mulch)
|
||||
end
|
||||
ingotstack1:take_item()
|
||||
inv:set_stack("craft1",1,ingotstack1)
|
||||
ingotstack2:take_item()
|
||||
inv:set_stack("craft2",1,ingotstack2)
|
||||
ingotstack3:take_item()
|
||||
inv:set_stack("craft3",1,ingotstack3)
|
||||
ingotstack4:take_item()
|
||||
inv:set_stack("craft4",1,ingotstack4)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
})
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------------------------------------
|
||||
--------------------------------------------------------------------------------------------------------------
|
||||
|
||||
minetest.register_node("mymulch:machine_dye", {
|
||||
description = "Mulch Dye Machine",
|
||||
tiles = {
|
||||
"mymulch_machine_top.png",
|
||||
"mymulch_machine_top.png",
|
||||
"mymulch_machine_side.png",
|
||||
"mymulch_machine_side.png",
|
||||
"mymulch_machine_side.png",
|
||||
"mymulch_machine_side.png",
|
||||
},
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {oddly_breakable_by_hand=2, cracky=3, dig_immediate=1},
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, -0.375, 0.25, 0.5}, -- NodeBox1
|
||||
{0.375, -0.5, -0.5, 0.5, 0.25, 0.5}, -- NodeBox2
|
||||
{-0.5, -0.5, 0.375, 0.5, 0.25, 0.5}, -- NodeBox3
|
||||
{-0.5, -0.5, -0.5, 0.5, 0.25, -0.375}, -- NodeBox4
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.375, 0.5}, -- NodeBox5
|
||||
{-0.0625, 0.25, 0.375, 0.0625, 0.5, 0.5}, -- NodeBox6
|
||||
{-0.0625, 0.375, -0.0625, 0.0625, 0.5, 0.5}, -- NodeBox7
|
||||
{-0.0625, 0.25, -0.0625, 0.0625, 0.375, 0.0625}, -- NodeBox8
|
||||
}
|
||||
},
|
||||
|
||||
after_place_node = function(pos, placer)
|
||||
local meta = minetest.env:get_meta(pos);
|
||||
meta:set_string("owner", (placer:get_player_name() or ""));
|
||||
meta:set_string("infotext", "Mulch Dying Machine (owned by " .. (placer:get_player_name() or "") .. ")");
|
||||
end,
|
||||
|
||||
can_dig = function(pos,player)
|
||||
local meta = minetest.env:get_meta(pos);
|
||||
local inv = meta:get_inventory()
|
||||
if not inv:is_empty("ingot") then
|
||||
return false
|
||||
elseif not inv:is_empty("res") then
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end,
|
||||
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.env:get_meta(pos)
|
||||
meta:set_string("formspec", "invsize[10,9;]"..
|
||||
"background[-0.15,-0.25;10.40,9.75;mysiding_background.png]"..
|
||||
"label[0,0;Mulch:]"..
|
||||
"label[1,1;Color Mulch]"..
|
||||
"label[1,1.5;Mulch:]"..
|
||||
"list[current_name;mulch;1,2;1,1;]"..
|
||||
"label[2.5,1.5;Dye:]"..
|
||||
"list[current_name;dye;2.5,2;1,1;]"..
|
||||
"button[4,2;1,1;color;Color]"..
|
||||
"label[6,1.5;Output:]"..
|
||||
"list[current_name;res;6,2;1,1;]"..
|
||||
"label[1,3.5;Add Tan colored mulch and dye to make colored mulch]"..
|
||||
"list[current_player;main;1,5;8,4;]")
|
||||
meta:set_string("infotext", "Siding Machine")
|
||||
local inv = meta:get_inventory()
|
||||
inv:set_size("mulch", 1)
|
||||
inv:set_size("dye", 1)
|
||||
inv:set_size("res", 1)
|
||||
end,
|
||||
|
||||
on_receive_fields = function(pos, formname, fields, sender)
|
||||
local meta = minetest.env:get_meta(pos)
|
||||
local inv = meta:get_inventory()
|
||||
|
||||
if fields["color"]
|
||||
then
|
||||
|
||||
if fields["color"] then
|
||||
make_ok = "0"
|
||||
anzahl = "1"
|
||||
shape = "mymulch:mulch_"
|
||||
if inv:is_empty("mulch") or
|
||||
inv:is_empty("dye") then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
local ingotstack = inv:get_stack("mulch", 1)
|
||||
local ingotstack2 = inv:get_stack("dye", 1)
|
||||
local resstack = inv:get_stack("res", 1)
|
||||
local mulch_color = mat
|
||||
|
||||
----------------------------------------------------------------------
|
||||
if ingotstack:get_name()=="mymulch:mulch_tan" and
|
||||
ingotstack2:get_name()=="dye:black" then
|
||||
material = "black"
|
||||
make_ok = "1"
|
||||
end
|
||||
|
||||
if ingotstack:get_name()=="default:desert_sand" then
|
||||
material = "default_desert_sand"
|
||||
if ingotstack:get_name()=="mymulch:mulch_tan" and
|
||||
ingotstack2:get_name()=="dye:blue" then
|
||||
material = "blue"
|
||||
make_ok = "1"
|
||||
end
|
||||
|
||||
if ingotstack:get_name()=="default:clay" then
|
||||
material = "default_clay"
|
||||
if ingotstack:get_name()=="mymulch:mulch_tan" and
|
||||
ingotstack2:get_name()=="dye:brown" then
|
||||
material = "brown"
|
||||
make_ok = "1"
|
||||
end
|
||||
|
||||
if ingotstack:get_name()=="wool:white" then
|
||||
material = "millwork_white"
|
||||
if ingotstack:get_name()=="mymulch:mulch_tan" and
|
||||
ingotstack2:get_name()=="dye:cyan" then
|
||||
material = "cyan"
|
||||
make_ok = "1"
|
||||
end
|
||||
|
||||
if ingotstack:get_name()=="default:desert_stone" then
|
||||
material = "default_desert_stone"
|
||||
if ingotstack:get_name()=="mymulch:mulch_tan" and
|
||||
ingotstack2:get_name()=="dye:dark_green" then
|
||||
material = "dark_green"
|
||||
make_ok = "1"
|
||||
end
|
||||
|
||||
if ingotstack:get_name()=="default:cobble" then
|
||||
material = "default_cobble"
|
||||
if ingotstack:get_name()=="mymulch:mulch_tan" and
|
||||
ingotstack2:get_name()=="dye:dark_grey" then
|
||||
material = "dark_grey"
|
||||
make_ok = "1"
|
||||
end
|
||||
|
||||
if ingotstack:get_name()=="default:stone" then
|
||||
material = "default_stone"
|
||||
if ingotstack:get_name()=="mymulch:mulch_tan" and
|
||||
ingotstack2:get_name()=="dye:green" then
|
||||
material = "green"
|
||||
make_ok = "1"
|
||||
end
|
||||
|
||||
if ingotstack:get_name()=="default:cactus" then
|
||||
material = "default_cactus"
|
||||
if ingotstack:get_name()=="mymulch:mulch_tan" and
|
||||
ingotstack2:get_name()=="dye:grey" then
|
||||
material = "grey"
|
||||
make_ok = "1"
|
||||
end
|
||||
|
||||
if ingotstack:get_name()=="wool:white" then
|
||||
material = "millwork_white"
|
||||
if ingotstack:get_name()=="mymulch:mulch_tan" and
|
||||
ingotstack2:get_name()=="dye:magenta" then
|
||||
material = "magenta"
|
||||
make_ok = "1"
|
||||
end
|
||||
|
||||
if ingotstack:get_name()=="default:sand" then
|
||||
material = "default_sand"
|
||||
if ingotstack:get_name()=="mymulch:mulch_tan" and
|
||||
ingotstack2:get_name()=="dye:orange" then
|
||||
material = "orange"
|
||||
make_ok = "1"
|
||||
end
|
||||
|
||||
if ingotstack:get_name()=="default:wood" then
|
||||
material = "default_wood"
|
||||
if ingotstack:get_name()=="mymulch:mulch_tan" and
|
||||
ingotstack2:get_name()=="dye:pink" then
|
||||
material = "pink"
|
||||
make_ok = "1"
|
||||
end
|
||||
|
||||
if ingotstack:get_name()=="default:pinewood" then
|
||||
material = "default_pinewood"
|
||||
if ingotstack:get_name()=="mymulch:mulch_tan" and
|
||||
ingotstack2:get_name()=="dye:red" then
|
||||
material = "red"
|
||||
make_ok = "1"
|
||||
end
|
||||
|
||||
if ingotstack:get_name()=="default:dirt" then
|
||||
material = "default_dirt"
|
||||
if ingotstack:get_name()=="mymulch:mulch_tan" and
|
||||
ingotstack2:get_name()=="dye:violet" then
|
||||
material = "violet"
|
||||
make_ok = "1"
|
||||
end
|
||||
|
||||
if ingotstack:get_name()=="mymulch:mulch_tan" and
|
||||
ingotstack2:get_name()=="dye:white" then
|
||||
material = "white"
|
||||
make_ok = "1"
|
||||
end
|
||||
|
||||
if ingotstack:get_name()=="mymulch:mulch_tan" and
|
||||
ingotstack2:get_name()=="dye:yellow" then
|
||||
material = "yellow"
|
||||
make_ok = "1"
|
||||
end
|
||||
----------------------------------------------------------------------
|
||||
@ -188,22 +390,34 @@ then
|
||||
give[i+1]=inv:add_item("res",shape..material)
|
||||
end
|
||||
ingotstack:take_item()
|
||||
inv:set_stack("ingot",1,ingotstack)
|
||||
end
|
||||
inv:set_stack("mulch",1,ingotstack)
|
||||
ingotstack2:take_item()
|
||||
inv:set_stack("dye",1,ingotstack2)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
})
|
||||
|
||||
--Craft
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'mybricks:machine',
|
||||
output = 'mymulch:machine',
|
||||
recipe = {
|
||||
{'default:brick', 'default:brick', 'default:brick'},
|
||||
{'default:brick', 'default:steel_ingot', 'default:brick'},
|
||||
{'default:brick', "default:brick", 'default:brick'},
|
||||
{'group:leaves', 'group:wood', 'group:leaves'},
|
||||
{'group:wood', 'default:apple', 'group:wood'},
|
||||
{'group:leaves', "group:wood", 'group:leaves'},
|
||||
},
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = 'mymulch:machine_dye',
|
||||
recipe = {
|
||||
{'group:leaves', 'group:wood', 'group:leaves'},
|
||||
{'group:wood', 'bucket:bucket_empty', 'group:wood'},
|
||||
{'group:leaves', "group:wood", 'group:leaves'},
|
||||
},
|
||||
})
|
||||
|
||||
@ -218,4 +432,3 @@ minetest.register_craft({
|
||||
|
||||
|
||||
|
||||
|
||||
|
126
mulch.lua
@ -1,106 +1,52 @@
|
||||
|
||||
local mulch_list = {
|
||||
{"Black" , "black"},
|
||||
{"Brown" , "brown"},
|
||||
{"Red" , "red"},
|
||||
{"Grey" , "grey"},
|
||||
-- {"Tan" , "tan"},
|
||||
{"Blue" , "blue"},
|
||||
{"Green" , "green"},
|
||||
{"Orange" , "orange"},
|
||||
{"Violet" , "violet"},
|
||||
{"Yellow" , "yellow"},
|
||||
}
|
||||
function mymulch.register_all(mat, desc, image)
|
||||
|
||||
for i in ipairs(mulch_list) do
|
||||
local desc = mulch_list [i][1]
|
||||
local col = mulch_list [i][2]
|
||||
|
||||
|
||||
minetest.register_node("mymulch:mulch_"..col, {
|
||||
description = "Mulch "..desc,
|
||||
tiles = {"mymulch_"..col..".png"},
|
||||
minetest.register_node("mymulch:mulch_"..mat, {
|
||||
description = desc.." Mulch",
|
||||
drawtype = "normal",
|
||||
tiles = {
|
||||
image
|
||||
},
|
||||
paramtype = "light",
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=3, falling_node=1, soil=1, falling_node=1},
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = true,
|
||||
groups = {crumbly = 2, falling_node=1, not_in_creative_inventory=1, soil=1},
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_gravel_footstep", gain=0.5},
|
||||
dug = {name="default_gravel_footstep", gain=1.0},
|
||||
}),
|
||||
})
|
||||
|
||||
minetest.register_node("mymulch:mulch_tan", {
|
||||
description = "Mulch Tan",
|
||||
tiles = {"mymulch_tan.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=3, falling_node=1, soil=1, falling_node=1},
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_gravel_footstep", gain=0.5},
|
||||
dug = {name="default_gravel_footstep", gain=1.0},
|
||||
}),
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = "default:dirt",
|
||||
recipe = {{"mymulch:mulch_"..col, "mymulch:mulch_"..col, "mymulch:mulch_"..col}}
|
||||
})
|
||||
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mymulch:mulch_"..col.." 1",
|
||||
recipe = {
|
||||
{"mymulch:mulch_tan", "dye:"..col.."", ""},
|
||||
{"", "", ""},
|
||||
{"", "", ""}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mymulch:mulch_tan",
|
||||
recipe = {
|
||||
{"group:leaves", "group:leaves", "group:leaves"},
|
||||
{"group:leaves", "group:leaves", "group:leaves"},
|
||||
{"group:leaves", "group:leaves", "group:leaves"},
|
||||
}
|
||||
minetest.register_node("mymulch:mulch_tan", {
|
||||
description = "Mulch Tan",
|
||||
drawtype = "normal",
|
||||
tiles = {"mymulch_tan.png"},
|
||||
paramtype = "light",
|
||||
is_ground_content = true,
|
||||
sunlight_propagates = true,
|
||||
groups = {crumbly=3, falling_node=1, soil=1, not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_gravel_footstep", gain=0.5},
|
||||
dug = {name="default_gravel_footstep", gain=1.0},
|
||||
}),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mymulch:mulch_tan",
|
||||
recipe = {
|
||||
{"group:stick", "group:stick", "group:stick"},
|
||||
{"group:stick", "group:stick", "group:stick"},
|
||||
{"group:stick", "group:stick", "group:stick"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mymulch:mulch_tan",
|
||||
recipe = {
|
||||
{"group:flora", "group:flora", "group:flora"},
|
||||
{"group:flora", "group:flora", "group:flora"},
|
||||
{"group:flora", "group:flora", "group:flora"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mymulch:mulch_tan",
|
||||
recipe = {
|
||||
{"group:flower", "group:flower", "group:flower"},
|
||||
{"group:flower", "group:flower", "group:flower"},
|
||||
{"group:flower", "group:flower", "group:flower"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mymulch:mulch_tan 1",
|
||||
recipe = {
|
||||
{"default:dry_shrub", "default:dry_shrub", "default:dry_shrub"},
|
||||
{"default:dry_shrub", "default:dry_shrub", "default:dry_shrub"},
|
||||
{"default:dry_shrub", "default:dry_shrub", "default:dry_shrub"},
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
144
register.lua
@ -1,81 +1,93 @@
|
||||
|
||||
mybricks.register_all(--material, description, image, groups, craft item
|
||||
"default_sandstone",
|
||||
"Sandstone",
|
||||
"default_sandstone.png",
|
||||
"{cracky = 1, oddly_breakable_by_hand = 1, not_in_creative_inventory=1}",
|
||||
"default:sandstone"
|
||||
mymulch.register_all(--material, description, image
|
||||
"black",
|
||||
"Black",
|
||||
"mymulch_black.png"
|
||||
)
|
||||
|
||||
mybricks.register_all(--material, description, image, groups, craft item
|
||||
"default_desert_sand",
|
||||
"Desert Sand",
|
||||
"default_desert_sand.png",
|
||||
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
|
||||
"default:desert_sand"
|
||||
mymulch.register_all(--material, description, image
|
||||
"blue",
|
||||
"Blue",
|
||||
"mymulch_blue.png"
|
||||
)
|
||||
mybricks.register_all(--material, description, image, groups, craft item
|
||||
"default_clay",
|
||||
"Clay",
|
||||
"default_clay.png",
|
||||
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
|
||||
"default:clay"
|
||||
|
||||
mymulch.register_all(--material, description, image
|
||||
"brown",
|
||||
"Brown",
|
||||
"mymulch_brown.png"
|
||||
)
|
||||
mybricks.register_all(--material, description, image, groups, craft item
|
||||
"default_cobble",
|
||||
"Cobble",
|
||||
"default_cobble.png",
|
||||
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
|
||||
"default:cobble"
|
||||
|
||||
mymulch.register_all(--material, description, image
|
||||
"cyan",
|
||||
"Cyan",
|
||||
"mymulch_cyan.png"
|
||||
)
|
||||
mybricks.register_all(--material, description, image, groups, craft item
|
||||
"default_stone",
|
||||
"Stone",
|
||||
"default_stone.png",
|
||||
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
|
||||
"default:stone"
|
||||
|
||||
mymulch.register_all(--material, description, image
|
||||
"dark_green",
|
||||
"Dark Green",
|
||||
"mymulch_dark_green.png"
|
||||
)
|
||||
mybricks.register_all(--material, description, image, groups, craft item
|
||||
"default_cactus",
|
||||
"Cactus",
|
||||
"default_cactus_side.png",
|
||||
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
|
||||
"default:cactus"
|
||||
|
||||
mymulch.register_all(--material, description, image
|
||||
"dark_grey",
|
||||
"Dark Grey",
|
||||
"mymulch_dark_grey.png"
|
||||
)
|
||||
mybricks.register_all(--material, description, image, groups, craft item
|
||||
"default_sand",
|
||||
"Sand",
|
||||
"default_sand.png",
|
||||
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
|
||||
"default:sand"
|
||||
|
||||
mymulch.register_all(--material, description, image
|
||||
"green",
|
||||
"Green",
|
||||
"mymulch_green.png"
|
||||
)
|
||||
mybricks.register_all(--material, description, image, groups, craft item
|
||||
"default_desert_stone",
|
||||
"Desert Stone",
|
||||
"default_desert_stone.png",
|
||||
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
|
||||
"default:desert_stone"
|
||||
|
||||
mymulch.register_all(--material, description, image
|
||||
"grey",
|
||||
"Grey",
|
||||
"mymulch_grey.png"
|
||||
)
|
||||
mybricks.register_all(--material, description, image, groups, craft item
|
||||
"default_wood",
|
||||
"Wood",
|
||||
"default_wood.png",
|
||||
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
|
||||
"default:wood"
|
||||
|
||||
mymulch.register_all(--material, description, image
|
||||
"magenta",
|
||||
"Magenta",
|
||||
"mymulch_magenta.png"
|
||||
)
|
||||
mybricks.register_all(--material, description, image, groups, craft item
|
||||
"default_pinewood",
|
||||
"Pine Wood",
|
||||
"default_pinewood.png",
|
||||
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
|
||||
"default:pinewood"
|
||||
|
||||
mymulch.register_all(--material, description, image
|
||||
"orange",
|
||||
"Orange",
|
||||
"mymulch_orange.png"
|
||||
)
|
||||
mybricks.register_all(--material, description, image, groups, craft item
|
||||
"default_dirt",
|
||||
"Dirt",
|
||||
"default_dirt.png",
|
||||
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
|
||||
"default:dirt"
|
||||
|
||||
mymulch.register_all(--material, description, image
|
||||
"pink",
|
||||
"Pink",
|
||||
"mymulch_pink.png"
|
||||
)
|
||||
|
||||
mymulch.register_all(--material, description, image
|
||||
"red",
|
||||
"Red",
|
||||
"mymulch_red.png"
|
||||
)
|
||||
|
||||
mymulch.register_all(--material, description, image
|
||||
"violet",
|
||||
"Violet",
|
||||
"mymulch_violet.png"
|
||||
)
|
||||
|
||||
mymulch.register_all(--material, description, image
|
||||
"white",
|
||||
"White",
|
||||
"mymulch_white.png"
|
||||
)
|
||||
|
||||
mymulch.register_all(--material, description, image
|
||||
"yellow",
|
||||
"Yellow",
|
||||
"mymulch_yellow.png"
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
BIN
textures/mymulch_cyan.png
Normal file
After Width: | Height: | Size: 724 B |
BIN
textures/mymulch_dark_green.png
Normal file
After Width: | Height: | Size: 614 B |
BIN
textures/mymulch_dark_grey.png
Normal file
After Width: | Height: | Size: 698 B |
BIN
textures/mymulch_machine.png
Normal file
After Width: | Height: | Size: 398 B |
BIN
textures/mymulch_machine_side.png
Normal file
After Width: | Height: | Size: 377 B |
BIN
textures/mymulch_machine_top.png
Normal file
After Width: | Height: | Size: 324 B |
BIN
textures/mymulch_magenta.png
Normal file
After Width: | Height: | Size: 726 B |
BIN
textures/mymulch_pink.png
Normal file
After Width: | Height: | Size: 899 B |
BIN
textures/mymulch_white.png
Normal file
After Width: | Height: | Size: 446 B |
BIN
textures/mysiding_background.png
Normal file
After Width: | Height: | Size: 2.0 KiB |