diff --git a/rtmmp/mods/cotton_blocks/depends.txt b/rtmmp/mods/cotton_blocks/depends.txt new file mode 100644 index 0000000..3a76222 --- /dev/null +++ b/rtmmp/mods/cotton_blocks/depends.txt @@ -0,0 +1,2 @@ +dye +flowers diff --git a/rtmmp/mods/cotton_blocks/init.lua b/rtmmp/mods/cotton_blocks/init.lua new file mode 100644 index 0000000..2ad83e4 --- /dev/null +++ b/rtmmp/mods/cotton_blocks/init.lua @@ -0,0 +1,116 @@ + +local CB_NAMES_COLORS = { + ["white"] = "White cotton block", + ["light_gray"] = "Light-gray cotton block", + ["gray"] = "Gray cotton block", + ["black"] = "Black cotton block", + ["red"] = "Red cotton block", + ["orange"] = "Orange cotton block", + ["yellow"] = "Yellow cotton block", + ["lime"] = "Lime cotton block", + ["green"] = "Green cotton block", + ["light_blue"] = "Light-blue cotton block", + ["cyan"] = "Cyan cotton block", + ["blue"] = "Blue cotton block", + ["purple"] = "Purple cotton block", + ["magenta"] = "Magenta cotton block", + ["pink"] = "Pink cotton block", + ["brown"] = "Brown cotton block", +} + +function default.node_sound_cotton_defaults(table) + table = table or {} + table.footstep = table.footstep or + {name="cotton_blocks_cotton_step", gain=0.25} + table.dig = table.dig or + {name="cotton_blocks_cotton_step", gain=0.6} + table.dug = table.dug or + {name="", gain=1.0} + default.node_sound_defaults(table) + return table +end + +minetest.register_craft({ + output = 'cotton_blocks:white', + recipe = { + {'flowers:cotton','flowers:cotton'}, + {'flowers:cotton','flowers:cotton'}, + } +}) + +local addCBrecipe = function(new, first, second) + minetest.register_craft({ + output = new, + recipe = { + {first, "dye:" .. second}, + } + }) + + minetest.register_craft({ + output = new, + recipe = { + {"dye:".. second, "dye:" .. first}, + } + }) + + minetest.register_craft({ + output = new, + recipe = { + {first}, + {"dye:".. second}, + } + }) + + minetest.register_craft({ + output = new, + recipe = { + {"dye:".. second}, + {first}, + } + }) + + minetest.register_craft({ + output = new, + recipe = { + {"dye:".. second,""}, + {"",first}, + } + }) + + minetest.register_craft({ + output = new, + recipe = { + {first,""}, + {"","dye:".. second}, + } + }) + + minetest.register_craft({ + output = new, + recipe = { + {"","dye:".. second}, + {first,""}, + } + }) + + minetest.register_craft({ + output = new, + recipe = { + {"",first}, + {"dye:".. second,""}, + } + }) +end +for color, name in pairs(CB_NAMES_COLORS) do + minetest.register_node("cotton_blocks:" .. color, { + description = name, + tile_images = {"cb_" .. color .. ".png"}, + inventory_image = minetest.inventorycube("cb_" .. color .. ".png"), + is_ground_content = true, + groups = {snappy=3, cotton=1}, + sounds = default.node_sound_cotton_defaults(), + stack_max = 128, + }) + addCBrecipe("cotton_blocks:" .. color,"cotton_blocks:white",color) + addCBrecipe("cotton_blocks:white","cotton_blocks:" .. color,"white") +end diff --git a/rtmmp/mods/cotton_blocks/sounds/cotton_blocks_cotton_step.1.ogg b/rtmmp/mods/cotton_blocks/sounds/cotton_blocks_cotton_step.1.ogg new file mode 100644 index 0000000..0ea73f8 Binary files /dev/null and b/rtmmp/mods/cotton_blocks/sounds/cotton_blocks_cotton_step.1.ogg differ diff --git a/rtmmp/mods/cotton_blocks/sounds/cotton_blocks_cotton_step.2.ogg b/rtmmp/mods/cotton_blocks/sounds/cotton_blocks_cotton_step.2.ogg new file mode 100644 index 0000000..a607a9e Binary files /dev/null and b/rtmmp/mods/cotton_blocks/sounds/cotton_blocks_cotton_step.2.ogg differ diff --git a/rtmmp/mods/cotton_blocks/sounds/cotton_blocks_cotton_step.3.ogg b/rtmmp/mods/cotton_blocks/sounds/cotton_blocks_cotton_step.3.ogg new file mode 100644 index 0000000..64b5ef9 Binary files /dev/null and b/rtmmp/mods/cotton_blocks/sounds/cotton_blocks_cotton_step.3.ogg differ diff --git a/rtmmp/mods/cotton_blocks/sounds/cotton_blocks_cotton_step.4.ogg b/rtmmp/mods/cotton_blocks/sounds/cotton_blocks_cotton_step.4.ogg new file mode 100644 index 0000000..b65ed79 Binary files /dev/null and b/rtmmp/mods/cotton_blocks/sounds/cotton_blocks_cotton_step.4.ogg differ diff --git a/rtmmp/mods/cotton_blocks/textures/cb_black.png b/rtmmp/mods/cotton_blocks/textures/cb_black.png new file mode 100644 index 0000000..d2dbf96 Binary files /dev/null and b/rtmmp/mods/cotton_blocks/textures/cb_black.png differ diff --git a/rtmmp/mods/cotton_blocks/textures/cb_blue.png b/rtmmp/mods/cotton_blocks/textures/cb_blue.png new file mode 100644 index 0000000..cf2da3f Binary files /dev/null and b/rtmmp/mods/cotton_blocks/textures/cb_blue.png differ diff --git a/rtmmp/mods/cotton_blocks/textures/cb_brown.png b/rtmmp/mods/cotton_blocks/textures/cb_brown.png new file mode 100644 index 0000000..d4a9dd9 Binary files /dev/null and b/rtmmp/mods/cotton_blocks/textures/cb_brown.png differ diff --git a/rtmmp/mods/cotton_blocks/textures/cb_cyan.png b/rtmmp/mods/cotton_blocks/textures/cb_cyan.png new file mode 100644 index 0000000..a147f56 Binary files /dev/null and b/rtmmp/mods/cotton_blocks/textures/cb_cyan.png differ diff --git a/rtmmp/mods/cotton_blocks/textures/cb_gray.png b/rtmmp/mods/cotton_blocks/textures/cb_gray.png new file mode 100644 index 0000000..ef3a6a5 Binary files /dev/null and b/rtmmp/mods/cotton_blocks/textures/cb_gray.png differ diff --git a/rtmmp/mods/cotton_blocks/textures/cb_green.png b/rtmmp/mods/cotton_blocks/textures/cb_green.png new file mode 100644 index 0000000..8248c8f Binary files /dev/null and b/rtmmp/mods/cotton_blocks/textures/cb_green.png differ diff --git a/rtmmp/mods/cotton_blocks/textures/cb_light_blue.png b/rtmmp/mods/cotton_blocks/textures/cb_light_blue.png new file mode 100644 index 0000000..82e677f Binary files /dev/null and b/rtmmp/mods/cotton_blocks/textures/cb_light_blue.png differ diff --git a/rtmmp/mods/cotton_blocks/textures/cb_light_gray.png b/rtmmp/mods/cotton_blocks/textures/cb_light_gray.png new file mode 100644 index 0000000..5982bed Binary files /dev/null and b/rtmmp/mods/cotton_blocks/textures/cb_light_gray.png differ diff --git a/rtmmp/mods/cotton_blocks/textures/cb_lime.png b/rtmmp/mods/cotton_blocks/textures/cb_lime.png new file mode 100644 index 0000000..1c6ee3b Binary files /dev/null and b/rtmmp/mods/cotton_blocks/textures/cb_lime.png differ diff --git a/rtmmp/mods/cotton_blocks/textures/cb_magenta.png b/rtmmp/mods/cotton_blocks/textures/cb_magenta.png new file mode 100644 index 0000000..893ddbf Binary files /dev/null and b/rtmmp/mods/cotton_blocks/textures/cb_magenta.png differ diff --git a/rtmmp/mods/cotton_blocks/textures/cb_orange.png b/rtmmp/mods/cotton_blocks/textures/cb_orange.png new file mode 100644 index 0000000..99d0d1a Binary files /dev/null and b/rtmmp/mods/cotton_blocks/textures/cb_orange.png differ diff --git a/rtmmp/mods/cotton_blocks/textures/cb_pink.png b/rtmmp/mods/cotton_blocks/textures/cb_pink.png new file mode 100644 index 0000000..0c8cdf4 Binary files /dev/null and b/rtmmp/mods/cotton_blocks/textures/cb_pink.png differ diff --git a/rtmmp/mods/cotton_blocks/textures/cb_purple.png b/rtmmp/mods/cotton_blocks/textures/cb_purple.png new file mode 100644 index 0000000..12d9810 Binary files /dev/null and b/rtmmp/mods/cotton_blocks/textures/cb_purple.png differ diff --git a/rtmmp/mods/cotton_blocks/textures/cb_red.png b/rtmmp/mods/cotton_blocks/textures/cb_red.png new file mode 100644 index 0000000..43aa2f8 Binary files /dev/null and b/rtmmp/mods/cotton_blocks/textures/cb_red.png differ diff --git a/rtmmp/mods/cotton_blocks/textures/cb_white.png b/rtmmp/mods/cotton_blocks/textures/cb_white.png new file mode 100644 index 0000000..dbd70a7 Binary files /dev/null and b/rtmmp/mods/cotton_blocks/textures/cb_white.png differ diff --git a/rtmmp/mods/cotton_blocks/textures/cb_yellow.png b/rtmmp/mods/cotton_blocks/textures/cb_yellow.png new file mode 100644 index 0000000..4f1d141 Binary files /dev/null and b/rtmmp/mods/cotton_blocks/textures/cb_yellow.png differ