diff --git a/mods/lord/Blocks/ArtisanBenches/anvil/init.lua b/mods/lord/Blocks/ArtisanBenches/anvil/init.lua index a01613f7c..2826408f2 100644 --- a/mods/lord/Blocks/ArtisanBenches/anvil/init.lua +++ b/mods/lord/Blocks/ArtisanBenches/anvil/init.lua @@ -1,5 +1,7 @@ minetest.mod(function(mod) - --require("anvil").init(mod) + require("anvil").init(mod) + + dofile(mod.path .. '/legacy.lua') end) diff --git a/mods/lord/Blocks/ArtisanBenches/anvil/legacy.lua b/mods/lord/Blocks/ArtisanBenches/anvil/legacy.lua new file mode 100644 index 000000000..c2d1e89bc --- /dev/null +++ b/mods/lord/Blocks/ArtisanBenches/anvil/legacy.lua @@ -0,0 +1,8 @@ + +-- @tags: legacy + +minetest.register_alias('castle:anvil', 'anvil:anvil') +minetest.register_alias('lord_artisan_benches:anvil', 'anvil:anvil') +-- DEFAULTS (Ghost blocks) +minetest.register_alias('defaults:castle_anvil', 'defaults:anvil_anvil') +minetest.register_alias('defaults:lord_artisan_benches_anvil', 'defaults:anvil_anvil') diff --git a/mods/lord/Blocks/ArtisanBenches/anvil/locale/anvil.en.tr b/mods/lord/Blocks/ArtisanBenches/anvil/locale/anvil.en.tr index 870a87fd7..98ecdf4f7 100644 --- a/mods/lord/Blocks/ArtisanBenches/anvil/locale/anvil.en.tr +++ b/mods/lord/Blocks/ArtisanBenches/anvil/locale/anvil.en.tr @@ -1 +1,3 @@ # textdomain: anvil + +Anvil=Anvil diff --git a/mods/lord/Blocks/ArtisanBenches/anvil/locale/anvil.ru.tr b/mods/lord/Blocks/ArtisanBenches/anvil/locale/anvil.ru.tr index 870a87fd7..045e681bb 100644 --- a/mods/lord/Blocks/ArtisanBenches/anvil/locale/anvil.ru.tr +++ b/mods/lord/Blocks/ArtisanBenches/anvil/locale/anvil.ru.tr @@ -1 +1,3 @@ # textdomain: anvil + +Anvil=Наковальня diff --git a/mods/lord/Blocks/lord_artisan_benches/models/anvil.blend b/mods/lord/Blocks/ArtisanBenches/anvil/models/anvil.blend similarity index 100% rename from mods/lord/Blocks/lord_artisan_benches/models/anvil.blend rename to mods/lord/Blocks/ArtisanBenches/anvil/models/anvil.blend diff --git a/mods/lord/Blocks/lord_artisan_benches/models/anvil.obj b/mods/lord/Blocks/ArtisanBenches/anvil/models/anvil.obj similarity index 100% rename from mods/lord/Blocks/lord_artisan_benches/models/anvil.obj rename to mods/lord/Blocks/ArtisanBenches/anvil/models/anvil.obj diff --git a/mods/lord/Blocks/ArtisanBenches/anvil/src/anvil.lua b/mods/lord/Blocks/ArtisanBenches/anvil/src/anvil.lua new file mode 100644 index 000000000..054819bb9 --- /dev/null +++ b/mods/lord/Blocks/ArtisanBenches/anvil/src/anvil.lua @@ -0,0 +1,74 @@ +local S = minetest.get_mod_translator() +local Form = require('anvil.Form') + + +local px = 1/16 +local node_box = { + type = 'fixed', + fixed = { + -- Подошва + { -8*px, -8*px, -8*px, -4*px, -5*px, -4*px }, -- ножки подошвы + { -8*px, -8*px, 8*px, -4*px, -5*px, 4*px }, + { 8*px, -8*px, 8*px, 4*px, -5*px, 4*px }, + { 8*px, -8*px, -8*px, 4*px, -5*px, -4*px }, + + { -7*px, -8*px, -6*px, 7*px, -5*px, 6*px }, -- сердцевины подошвы + { -5*px, -5*px, -4*px, 5*px, -2*px, 4*px }, + + -- Ножка / шея + { -3*px, -2*px, -2*px, 3*px, 3*px, 2*px }, + -- Рабочая область (наличник) + { -5*px, 3*px, -4*px, 5*px, 8*px, 4*px }, + + -- Рог + { -5*px, 5*px, -2*px, -8*px, 8*px, 2*px }, + + -- Обух с отверстием Харди + { 7*px, 5*px, -4*px, 8*px, 8*px, 4*px }, + { 5*px, 5*px, -2*px, 7*px, 6*px, 2*px }, + { 5*px, 5*px, -4*px, 7*px, 8*px, -2*px }, + { 5*px, 5*px, 2*px, 7*px, 8*px, 4*px }, + }, +} + +local function register_node() + minetest.register_node('anvil:anvil', { + description = S('Anvil'), + drawtype = 'mesh', + mesh = 'anvil.obj', + tiles = { 'benches_anvil.png' }, + groups = { cracky = 1, falling_node = 1 }, + selection_box = node_box, + collision_box = node_box, + paramtype = 'light', + paramtype2 = 'facedir', + on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) + Form:new(clicker, pos):open() + end + }) +end + +local function register_craft() + minetest.register_craft({ + output = 'anvil:anvil', + recipe = { + { 'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot' }, + { '', 'default:steel_ingot', '' }, + { 'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot' }, + } + }) +end + + +return { + --- @param mod minetest.Mod + init = function(mod) + minetest.CraftMethod.ANVIL = 'anvil' + minetest.register_craft_method(minetest.CraftMethod.ANVIL) + + Form:register() + + register_node() + register_craft() + end, +} diff --git a/mods/lord/Blocks/lord_artisan_benches/src/artisan_benches/anvil/Form.lua b/mods/lord/Blocks/ArtisanBenches/anvil/src/anvil/Form.lua similarity index 89% rename from mods/lord/Blocks/lord_artisan_benches/src/artisan_benches/anvil/Form.lua rename to mods/lord/Blocks/ArtisanBenches/anvil/src/anvil/Form.lua index cdb1e199a..097a34756 100644 --- a/mods/lord/Blocks/lord_artisan_benches/src/artisan_benches/anvil/Form.lua +++ b/mods/lord/Blocks/ArtisanBenches/anvil/src/anvil/Form.lua @@ -1,4 +1,4 @@ -local Inventory = require("artisan_benches.anvil.Form.Inventory") +local Inventory = require('anvil.Form.Inventory') --- @class artisan_benches.anvil.Form: base_classes.Form.Base @@ -7,7 +7,7 @@ local Inventory = require("artisan_benches.anvil.Form.Inventory") local Form = base_classes.Form:personal():for_node():with_detached(Inventory):extended({ --- @const --- @type string - NAME = "lord_artisan_benches:anvil", + NAME = 'anvil:anvil', }) --- @private diff --git a/mods/lord/Blocks/lord_artisan_benches/src/artisan_benches/anvil/Form/Inventory.lua b/mods/lord/Blocks/ArtisanBenches/anvil/src/anvil/Form/Inventory.lua similarity index 89% rename from mods/lord/Blocks/lord_artisan_benches/src/artisan_benches/anvil/Form/Inventory.lua rename to mods/lord/Blocks/ArtisanBenches/anvil/src/anvil/Form/Inventory.lua index a782d8cac..4a13037c2 100644 --- a/mods/lord/Blocks/lord_artisan_benches/src/artisan_benches/anvil/Form/Inventory.lua +++ b/mods/lord/Blocks/ArtisanBenches/anvil/src/anvil/Form/Inventory.lua @@ -1,4 +1,4 @@ -local InventoryCallbacks = require("artisan_benches.anvil.Form.InventoryCallbacks") +local InventoryCallbacks = require('anvil.Form.InventoryCallbacks') --- @class anvil.Form.Inventory: base_classes.DetachedInventory diff --git a/mods/lord/Blocks/lord_artisan_benches/src/artisan_benches/anvil/Form/InventoryCallbacks.lua b/mods/lord/Blocks/ArtisanBenches/anvil/src/anvil/Form/InventoryCallbacks.lua similarity index 100% rename from mods/lord/Blocks/lord_artisan_benches/src/artisan_benches/anvil/Form/InventoryCallbacks.lua rename to mods/lord/Blocks/ArtisanBenches/anvil/src/anvil/Form/InventoryCallbacks.lua diff --git a/mods/lord/Blocks/lord_artisan_benches/textures/anvil/benches_anvil.png b/mods/lord/Blocks/ArtisanBenches/anvil/textures/benches_anvil.png similarity index 100% rename from mods/lord/Blocks/lord_artisan_benches/textures/anvil/benches_anvil.png rename to mods/lord/Blocks/ArtisanBenches/anvil/textures/benches_anvil.png diff --git a/mods/lord/Blocks/lord_artisan_benches/textures/anvil/benches_anvil_form_bg.png b/mods/lord/Blocks/ArtisanBenches/anvil/textures/benches_anvil_form_bg.png similarity index 100% rename from mods/lord/Blocks/lord_artisan_benches/textures/anvil/benches_anvil_form_bg.png rename to mods/lord/Blocks/ArtisanBenches/anvil/textures/benches_anvil_form_bg.png diff --git a/mods/lord/Blocks/lord_artisan_benches/legacy.lua b/mods/lord/Blocks/lord_artisan_benches/legacy.lua index a03332f5a..b9237c4f1 100644 --- a/mods/lord/Blocks/lord_artisan_benches/legacy.lua +++ b/mods/lord/Blocks/lord_artisan_benches/legacy.lua @@ -1,16 +1,12 @@ -- @tags: legacy -minetest.register_alias('castle:anvil', 'lord_artisan_benches:anvil') - minetest.register_alias('lottpotion:cauldron_full', 'lord_artisan_benches:cauldron_3_3') minetest.register_alias('lottpotion:cauldron_two_third_full', 'lord_artisan_benches:cauldron_2_3') 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') -- DEFAULTS (Ghost blocks) -minetest.register_alias('defaults:castle_anvil', 'defaults:lord_artisan_benches_anvil') - 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') 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 aa79df3cf..431f456dc 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,9 +6,6 @@ Ingredients:=Ingredients: Result:=Result: -### Anvil: ### -Anvil=Anvil - ### Cauldron ### Filled Cauldron=Filled Cauldron Two Third Filled Cauldron=Two Third Filled Cauldron 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 79579fe5f..7355d03df 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,9 +6,6 @@ Ingredients:=Ингредиенты: Result:=Результат: -### Anvil: ### -Anvil=Наковальня - ### Cauldron ### Filled Cauldron=Полный котёл Two Third Filled Cauldron=Котёл, заполненный на 2/3 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 42dd72903..f1c962050 100644 --- a/mods/lord/Blocks/lord_artisan_benches/src/artisan_benches.lua +++ b/mods/lord/Blocks/lord_artisan_benches/src/artisan_benches.lua @@ -4,7 +4,6 @@ return { --- @param mod minetest.Mod init = function(mod) - require('artisan_benches.anvil') require('artisan_benches.barrel') require('artisan_benches.cauldron') require('artisan_benches.laboratory') diff --git a/mods/lord/Blocks/lord_artisan_benches/src/artisan_benches/anvil.lua b/mods/lord/Blocks/lord_artisan_benches/src/artisan_benches/anvil.lua deleted file mode 100644 index 24a182f05..000000000 --- a/mods/lord/Blocks/lord_artisan_benches/src/artisan_benches/anvil.lua +++ /dev/null @@ -1,63 +0,0 @@ -local Form = require("artisan_benches.anvil.Form") - - -local S = minetest.get_mod_translator() - -minetest.CraftMethod.ANVIL = 'anvil' -minetest.register_craft_method(minetest.CraftMethod.ANVIL) - -Form:register() - -local px = 1/16 -local node_box = { - type = 'fixed', - fixed = { - -- Подошва - { -8*px, -8*px, -8*px, -4*px, -5*px, -4*px }, -- ножки подошвы - { -8*px, -8*px, 8*px, -4*px, -5*px, 4*px }, - { 8*px, -8*px, 8*px, 4*px, -5*px, 4*px }, - { 8*px, -8*px, -8*px, 4*px, -5*px, -4*px }, - - { -7*px, -8*px, -6*px, 7*px, -5*px, 6*px }, -- сердцевины подошвы - { -5*px, -5*px, -4*px, 5*px, -2*px, 4*px }, - - -- Ножка / шея - { -3*px, -2*px, -2*px, 3*px, 3*px, 2*px }, - -- Рабочая область (наличник) - { -5*px, 3*px, -4*px, 5*px, 8*px, 4*px }, - - -- Рог - { -5*px, 5*px, -2*px, -8*px, 8*px, 2*px }, - - -- Обух с отверстием Харди - { 7*px, 5*px, -4*px, 8*px, 8*px, 4*px }, - { 5*px, 5*px, -2*px, 7*px, 6*px, 2*px }, - { 5*px, 5*px, -4*px, 7*px, 8*px, -2*px }, - { 5*px, 5*px, 2*px, 7*px, 8*px, 4*px }, - }, -} - - -minetest.register_node('lord_artisan_benches:anvil', { - description = S('Anvil'), - drawtype = 'mesh', - mesh = 'anvil.obj', - tiles = { 'benches_anvil.png' }, - groups = { cracky = 1, falling_node = 1 }, - selection_box = node_box, - collision_box = node_box, - paramtype = 'light', - paramtype2 = 'facedir', - on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) - Form:new(clicker, pos):open() - end -}) - -minetest.register_craft({ - output = 'lord_artisan_benches:anvil', - recipe = { - { 'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot' }, - { '', 'default:steel_ingot', '' }, - { 'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot' }, - } -})