From 029fb87790cb41adbe12abb9474e6e98832f8e58 Mon Sep 17 00:00:00 2001 From: alek13 Date: Thu, 5 Dec 2024 03:22:01 +0300 Subject: [PATCH] Artisan Benches modpack: extract `cauldron`. Relates to #1798 --- .../Blocks/ArtisanBenches/cauldron/init.lua | 4 +- .../cauldron}/legacy.lua | 10 +++ .../cauldron/locale/cauldron.en.tr | 5 ++ .../cauldron/locale/cauldron.ru.tr | 5 ++ .../Blocks/ArtisanBenches/cauldron/mod.conf | 2 +- .../cauldron/src}/cauldron.lua | 64 ++++++++++-------- .../textures}/benches_cauldron_side.png | Bin .../textures}/benches_cauldron_top.png | Bin .../textures}/benches_cauldron_top_empty.png | Bin .../lord/Blocks/lord_artisan_benches/init.lua | 2 - .../locale/lord_artisan_benches.en.tr | 6 -- .../locale/lord_artisan_benches.ru.tr | 6 -- .../src/artisan_benches.lua | 1 - 13 files changed, 60 insertions(+), 45 deletions(-) rename mods/lord/Blocks/{lord_artisan_benches => ArtisanBenches/cauldron}/legacy.lua (54%) rename mods/lord/Blocks/{lord_artisan_benches/src/artisan_benches => ArtisanBenches/cauldron/src}/cauldron.lua (54%) rename mods/lord/Blocks/{lord_artisan_benches/textures/cauldron => ArtisanBenches/cauldron/textures}/benches_cauldron_side.png (100%) rename mods/lord/Blocks/{lord_artisan_benches/textures/cauldron => ArtisanBenches/cauldron/textures}/benches_cauldron_top.png (100%) rename mods/lord/Blocks/{lord_artisan_benches/textures/cauldron => ArtisanBenches/cauldron/textures}/benches_cauldron_top_empty.png (100%) diff --git a/mods/lord/Blocks/ArtisanBenches/cauldron/init.lua b/mods/lord/Blocks/ArtisanBenches/cauldron/init.lua index d2ad8b5bd..54c26235a 100644 --- a/mods/lord/Blocks/ArtisanBenches/cauldron/init.lua +++ b/mods/lord/Blocks/ArtisanBenches/cauldron/init.lua @@ -1,5 +1,7 @@ minetest.mod(function(mod) - --require("cauldron").init(mod) + require('cauldron').init(mod) + + dofile(mod.path .. '/legacy.lua') end) diff --git a/mods/lord/Blocks/lord_artisan_benches/legacy.lua b/mods/lord/Blocks/ArtisanBenches/cauldron/legacy.lua similarity index 54% rename from mods/lord/Blocks/lord_artisan_benches/legacy.lua rename to mods/lord/Blocks/ArtisanBenches/cauldron/legacy.lua index b9237c4f1..18c0999e6 100644 --- a/mods/lord/Blocks/lord_artisan_benches/legacy.lua +++ b/mods/lord/Blocks/ArtisanBenches/cauldron/legacy.lua @@ -6,8 +6,18 @@ minetest.register_alias('lottpotion:cauldron_two_third_full', 'lord_artisan_benc minetest.register_alias('lottpotion:cauldron_one_third_full', 'lord_artisan_benches:cauldron_1_3') minetest.register_alias('lottpotion:cauldron_empty', 'lord_artisan_benches:cauldron_0_3') +minetest.register_alias('lord_artisan_benches:cauldron_3_3', 'cauldron:cauldron_3_3') +minetest.register_alias('lord_artisan_benches:cauldron_2_3', 'cauldron:cauldron_2_3') +minetest.register_alias('lord_artisan_benches:cauldron_1_3', 'cauldron:cauldron_1_3') +minetest.register_alias('lord_artisan_benches:cauldron_0_3', 'cauldron:cauldron_0_3') + -- DEFAULTS (Ghost blocks) minetest.register_alias('defaults:lottpotion_cauldron_full', 'defaults:lord_artisan_benches_cauldron_3_3') minetest.register_alias('defaults:lottpotion_cauldron_two_third_full', 'defaults:lord_artisan_benches_cauldron_2_3') minetest.register_alias('defaults:lottpotion_cauldron_one_third_full', 'defaults:lord_artisan_benches_cauldron_1_3') minetest.register_alias('defaults:lottpotion_cauldron_empty', 'defaults:lord_artisan_benches_cauldron_0_3') + +minetest.register_alias('defaults:lord_artisan_benches_cauldron_3_3', 'defaults:cauldron_cauldron_3_3') +minetest.register_alias('defaults:lord_artisan_benches_cauldron_2_3', 'defaults:cauldron_cauldron_2_3') +minetest.register_alias('defaults:lord_artisan_benches_cauldron_1_3', 'defaults:cauldron_cauldron_1_3') +minetest.register_alias('defaults:lord_artisan_benches_cauldron_0_3', 'defaults:cauldron_cauldron_0_3') diff --git a/mods/lord/Blocks/ArtisanBenches/cauldron/locale/cauldron.en.tr b/mods/lord/Blocks/ArtisanBenches/cauldron/locale/cauldron.en.tr index bd8d79be7..7d5847f1e 100644 --- a/mods/lord/Blocks/ArtisanBenches/cauldron/locale/cauldron.en.tr +++ b/mods/lord/Blocks/ArtisanBenches/cauldron/locale/cauldron.en.tr @@ -1 +1,6 @@ # textdomain: cauldron + +Filled Cauldron=Filled Cauldron +Two Third Filled Cauldron=Two Third Filled Cauldron +One Third Filled Cauldron=One Third Filled Cauldron +Empty Cauldron=Empty Cauldron diff --git a/mods/lord/Blocks/ArtisanBenches/cauldron/locale/cauldron.ru.tr b/mods/lord/Blocks/ArtisanBenches/cauldron/locale/cauldron.ru.tr index bd8d79be7..6d383f0c4 100644 --- a/mods/lord/Blocks/ArtisanBenches/cauldron/locale/cauldron.ru.tr +++ b/mods/lord/Blocks/ArtisanBenches/cauldron/locale/cauldron.ru.tr @@ -1 +1,6 @@ # textdomain: cauldron + +Filled Cauldron=Полный котёл +Two Third Filled Cauldron=Котёл, заполненный на 2/3 +One Third Filled Cauldron=Котёл, заполненный на 1/3 +Empty Cauldron=Пустой котёл diff --git a/mods/lord/Blocks/ArtisanBenches/cauldron/mod.conf b/mods/lord/Blocks/ArtisanBenches/cauldron/mod.conf index e7625f1f8..b75e34928 100644 --- a/mods/lord/Blocks/ArtisanBenches/cauldron/mod.conf +++ b/mods/lord/Blocks/ArtisanBenches/cauldron/mod.conf @@ -1,2 +1,2 @@ name = cauldron -depends = builtin +depends = builtin, default diff --git a/mods/lord/Blocks/lord_artisan_benches/src/artisan_benches/cauldron.lua b/mods/lord/Blocks/ArtisanBenches/cauldron/src/cauldron.lua similarity index 54% rename from mods/lord/Blocks/lord_artisan_benches/src/artisan_benches/cauldron.lua rename to mods/lord/Blocks/ArtisanBenches/cauldron/src/cauldron.lua index 3461cf8ca..8a0fde5a0 100644 --- a/mods/lord/Blocks/lord_artisan_benches/src/artisan_benches/cauldron.lua +++ b/mods/lord/Blocks/ArtisanBenches/cauldron/src/cauldron.lua @@ -1,20 +1,20 @@ -local SL = minetest.get_mod_translator() +local S = minetest.get_mod_translator() local px = 1/16 local common_definition = { - drawtype = "nodebox", + drawtype = 'nodebox', tiles = { - "benches_cauldron_top.png", "benches_cauldron_side.png", "benches_cauldron_side.png", - "benches_cauldron_side.png", "benches_cauldron_side.png", "benches_cauldron_side.png", + 'benches_cauldron_top.png', 'benches_cauldron_side.png', 'benches_cauldron_side.png', + 'benches_cauldron_side.png', 'benches_cauldron_side.png', 'benches_cauldron_side.png', }, - use_texture_alpha = "blend", - paramtype = "light", - paramtype2 = "facedir", + use_texture_alpha = 'blend', + paramtype = 'light', + paramtype2 = 'facedir', groups = { cracky = 1 }, node_box = { - type = "fixed", + type = 'fixed', fixed = { { -8*px, -8*px, -8*px, -6*px, 8*px, -6*px }, { 6*px, -8*px, -8*px, 8*px, 8*px, -6*px }, @@ -35,62 +35,70 @@ local common_definition = { local function fill_bottle(player, position, change_to) local player_inv = player:get_inventory() local itemstack = player:get_wielded_item() - if itemstack:get_name() == "vessels:glass_bottle" then + if itemstack:get_name() == 'vessels:glass_bottle' then minetest.set_node(position, { name = change_to }) - if player_inv:room_for_item("main", 1) then + if player_inv:room_for_item('main', 1) then itemstack:take_item(1) - player_inv:add_item("main", "lord_vessels:glass_bottle_water") + player_inv:add_item('main', 'lord_vessels:glass_bottle_water') end player:set_wielded_item(itemstack) end end -minetest.register_node("lord_artisan_benches:cauldron_3_3", table.merge(common_definition, { - description = SL("Filled Cauldron"), +minetest.register_node('cauldron:cauldron_3_3', table.merge(common_definition, { + description = S('Filled Cauldron'), node_box = { fixed = { [10] = { -6*px, 4*px, -6*px, 6*px, 5*px, 6*px }, } }, on_punch = function(pos, node, player) - fill_bottle(player, pos, "lord_artisan_benches:cauldron_2_3") + fill_bottle(player, pos, 'cauldron:cauldron_2_3') end, })) -minetest.register_node("lord_artisan_benches:cauldron_2_3", table.merge(common_definition, { - description = SL("Two Third Filled Cauldron"), +minetest.register_node('cauldron:cauldron_2_3', table.merge(common_definition, { + description = S('Two Third Filled Cauldron'), groups = { not_in_creative_inventory = 1 }, node_box = { fixed = { [10] = { -6*px, 1*px, -6*px, 6*px, 2*px, 6*px }, } }, on_punch = function(pos, node, player) - fill_bottle(player, pos, "lord_artisan_benches:cauldron_1_3") + fill_bottle(player, pos, 'cauldron:cauldron_1_3') end, })) -minetest.register_node("lord_artisan_benches:cauldron_1_3", table.merge(common_definition, { - description = SL("One Third Filled Cauldron"), +minetest.register_node('cauldron:cauldron_1_3', table.merge(common_definition, { + description = S('One Third Filled Cauldron'), groups = { not_in_creative_inventory = 1 }, node_box = { fixed = { [10] = { -6*px, -2*px, -6*px, 6*px, -1*px, 6*px }, } }, on_punch = function(pos, node, player) - fill_bottle(player, pos, "lord_artisan_benches:cauldron_0_3") + fill_bottle(player, pos, 'cauldron:cauldron_0_3') end, })) common_definition.tiles = nil -minetest.register_node("lord_artisan_benches:cauldron_0_3", table.merge(common_definition, { - description = SL("Empty Cauldron"), +minetest.register_node('cauldron:cauldron_0_3', table.merge(common_definition, { + description = S('Empty Cauldron'), tiles = { - "benches_cauldron_top_empty.png", "benches_cauldron_side.png", "benches_cauldron_side.png", - "benches_cauldron_side.png", "benches_cauldron_side.png", "benches_cauldron_side.png", + 'benches_cauldron_top_empty.png', 'benches_cauldron_side.png', 'benches_cauldron_side.png', + 'benches_cauldron_side.png', 'benches_cauldron_side.png', 'benches_cauldron_side.png', }, groups = { level = 2 }, node_box = { fixed = { [10] = { -6*px, -2*px, -6*px, 6*px, -4*px, 6*px }, }, }, on_rightclick = function(pos, node, clicker, itemstack) - if itemstack:get_name() == "bucket:bucket_water" then - minetest.set_node(pos, { name = "lord_artisan_benches:cauldron_3_3" }) - return { name = "bucket:bucket_empty" } + if itemstack:get_name() == 'bucket:bucket_water' then + minetest.set_node(pos, { name = 'cauldron:cauldron_3_3' }) + return { name = 'bucket:bucket_empty' } end end })) minetest.register_craft({ - output = 'lord_artisan_benches:cauldron_0_3', + output = 'cauldron:cauldron_0_3', recipe = { { 'default:steel_ingot', '', 'default:steel_ingot' }, { 'default:steel_ingot', '', 'default:steel_ingot' }, { 'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot' }, } }) + + +return { + --- @param mod minetest.Mod + init = function(mod) + -- all things done upper + end, +} diff --git a/mods/lord/Blocks/lord_artisan_benches/textures/cauldron/benches_cauldron_side.png b/mods/lord/Blocks/ArtisanBenches/cauldron/textures/benches_cauldron_side.png similarity index 100% rename from mods/lord/Blocks/lord_artisan_benches/textures/cauldron/benches_cauldron_side.png rename to mods/lord/Blocks/ArtisanBenches/cauldron/textures/benches_cauldron_side.png diff --git a/mods/lord/Blocks/lord_artisan_benches/textures/cauldron/benches_cauldron_top.png b/mods/lord/Blocks/ArtisanBenches/cauldron/textures/benches_cauldron_top.png similarity index 100% rename from mods/lord/Blocks/lord_artisan_benches/textures/cauldron/benches_cauldron_top.png rename to mods/lord/Blocks/ArtisanBenches/cauldron/textures/benches_cauldron_top.png diff --git a/mods/lord/Blocks/lord_artisan_benches/textures/cauldron/benches_cauldron_top_empty.png b/mods/lord/Blocks/ArtisanBenches/cauldron/textures/benches_cauldron_top_empty.png similarity index 100% rename from mods/lord/Blocks/lord_artisan_benches/textures/cauldron/benches_cauldron_top_empty.png rename to mods/lord/Blocks/ArtisanBenches/cauldron/textures/benches_cauldron_top_empty.png diff --git a/mods/lord/Blocks/lord_artisan_benches/init.lua b/mods/lord/Blocks/lord_artisan_benches/init.lua index 078aab4ec..659d1e670 100644 --- a/mods/lord/Blocks/lord_artisan_benches/init.lua +++ b/mods/lord/Blocks/lord_artisan_benches/init.lua @@ -2,6 +2,4 @@ minetest.mod(function(mod) require('artisan_benches').init() - - dofile(mod.path..'/legacy.lua') end) diff --git a/mods/lord/Blocks/lord_artisan_benches/locale/lord_artisan_benches.en.tr b/mods/lord/Blocks/lord_artisan_benches/locale/lord_artisan_benches.en.tr index 5eefb38d4..1b380b830 100644 --- a/mods/lord/Blocks/lord_artisan_benches/locale/lord_artisan_benches.en.tr +++ b/mods/lord/Blocks/lord_artisan_benches/locale/lord_artisan_benches.en.tr @@ -6,12 +6,6 @@ Ingredients:=Ingredients: Result:=Result: -### Cauldron ### -Filled Cauldron=Filled Cauldron -Two Third Filled Cauldron=Two Third Filled Cauldron -One Third Filled Cauldron=One Third Filled Cauldron -Empty Cauldron=Empty Cauldron - ### Barrel ### Barrel=Barrel diff --git a/mods/lord/Blocks/lord_artisan_benches/locale/lord_artisan_benches.ru.tr b/mods/lord/Blocks/lord_artisan_benches/locale/lord_artisan_benches.ru.tr index 49abc6bc3..9efca8202 100644 --- a/mods/lord/Blocks/lord_artisan_benches/locale/lord_artisan_benches.ru.tr +++ b/mods/lord/Blocks/lord_artisan_benches/locale/lord_artisan_benches.ru.tr @@ -6,12 +6,6 @@ Ingredients:=Ингредиенты: Result:=Результат: -### Cauldron ### -Filled Cauldron=Полный котёл -Two Third Filled Cauldron=Котёл, заполненный на 2/3 -One Third Filled Cauldron=Котёл, заполненный на 1/3 -Empty Cauldron=Пустой котёл - ### Barrel ### Barrel=Бочка diff --git a/mods/lord/Blocks/lord_artisan_benches/src/artisan_benches.lua b/mods/lord/Blocks/lord_artisan_benches/src/artisan_benches.lua index 77e744240..49fdff7e1 100644 --- a/mods/lord/Blocks/lord_artisan_benches/src/artisan_benches.lua +++ b/mods/lord/Blocks/lord_artisan_benches/src/artisan_benches.lua @@ -5,7 +5,6 @@ return { --- @param mod minetest.Mod init = function(mod) require('artisan_benches.barrel') - require('artisan_benches.cauldron') require('artisan_benches.laboratory') end }