diff --git a/mods/default/craftitems.lua b/mods/default/craftitems.lua index 0a90df3..108cdb9 100644 --- a/mods/default/craftitems.lua +++ b/mods/default/craftitems.lua @@ -1,3 +1,4 @@ +-- string minetest.register_node("default:string", { description = "String", tiles = {"default_string_top.png", "default_string_top.png", "default_string.png"}, @@ -36,10 +37,33 @@ minetest.register_node("default:string_strong", { on_place = minetest.rotate_and_place, }) +-- dye + +default.register_dye = function(color, description, recipe) + minetest.register_craftitem("default:dye_" .. color, { + description = description, + inventory_image = "default_dye.png^[colorize:"..color..":150", + }) + + minetest.register_craft({ + type = "shapeless", + output = "default:dye_" .. color .. " 2", + recipe = recipe, + }) +end + +default.register_dye("white", "White Dye", {"default:snow"}) +default.register_dye("black", "Black Dye", {"default:coal_dust"}) +default.register_dye("purple", "Purple Dye", {"default:flower_1"}) +default.register_dye("green", "Green Dye", {"group:grass"}) +default.register_dye("yellow", "Yellow Dye", {"default:flower_2"}) +default.register_dye("red", "Red Dye", {"default:flower_3"}) + +-- other minetest.register_craftitem("default:stone_item", { description = "Stone", inventory_image = "default_stone_item.png", - stack_max = 99*9, + stack_max = 999, }) minetest.register_craftitem("default:flint", { @@ -77,8 +101,6 @@ minetest.register_craftitem("default:twig", { inventory_image = "default_twig.png", }) --- blade - minetest.register_craftitem("default:blade", { description = "Blade", inventory_image = "default_blade.png", diff --git a/mods/default/nodes.lua b/mods/default/nodes.lua index affb507..d1ac80f 100644 --- a/mods/default/nodes.lua +++ b/mods/default/nodes.lua @@ -51,7 +51,7 @@ minetest.register_node("default:grass_flowers", { minetest.register_node("default:grass", { description = "Grass", tiles = {"default_grass.png"}, - groups = {crumbly = 3}, + groups = {crumbly = 3, grass = 1}, sounds = default.sounds.dirt(), drop = { max_items = 1, @@ -319,7 +319,7 @@ minetest.register_node("default:plant_grass", { inventory_image = "default_plant_grass.png", buildable_to = true, walkable = false, - groups = {crumbly = 3, plant = 1}, + groups = {crumbly = 3, plant = 1, grass = 1}, selection_box = { type = "fixed", fixed = {-0.5, -0.5, -0.5, 0.5, -0.4, 0.5}, @@ -334,7 +334,7 @@ minetest.register_node("default:plant_grass_2", { inventory_image = "default_plant_grass_2.png", buildable_to = true, walkable = false, - groups = {crumbly = 3, plant = 1}, + groups = {crumbly = 3, plant = 1, grass = 1}, drop = "default:plant_grass", selection_box = { type = "fixed", @@ -350,7 +350,7 @@ minetest.register_node("default:plant_grass_3", { inventory_image = "default_plant_grass_3.png", buildable_to = true, walkable = false, - groups = {crumbly = 3, plant = 1}, + groups = {crumbly = 3, plant = 1, grass = 1}, drop = "default:plant_grass", selection_box = { type = "fixed", @@ -366,7 +366,7 @@ minetest.register_node("default:plant_grass_4", { inventory_image = "default_plant_grass_4.png", buildable_to = true, walkable = false, - groups = {crumbly = 3, plant = 1}, + groups = {crumbly = 3, plant = 1, grass = 1}, drop = "default:plant_grass", selection_box = { type = "fixed", @@ -406,7 +406,7 @@ minetest.register_node("default:flower_1", { }) minetest.register_node("default:flower_2", { - description = "Flower (glowing)", + description = "Yellow Flower", tiles = {"default_flower_2.png"}, drawtype = "plantlike", paramtype = "light", @@ -421,6 +421,21 @@ minetest.register_node("default:flower_2", { }, }) +minetest.register_node("default:flower_3", { + description = "Red Flower", + tiles = {"default_flower_3.png"}, + drawtype = "plantlike", + paramtype = "light", + inventory_image = "default_flower_3.png", + buildable_to = true, + walkable = false, + groups = {crumbly = 3, plant = 1}, + selection_box = { + type = "fixed", + fixed = {-0.5, -0.5, -0.5, 0.5, -0.4, 0.5}, + }, +}) + minetest.register_node("default:mushroom", { description = "Mushroom", tiles = {"default_mushroom.png"}, @@ -500,12 +515,19 @@ minetest.register_node("default:glass", { }) -- wool - default.register_wool = function(color) minetest.register_node("default:wool_"..color, { description = color.." Wool", tiles = {"default_wool.png^[colorize:"..color..":150"}, - groups = {crumbly=3}, + groups = {crumbly=3, wool = 1}, + }) + + minetest.register_craft({ + type = "shapeless", + output = "default:wool_"..color, + recipe = { + "group:wool", "default:dye_" .. color + }, }) end diff --git a/mods/default/textures/default_dye.png b/mods/default/textures/default_dye.png new file mode 100644 index 0000000..537f596 Binary files /dev/null and b/mods/default/textures/default_dye.png differ diff --git a/mods/default/textures/default_flower_3.png b/mods/default/textures/default_flower_3.png new file mode 100644 index 0000000..f33d896 Binary files /dev/null and b/mods/default/textures/default_flower_3.png differ diff --git a/mods/places/init.lua b/mods/places/init.lua index 4e92ba7..f626c9d 100644 --- a/mods/places/init.lua +++ b/mods/places/init.lua @@ -52,7 +52,7 @@ minetest.register_chatcommand("add_place", { end, }) -minetest.register_chatcommand("goto_place", { +minetest.register_chatcommand("goto", { params = "", description = "Goto a place", privs = {}, @@ -70,6 +70,24 @@ minetest.register_chatcommand("goto_place", { end, }) +minetest.register_chatcommand("list_places", { + params = "", + description = "Shows a list of all places", + privs = {server=true}, + func = function(name, text) + if not(places.pos) then + return false, "Error" + end + + local my_places = {} + for name, pos in pairs(places.pos) do + table.insert(my_places, name) + end + + return true, table.concat(my_places, ", ") + end, +}) + minetest.register_on_joinplayer(function(player) if not places.show_places then return