Added support for all default blocks

This commit is contained in:
DonBatman 2015-03-16 11:13:47 -07:00
parent 4cc90b7814
commit f2ad2fada5
3 changed files with 583 additions and 25 deletions

View File

@ -1,8 +1,34 @@
mymillwork
millwork
========
Crown Mold, Baseboards, Columns and Beams.
Crown Mold, Baseboards, Columns and more
This is a rewrite of my old millwork mod. It is not compatable. This adds a machine to make the millwork.
Latest update adds different textures to the millwork.
The machine was made using code from yves_de_beck's noncubic mod.
If you want to add or remove a texture simply edit the table at the top of millwork.lua file.
Right now I have these textures: White, Sandstone, Desert Sand and Clay. The others are commented out.
Each texture has 28 nodes so careful that you don't add too many textures.
local material = {--{Name for description}, {image without .png}, {item name}, {mod name}
{ "White", "crownmold_white","white","wool"},
-- { "Cobble", "default_cobble","cobble","default"},
{ "Sandstone", "default_sandstone","sandstone","default"},
-- { "Desert Stone", "default_desert_stone","desert_stone","default"},
-- { "Stone", "default_stone","stone","default"},
-- { "Tree", "default_tree","tree","default"},
{ "Desert Sand", "default_desert_sand","desert_sand","default"},
{ "Clay", "default_clay","clay","default"},
-- { "Dirt", "default_dirt","dirt","default"},
}

View File

