diff --git a/mods/ITEMS/mcl_amethyst/grow.lua b/mods/ITEMS/mcl_amethyst/grow.lua new file mode 100644 index 000000000..f1a23d9b7 --- /dev/null +++ b/mods/ITEMS/mcl_amethyst/grow.lua @@ -0,0 +1,52 @@ +local interval = 10 +local chance = 5 + +local function grow(pos, node) + local def = minetest.registered_nodes[node.name] + local next_gen = def._mcl_amethyst_next_grade + if not next_gen then return end + + local dir = minetest.wallmounted_to_dir(node.param2) + local ba_pos = vector.add(pos, dir) + local ba_node = minetest.get_node(ba_pos) + if ba_node.name ~= "mcl_amethyst:budding_amethyst_block" then return end + + local swap_result = table.copy(node) + swap_result.name = next_gen + minetest.swap_node(pos, swap_result) +end + +minetest.register_abm({ + label = "Amethyst Bud Growth", + nodenames = {"group:amethyst_buds"}, + neighbors = {"mcl_amethyst:budding_amethyst_block"}, + interval = interval, + chance = chance, + action = grow, +}) + +local all_directions = { + vector.new(1, 0, 0), + vector.new(0, 1, 0), + vector.new(0, 0, 1), + vector.new(-1, 0, 0), + vector.new(0, -1, 0), + vector.new(0, 0, -1), +} + +minetest.register_abm({ + label = "Spawn Amethyst Bud", + nodenames = {"mcl_amethyst:budding_amethyst_block"}, + neighbors = {"air", "group:water"}, + interval = 20, + chance = 2, + action = function(pos) + local check_pos = vector.add(all_directions[math.random(1, #all_directions)], pos) + local check_node = minetest.get_node(check_pos) + local check_node_name = check_node.name + if check_node_name ~= "air" and minetest.get_item_group(check_node_name, "water") == 0 then return end + local param2 = minetest.dir_to_wallmounted(vector.subtract(pos, check_pos)) + local new_node = {name = "mcl_amethyst:small_amethyst_bud", param2 = param2} + minetest.swap_node(check_pos, new_node) + end, +}) diff --git a/mods/ITEMS/mcl_amethyst/init.lua b/mods/ITEMS/mcl_amethyst/init.lua new file mode 100644 index 000000000..0ee78de41 --- /dev/null +++ b/mods/ITEMS/mcl_amethyst/init.lua @@ -0,0 +1,220 @@ +local S = minetest.get_translator(minetest.get_current_modname()) + +local sounds = mcl_sounds.node_sound_glass_defaults({ + footstep = {name = "mcl_amethyst_amethyst_walk", gain = 0.4}, + dug = {name = "mcl_amethyst_amethyst_break", gain = 0.44}, +}) + +-- Amethyst block +minetest.register_node("mcl_amethyst:amethyst_block",{ + description = S("Block of Amethyst"), + _doc_items_longdesc = S("The Block of Amethyst is a decoration block crafted from amethyst shards."), + tiles = {"mcl_amethyst_amethyst_block.png"}, + groups = {pickaxey = 1, building_block = 1}, + sounds = sounds, + is_ground_content = true, + _mcl_hardness = 1.5, + _mcl_blast_resistance = 1.5, +}) + +minetest.register_node("mcl_amethyst:budding_amethyst_block",{ + description = S("Budding Amethyst"), + _doc_items_longdesc = S("The Budding Amethyst can grow amethyst"), + tiles = {"mcl_amethyst_budding_amethyst.png"}, + drop = "", + groups = { + pickaxey = 1, + building_block = 1, + dig_by_piston = 1, + }, + sounds = sounds, + is_ground_content = true, + _mcl_hardness = 1.5, + _mcl_blast_resistance = 1.5, +}) + +mcl_wip.register_wip_item("mcl_amethyst:budding_amethyst_block") + +-- Amethyst Shard +minetest.register_craftitem("mcl_amethyst:amethyst_shard",{ + description = S("Amethyst Shard"), + _doc_items_longdesc = S("An amethyst shard is a crystalline mineral."), + inventory_image = "mcl_amethyst_amethyst_shard.png", + groups = {craftitem = 1}, +}) + +-- Calcite +minetest.register_node("mcl_amethyst:calcite",{ + description = S("Calcite"), + _doc_items_longdesc = S("Calcite can be found as part of amethyst geodes."), + tiles = {"mcl_amethyst_calcite_block.png"}, + groups = {pickaxey = 1, building_block = 1}, + sounds = mcl_sounds.node_sound_stone_defaults(), + is_ground_content = true, + _mcl_hardness = 0.75, + _mcl_blast_resistance = 0.75, +}) + +-- Tinied Glass +minetest.register_node("mcl_amethyst:tinted_glass",{ + description = S("Tinted Glass"), + _doc_items_longdesc = S("Tinted Glass is a type of glass which blocks lights while it is visually transparent."), + tiles = {"mcl_amethyst_tinted_glass.png"}, + _mcl_hardness = 0.3, + _mcl_blast_resistance = 0.3, + drawtype = "glasslike", + use_texture_alpha = "blend", + sunlight_propagates = false, + groups = {handy = 1, building_block = 1, deco_block = 1}, + sounds = mcl_sounds.node_sound_glass_defaults(), + is_ground_content = false, +}) + +-- Amethyst Cluster +local bud_def = { + { + size = "small", + description = S("Small Amethyst Bud"), + long_desc = S("Small Amethyst Bud is the first growth of amethyst bud."), + light_source = 3, + next_stage = "mcl_amethyst:medium_amethyst_bud", + selection_box = { -4/16, -7/16, -4/16, 4/16, -3/16, 4/16 }, + }, + { + size = "medium", + description = S("Medium Amethyst Bud"), + long_desc = S("Medium Amethyst Bud is the second growth of amethyst bud."), + light_source = 4, + next_stage = "mcl_amethyst:large_amethyst_bud", + selection_box = { -4.5/16, -8/16, -4.5/16, 4.5/16, -2/16, 4.5/16 }, + }, + { + size = "large", + description = S("Large Amethyst Bud"), + long_desc = S("Large Amethyst Bud is the third growth of amethyst bud."), + light_source = 5, + next_stage = "mcl_amethyst:amethyst_cluster", + selection_box = { -4.5/16, -8/16, -4.5/16, 4.5/16, -1/16, 4.5/16 }, + }, +} + +for _, def in pairs(bud_def) do + local size = def.size + local name = "mcl_amethyst:" .. size .. "_amethyst_bud" + local tile = "mcl_amethyst_amethyst_bud_" .. size .. ".png" + local inventory_image = "mcl_amethyst_amethyst_bud_" .. size .. ".png" + minetest.register_node(name, { + description = def.description, + _doc_items_longdesc = def.longdesc, + drop = "", + tiles = {tile}, + inventory_image = inventory_image, + paramtype1 = "light", + paramtype2 = "wallmounted", + drawtype = "plantlike", + use_texture_alpha = "clip", + sunlight_propagates = true, + walkable = false, + light_source = def.light_source, + groups = { + dig_by_water = 1, + destroy_by_lava_flow = 1, + dig_by_piston = 1, + pickaxey = 1, + deco_block = 1, + amethyst_buds = 1, + attached_node = 1, + }, + sounds = sounds, + selection_box = { + type = "fixed", + fixed = def.selection_box + }, + _mcl_hardness = 1.5, + _mcl_blast_resistance = 1.5, + _mcl_silk_touch_drop = true, + _mcl_amethyst_next_grade = def.next_stage, + }) +end + +minetest.register_node("mcl_amethyst:amethyst_cluster",{ + description = S("Amethyst Cluster"), + _doc_items_longdesc = S("Amethyst Cluster is the final growth of amethyst bud."), + drop = { + max_items = 1, + items = { + { + tools = {"~mcl_tools:pick_"}, + items = {"mcl_amethyst:amethyst_shard 4"}, + }, + { + items = {"mcl_amethyst:amethyst_shard 2"}, + }, + } + }, + tiles = {"mcl_amethyst_amethyst_cluster.png",}, + inventory_image = "mcl_amethyst_amethyst_cluster.png", + paramtype2 = "wallmounted", + drawtype = "plantlike", + paramtype1 = "light", + use_texture_alpha = "clip", + sunlight_propagates = true, + walkable = false, + light_source = 7, + groups = { + dig_by_water = 1, + destroy_by_lava_flow = 1, + dig_by_piston = 1, + pickaxey = 1, + deco_block = 1, + attached_node = 1, + }, + sounds = sounds, + selection_box = { + type = "fixed", + fixed = { -4.8/16, -8/16, -4.8/16, 4.8/16, 3.9/16, 4.8/16 }, + }, + _mcl_hardness = 1.5, + _mcl_blast_resistance = 1.5, + _mcl_silk_touch_drop = true, +}) + +-- Register Crafts +minetest.register_craft({ + output = "mcl_amethyst:amethyst_block", + recipe = { + {"mcl_amethyst:amethyst_shard", "mcl_amethyst:amethyst_shard"}, + {"mcl_amethyst:amethyst_shard", "mcl_amethyst:amethyst_shard"}, + }, +}) + +minetest.register_craft({ + output = "mcl_amethyst:tinted_glass 2", + recipe = { + {"", "mcl_amethyst:amethyst_shard", ""}, + {"mcl_amethyst:amethyst_shard", "mcl_core:glass", "mcl_amethyst:amethyst_shard",}, + {"", "mcl_amethyst:amethyst_shard", ""}, + }, +}) + +if minetest.get_modpath("mcl_spyglass") then + minetest.clear_craft({output = "mcl_spyglass:spyglass",}) + local function craft_spyglass(ingot) + minetest.register_craft({ + output = "mcl_spyglass:spyglass", + recipe = { + {"mcl_amethyst:amethyst_shard"}, + {ingot}, + {ingot}, + } + }) + end + if minetest.get_modpath("mcl_copper") then + craft_spyglass("mcl_copper:copper_ingot") + else + craft_spyglass("mcl_core:iron_ingot") + end +end + +-- Amethyst Growing +dofile(minetest.get_modpath(minetest.get_current_modname()) .. "/grow.lua") diff --git a/mods/ITEMS/mcl_amethyst/locale/mcl_amethyst.fr.tr b/mods/ITEMS/mcl_amethyst/locale/mcl_amethyst.fr.tr new file mode 100644 index 000000000..fbdab48f4 --- /dev/null +++ b/mods/ITEMS/mcl_amethyst/locale/mcl_amethyst.fr.tr @@ -0,0 +1,19 @@ +# textdomain: mcl_amethyst +Amethyst Cluster=Agrégat d'améthyste +Amethyst Cluster is the final growth of amethyst bud.=L'agrégat d'améthyste est le stade final de la croissance du bourgeon d'améthyste. +Amethyst Shard=Éclat d'améthyste +An amethyst shard is a crystalline mineral.=Un éclat d'améthyste est un minéral cristallin. +Block of Amethyst=Bloc d'améthyste +Budding Amethyst=Améthyste bourgeonante +Calcite=Calcite +Calcite can be found as part of amethyst geodes.=La calcite peut être trouvée dans les géodes d'améthyste. +Large Amethyst Bud=Grand bourgeon d'améthyste +Large Amethyst Bud is the third growth of amethyst bud.=Le grand bourgeon d'améthyste est le troisième stade de la croissance du bourgeon d'améthyste. +Medium Amethyst Bud=Bourgeon d'améthyste moyen +Medium Amethyst Bud is the second growth of amethyst bud.=Le bourgeon d'améthyste moyen est le deuxième stade de la croissance du bourgeon d'améthyste. +Small Amethyst Bud=Petit bourgeon d'améthyste +Small Amethyst Bud is the first growth of amethyst bud.=Le petit bourgeon d'améthyste est le premier stade de la croissance du bourgeon d'améthyste. +The Block of Amethyst is a decoration block crafted from amethyst shards.=Le bloc d'améthyste est un bloc décoratif fabriqué à partir d'éclats d'améthyste. +The Budding Amethyst can grow amethyst=L'améthyste bourgeonante peut faire croître de l'améthyste. +Tinted Glass=Verre teinté +Tinted Glass is a type of glass which blocks lights while it is visually transparent.=Le verre teinté est un type de verre qui bloque la lumière tout en étant visuellement transparent. diff --git a/mods/ITEMS/mcl_amethyst/locale/mcl_amethyst.ru.tr b/mods/ITEMS/mcl_amethyst/locale/mcl_amethyst.ru.tr new file mode 100644 index 000000000..9f1d0f572 --- /dev/null +++ b/mods/ITEMS/mcl_amethyst/locale/mcl_amethyst.ru.tr @@ -0,0 +1,19 @@ +# textdomain: mcl_amethyst +Amethyst Cluster=Аметистовая друза +Amethyst Cluster is the final growth of amethyst bud.=Аметистовая друза - это последняя 4-я стадия роста аметистового бутона. +Amethyst Shard=Осколок аметиста +An amethyst shard is a crystalline mineral.=Осколок аметиста - это кристаллический минерал, получаемый в результате разрушения кластеров аметиста. +Block of Amethyst=Аметистовый блок +Budding Amethyst=Растущий аметист +Calcite=Кальцит +Calcite can be found as part of amethyst geodes.=Кальцит можно найти в составе аметистовых жеод. +Large Amethyst Bud=Большой росток аметиста +Large Amethyst Bud is the third growth of amethyst bud.=Большой росток - третья стадия роста аметиста. +Medium Amethyst Bud=Средний росток аметиста +Medium Amethyst Bud is the second growth of amethyst bud.=Средний росток - вторая стадия роста аметиста. +Small Amethyst Bud=Маленький росток аметиста +Small Amethyst Bud is the first growth of amethyst bud.=Маленький росток - первая стадия роста аметиста. +The Block of Amethyst is a decoration block crafted from amethyst shards.=Блок аметиста - декоративный блок, скрафченный из осколков аметиста. +The Budding Amethyst can grow amethyst=Растущий аметист может вырастить аметист +Tinted Glass=Тонированное стекло +Tinted Glass is a type of glass which blocks lights while it is visually transparent.=Тонированное стекло блокирует свет, но визуально прозрачно. diff --git a/mods/ITEMS/mcl_amethyst/locale/template.txt b/mods/ITEMS/mcl_amethyst/locale/template.txt new file mode 100644 index 000000000..7f23e9965 --- /dev/null +++ b/mods/ITEMS/mcl_amethyst/locale/template.txt @@ -0,0 +1,19 @@ +# textdomain: mcl_amethyst +Amethyst Cluster= +Amethyst Cluster is the final growth of amethyst bud.= +Amethyst Shard= +An amethyst shard is a crystalline mineral.= +Block of Amethyst= +Budding Amethyst= +Calcite= +Calcite can be found as part of amethyst geodes.= +Large Amethyst Bud= +Large Amethyst Bud is the third growth of amethyst bud.= +Medium Amethyst Bud= +Medium Amethyst Bud is the second growth of amethyst bud.= +Small Amethyst Bud= +Small Amethyst Bud is the first growth of amethyst bud.= +The Block of Amethyst is a decoration block crafted from amethyst shards.= +The Budding Amethyst can grow amethyst= +Tinted Glass= +Tinted Glass is a type of glass which blocks lights while it is visually transparent.= diff --git a/mods/ITEMS/mcl_amethyst/mod.conf b/mods/ITEMS/mcl_amethyst/mod.conf new file mode 100644 index 000000000..97ed6ae99 --- /dev/null +++ b/mods/ITEMS/mcl_amethyst/mod.conf @@ -0,0 +1,5 @@ +name = mcl_amethyst +author = Emojiminetest, kay27 +description = Amethyst related stuff +depends = mcl_init, mcl_core, mcl_wip +optional_depends = mcl_spyglass, mcl_copper diff --git a/mods/ITEMS/mcl_amethyst/sounds/mcl_amethyst_amethyst_break.1.ogg b/mods/ITEMS/mcl_amethyst/sounds/mcl_amethyst_amethyst_break.1.ogg new file mode 100644 index 000000000..a2208012c Binary files /dev/null and b/mods/ITEMS/mcl_amethyst/sounds/mcl_amethyst_amethyst_break.1.ogg differ diff --git a/mods/ITEMS/mcl_amethyst/sounds/mcl_amethyst_amethyst_break.2.ogg b/mods/ITEMS/mcl_amethyst/sounds/mcl_amethyst_amethyst_break.2.ogg new file mode 100644 index 000000000..a3903550c Binary files /dev/null and b/mods/ITEMS/mcl_amethyst/sounds/mcl_amethyst_amethyst_break.2.ogg differ diff --git a/mods/ITEMS/mcl_amethyst/sounds/mcl_amethyst_amethyst_break.3.ogg b/mods/ITEMS/mcl_amethyst/sounds/mcl_amethyst_amethyst_break.3.ogg new file mode 100644 index 000000000..9cc81e20f Binary files /dev/null and b/mods/ITEMS/mcl_amethyst/sounds/mcl_amethyst_amethyst_break.3.ogg differ diff --git a/mods/ITEMS/mcl_amethyst/sounds/mcl_amethyst_amethyst_walk.1.ogg b/mods/ITEMS/mcl_amethyst/sounds/mcl_amethyst_amethyst_walk.1.ogg new file mode 100644 index 000000000..8165edd5f Binary files /dev/null and b/mods/ITEMS/mcl_amethyst/sounds/mcl_amethyst_amethyst_walk.1.ogg differ diff --git a/mods/ITEMS/mcl_amethyst/sounds/mcl_amethyst_amethyst_walk.2.ogg b/mods/ITEMS/mcl_amethyst/sounds/mcl_amethyst_amethyst_walk.2.ogg new file mode 100644 index 000000000..5bb5c4657 Binary files /dev/null and b/mods/ITEMS/mcl_amethyst/sounds/mcl_amethyst_amethyst_walk.2.ogg differ diff --git a/mods/ITEMS/mcl_amethyst/sounds/mcl_amethyst_amethyst_walk.3.ogg b/mods/ITEMS/mcl_amethyst/sounds/mcl_amethyst_amethyst_walk.3.ogg new file mode 100644 index 000000000..781668514 Binary files /dev/null and b/mods/ITEMS/mcl_amethyst/sounds/mcl_amethyst_amethyst_walk.3.ogg differ diff --git a/mods/ITEMS/mcl_amethyst/sounds/mcl_amethyst_amethyst_walk.4.ogg b/mods/ITEMS/mcl_amethyst/sounds/mcl_amethyst_amethyst_walk.4.ogg new file mode 100644 index 000000000..14299f50c Binary files /dev/null and b/mods/ITEMS/mcl_amethyst/sounds/mcl_amethyst_amethyst_walk.4.ogg differ diff --git a/mods/ITEMS/mcl_amethyst/textures/LICENSE.txt b/mods/ITEMS/mcl_amethyst/textures/LICENSE.txt new file mode 100644 index 000000000..f0993b6ce --- /dev/null +++ b/mods/ITEMS/mcl_amethyst/textures/LICENSE.txt @@ -0,0 +1 @@ +Nova_Wostra Creative Commons Attribution-Share Alike 4.0 International License https://creativecommons.org/licenses/by-sa/4.0/ diff --git a/mods/ITEMS/mcl_amethyst/textures/mcl_amethyst_amethyst_block.png b/mods/ITEMS/mcl_amethyst/textures/mcl_amethyst_amethyst_block.png new file mode 100644 index 000000000..bc172f2a0 Binary files /dev/null and b/mods/ITEMS/mcl_amethyst/textures/mcl_amethyst_amethyst_block.png differ diff --git a/mods/ITEMS/mcl_amethyst/textures/mcl_amethyst_amethyst_bud_large.png b/mods/ITEMS/mcl_amethyst/textures/mcl_amethyst_amethyst_bud_large.png new file mode 100644 index 000000000..5c7309434 Binary files /dev/null and b/mods/ITEMS/mcl_amethyst/textures/mcl_amethyst_amethyst_bud_large.png differ diff --git a/mods/ITEMS/mcl_amethyst/textures/mcl_amethyst_amethyst_bud_medium.png b/mods/ITEMS/mcl_amethyst/textures/mcl_amethyst_amethyst_bud_medium.png new file mode 100644 index 000000000..5a54f63dc Binary files /dev/null and b/mods/ITEMS/mcl_amethyst/textures/mcl_amethyst_amethyst_bud_medium.png differ diff --git a/mods/ITEMS/mcl_amethyst/textures/mcl_amethyst_amethyst_bud_small.png b/mods/ITEMS/mcl_amethyst/textures/mcl_amethyst_amethyst_bud_small.png new file mode 100644 index 000000000..7a414235b Binary files /dev/null and b/mods/ITEMS/mcl_amethyst/textures/mcl_amethyst_amethyst_bud_small.png differ diff --git a/mods/ITEMS/mcl_amethyst/textures/mcl_amethyst_amethyst_cluster.png b/mods/ITEMS/mcl_amethyst/textures/mcl_amethyst_amethyst_cluster.png new file mode 100644 index 000000000..1097d97b1 Binary files /dev/null and b/mods/ITEMS/mcl_amethyst/textures/mcl_amethyst_amethyst_cluster.png differ diff --git a/mods/ITEMS/mcl_amethyst/textures/mcl_amethyst_amethyst_cluster_block.png b/mods/ITEMS/mcl_amethyst/textures/mcl_amethyst_amethyst_cluster_block.png new file mode 100644 index 000000000..7ea932bf8 Binary files /dev/null and b/mods/ITEMS/mcl_amethyst/textures/mcl_amethyst_amethyst_cluster_block.png differ diff --git a/mods/ITEMS/mcl_amethyst/textures/mcl_amethyst_amethyst_shard.png b/mods/ITEMS/mcl_amethyst/textures/mcl_amethyst_amethyst_shard.png new file mode 100644 index 000000000..0d718c47a Binary files /dev/null and b/mods/ITEMS/mcl_amethyst/textures/mcl_amethyst_amethyst_shard.png differ diff --git a/mods/ITEMS/mcl_amethyst/textures/mcl_amethyst_budding_amethyst.png b/mods/ITEMS/mcl_amethyst/textures/mcl_amethyst_budding_amethyst.png new file mode 100644 index 000000000..6dee8ee9b Binary files /dev/null and b/mods/ITEMS/mcl_amethyst/textures/mcl_amethyst_budding_amethyst.png differ diff --git a/mods/ITEMS/mcl_amethyst/textures/mcl_amethyst_calcite_block.png b/mods/ITEMS/mcl_amethyst/textures/mcl_amethyst_calcite_block.png new file mode 100644 index 000000000..48e3ce5d9 Binary files /dev/null and b/mods/ITEMS/mcl_amethyst/textures/mcl_amethyst_calcite_block.png differ diff --git a/mods/ITEMS/mcl_amethyst/textures/mcl_amethyst_tinted_glass.png b/mods/ITEMS/mcl_amethyst/textures/mcl_amethyst_tinted_glass.png new file mode 100644 index 000000000..18e797789 Binary files /dev/null and b/mods/ITEMS/mcl_amethyst/textures/mcl_amethyst_tinted_glass.png differ