@ -3,7 +3,6 @@ local shape = {}
local make_ok = {}
local anzahl = {}
--function mymillwork.register_all(mat, desc, image, groups, craft)
minetest.register_node("mymillwork:machine", {
description = "Millwork Machine",
@ -36,7 +35,6 @@ minetest.register_node("mymillwork:machine", {
}
},
-- Set owner of Millwork Machine
after_place_node = function(pos, placer)
local meta = minetest.env:get_meta(pos);
meta:set_string("owner", (placer:get_player_name() or ""));
@ -106,7 +104,6 @@ on_receive_fields = function(pos, formname, fields, sender)
local meta = minetest.env:get_meta(pos)
local inv = meta:get_inventory()
-- REGISTER MILLING PROGRAMMS
-----------------------------
if fields["crownmould"]
or fields["crownmould_ic"]
@ -361,6 +358,8 @@ then
local ingotstack = inv:get_stack("ingot", 1)
local resstack = inv:get_stack("res", 1)
----------------------------------------------------------------------
--Register Items
----------------------------------------------------------------------
if ingotstack:get_name()=="default:sandstone" then
material = "default_sandstone"
@ -426,6 +425,200 @@ then
material = "default_dirt"
make_ok = "1"
end
if ingotstack:get_name()=="default:brick" then
material = "default_brick"
make_ok = "1"
end
if ingotstack:get_name()=="default:bronzeblock" then
material = "default_bronze_block"
make_ok = "1"
end
if ingotstack:get_name()=="default:coalblock" then
material = "default_coal_block"
make_ok = "1"
end
if ingotstack:get_name()=="default:copperblock" then
material = "default_copper_block"
make_ok = "1"
end
if ingotstack:get_name()=="default:desert_cobble" then
material = "default_desert_cobble"
make_ok = "1"
end
if ingotstack:get_name()=="default:diamondblock" then
material = "default_diamond_block"
make_ok = "1"
end
if ingotstack:get_name()=="default:glass" then
material = "default_glass"
make_ok = "1"
end
if ingotstack:get_name()=="default:goldblock" then
material = "default_gold_block"
make_ok = "1"
end
if ingotstack:get_name()=="default:gravel" then
material = "default_gravel"
make_ok = "1"
end
if ingotstack:get_name()=="default:ice" then
material = "default_ice"
make_ok = "1"
end
if ingotstack:get_name()=="default:jungletree" then
material = "default_jungletree"
make_ok = "1"
end
if ingotstack:get_name()=="default:junglewood" then
material = "default_junglewood"
make_ok = "1"
end
if ingotstack:get_name()=="default:lava_source" then
material = "default_lava"
make_ok = "1"
end
if ingotstack:get_name()=="default:mese" then
material = "default_mese"
make_ok = "1"
end
if ingotstack:get_name()=="default:mossycobble" then
material = "default_mossycobble"
make_ok = "1"
end
if ingotstack:get_name()=="default:obsidian" then
material = "default_obsidian"
make_ok = "1"
end
if ingotstack:get_name()=="default:obsidian_glass" then
material = "default_obsidian_glass"
make_ok = "1"
end
if ingotstack:get_name()=="default:obsidianbrick" then
material = "default_obsidian_brick"
make_ok = "1"
end
if ingotstack:get_name()=="default:pinetree" then
material = "default_pinetree"
make_ok = "1"
end
if ingotstack:get_name()=="default:sanddstonebrick" then
material = "default_sandstone_brick"
make_ok = "1"
end
if ingotstack:get_name()=="default:snowblock" then
material = "default_snow"
make_ok = "1"
end
if ingotstack:get_name()=="default:steelblock" then
material = "default_steel_block"
make_ok = "1"
end
if ingotstack:get_name()=="default:stonebrick" then
material = "default_stone_brick"
make_ok = "1"
end
if ingotstack:get_name()=="default:tree" then
material = "default_tree"
make_ok = "1"
end
if ingotstack:get_name()=="default:water_source" then
material = "default_water"
make_ok = "1"
end
if ingotstack:get_name()=="farming:straw" then
material = "farming_straw"
make_ok = "1"
end
----------------------------------------------------------------------------
--wool
if ingotstack:get_name()=="wool:white" then
material = "wool_white"
make_ok = "1"
end
if ingotstack:get_name()=="wool:black" then
material = "wool_black"
make_ok = "1"
end
if ingotstack:get_name()=="wool:blue" then
material = "wool_blue"
make_ok = "1"
end
if ingotstack:get_name()=="wool:brown" then
material = "wool_brown"
make_ok = "1"
end
if ingotstack:get_name()=="wool:cyan" then
material = "wool_cyan"
make_ok = "1"
end
if ingotstack:get_name()=="wool:dark_green" then
material = "wool_dark_green"
make_ok = "1"
end
if ingotstack:get_name()=="wool:dark_grey" then
material = "wool_dark_grey"
make_ok = "1"
end
if ingotstack:get_name()=="wool:green" then
material = "wool_green"
make_ok = "1"
end
if ingotstack:get_name()=="wool:grey" then
material = "wool_grey"
make_ok = "1"
end
if ingotstack:get_name()=="wool:magenta" then
material = "wool_magenta"
make_ok = "1"
end
if ingotstack:get_name()=="wool:orange" then
material = "wool_orange"
make_ok = "1"
end
if ingotstack:get_name()=="wool:pink" then
material = "wool_pink"
make_ok = "1"
end
if ingotstack:get_name()=="wool:red" then
material = "wool_red"
make_ok = "1"
end
if ingotstack:get_name()=="wool:violet" then
material = "wool_violet"
make_ok = "1"
end
if ingotstack:get_name()=="wool:yellow" then
material = "wool_yellow"
make_ok = "1"
end
----------------------------------------------------------------------
if make_ok == "1" then
local give = {}

View File

@ -1,17 +1,11 @@
mymillwork.register_all(--material, description, image, groups, craft item
"millwork_white",
"White",
"millwork_white.png",
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
"wool"
)
mymillwork.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"
"default:sandstone",
"normal"
)
mymillwork.register_all(--material, description, image, groups, craft item
@ -19,70 +13,415 @@ mymillwork.register_all(--material, description, image, groups, craft item
"Desert Sand",
"default_desert_sand.png",
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
"default:desert_sand"
"default:desert_sand",
"normal"
)
mymillwork.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"
"default:clay",
"normal"
)
mymillwork.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"
"default:cobble",
"normal"
)
mymillwork.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"
"default:stone",
"normal"
)
mymillwork.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"
"default:cactus",
"normal"
)
mymillwork.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"
"default:sand",
"normal"
)
mymillwork.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"
"default:desert_stone",
"normal"
)
mymillwork.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"
"default:wood",
"normal"
)
mymillwork.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"
"default:pinewood",
"normal"
)
mymillwork.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"
"default:dirt",
"normal"
)
mymillwork.register_all(--material, description, image, groups, craft item
"default_brick",
"Brick",
"default_brick.png",
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
"default:brick",
"normal"
)
mymillwork.register_all(--material, description, image, groups, craft item
"default_bronze_block",
"Bronze Block",
"default_bronze_block.png",
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
"default:bronzeblock",
"normal"
)
mymillwork.register_all(--material, description, image, groups, craft item
"default_coal_block",
"Coal Block",
"default_coal_block.png",
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
"default:coalblock",
"normal"
)
mymillwork.register_all(--material, description, image, groups, craft item
"default_copper_block",
"Copper Block",
"default_copper_block.png",
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
"default:copperblock",
"normal"
)
mymillwork.register_all(--material, description, image, groups, craft item
"default_desert_cobble",
"Desert Cobble",
"default_desert_cobble.png",
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
"default:desert_cobble",
"normal"
)
mymillwork.register_all(--material, description, image, groups, craft item
"default_diamond_block",
"Diamond Block",
"default_diamond_block.png",
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
"default:diamondblock",
"normal"
)
mymillwork.register_all(--material, description, image, groups, craft item
"default_glass",
"Glass",
"default_glass.png",
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
"default:glass",
"glasslike"
)
mymillwork.register_all(--material, description, image, groups, craft item
"default_gold_block",
"Gold Block",
"default_gold_block.png",
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
"default:goldblock",
"normal"
)
mymillwork.register_all(--material, description, image, groups, craft item
"default_gravel",
"Gravel",
"default_gravel.png",
"{cracky = 1, falling_node=1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
"default:gravel",
"normal"
)
mymillwork.register_all(--material, description, image, groups, craft item
"default_ice",
"Ice",
"default_ice.png",
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
"default:ice",
"normal"
)
mymillwork.register_all(--material, description, image, groups, craft item
"default_jungletree",
"Jungle Tree",
"default_jungletree.png",
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
"default:jungletree",
"normal"
)
mymillwork.register_all(--material, description, image, groups, craft item
"default_junglewood",
"Jungle Wood",
"default_junglewood.png",
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
"default:junglewood",
"normal"
)
mymillwork.register_all(--material, description, image, groups, craft item
"default_lava",
"Lava",
"default_lava.png",
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
"default:lava_source",
"normal"
)
mymillwork.register_all(--material, description, image, groups, craft item
"default_mese",
"Mese",
"default_mese.png",
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
"default:mese",
"normal"
)
mymillwork.register_all(--material, description, image, groups, craft item
"default_mossycobble",
"Mossy Cobble",
"default_mossycobble.png",
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
"default:mossycobble",
"normal"
)
mymillwork.register_all(--material, description, image, groups, craft item
"default_obsidian",
"Obsidian",
"default_obsidian.png",
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
"default:obsidian",
"normal"
)
mymillwork.register_all(--material, description, image, groups, craft item, drawtype
"default_obsidian_glass",
"Obsidian Glass",
"default_obsidian_glass.png",
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
"default:obsidian_glass",
"glasslike"
)
mymillwork.register_all(--material, description, image, groups, craft item
"default_obsidian_brick",
"Obsidian Brick",
"default_obsidian_brick.png",
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
"default:obsidianbrick",
"normal"
)
mymillwork.register_all(--material, description, image, groups, craft item
"default_pinetree",
"Pine Tree",
"default_pinetree.png",
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
"default:pinetree",
"normal"
)
mymillwork.register_all(--material, description, image, groups, craft item
"default_sandstone_brick",
"Sandstone Brick",
"default_sandstone_brick.png",
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
"default:sandstonebrick",
"normal"
)
mymillwork.register_all(--material, description, image, groups, craft item
"default_snow",
"Snow",
"default_snow.png",
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
"default:snowblock",
"normal"
)
mymillwork.register_all(--material, description, image, groups, craft item
"default_steel_block",
"Steel Block",
"default_steel_block.png",
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
"default:steelblock",
"normal"
)
mymillwork.register_all(--material, description, image, groups, craft item
"default_stone_brick",
"Stone Brick",
"default_stone_brick.png",
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
"default:stonebrick",
"normal"
)
mymillwork.register_all(--material, description, image, groups, craft item
"default_tree",
"Tree",
"default_tree.png",
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
"default:tree",
"normal"
)
mymillwork.register_all(--material, description, image, groups, craft item
"default_water",
"Water",
"default_water.png",
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
"default:water_source",
"normal"
)
mymillwork.register_all(--material, description, image, groups, craft item
"farming_straw",
"Straw",
"farming_straw.png",
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
"farming:straw",
"normal"
)
-----------------------------------------------------------------------------------------------------
--wool
mymillwork.register_all(--material, description, image, groups, craft item
"wool_white",
"White Wool",
"wool_white.png",
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
"wool_white"
)
mymillwork.register_all(--material, description, image, groups, craft item
"wool_black",
"Black Wool",
"wool_black.png",
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
"wool_black"
)
mymillwork.register_all(--material, description, image, groups, craft item
"wool_blue",
"Blue Wool",
"wool_blue.png",
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
"wool_blue"
)
mymillwork.register_all(--material, description, image, groups, craft item
"wool_brown",
"Brown Wool",
"wool_brown.png",
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
"wool_brown"
)
mymillwork.register_all(--material, description, image, groups, craft item
"wool_cyan",
"Cyan Wool",
"wool_cyan.png",
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
"wool_cyan"
)
mymillwork.register_all(--material, description, image, groups, craft item
"wool_dark_green",
"Dark Green Wool",
"wool_dark_green.png",
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
"wool_dark_green"
)
mymillwork.register_all(--material, description, image, groups, craft item
"wool_dark_grey",
"Dark Grey Wool",
"wool_dark_grey.png",
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
"wool_dark_grey"
)
mymillwork.register_all(--material, description, image, groups, craft item
"wool_green",
"Green Wool",
"wool_green.png",
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
"wool_green"
)
mymillwork.register_all(--material, description, image, groups, craft item
"wool_grey",
"Grey Wool",
"wool_grey.png",
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
"wool_grey"
)
mymillwork.register_all(--material, description, image, groups, craft item
"wool_magenta",
"Magenta Wool",
"wool_magenta.png",
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
"wool_magenta"
)
mymillwork.register_all(--material, description, image, groups, craft item
"wool_orange",
"Orange Wool",
"wool_orange.png",
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
"wool_orange"
)
mymillwork.register_all(--material, description, image, groups, craft item
"wool_pink",
"Pink Wool",
"wool_pink.png",
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
"wool_pink"
)
mymillwork.register_all(--material, description, image, groups, craft item
"wool_red",
"Red Wool",
"wool_red.png",
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
"wool_red"
)
mymillwork.register_all(--material, description, image, groups, craft item
"wool_violet",
"Violet Wool",
"wool_violet.png",
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
"wool_violet"
)
mymillwork.register_all(--material, description, image, groups, craft item
"wool_yellow",
"Yellow Wool",
"wool_yellow.png",
"{cracky = 1, oddly_breakable_by_hand = 1,not_in_creative_inventory=1}",
"wool_yellow"
)