diff --git a/mods/lord/Blocks/ArtisanBenches/anvil/init.lua b/mods/lord/Blocks/ArtisanBenches/anvil/init.lua index 2826408f2..be8ec7760 100644 --- a/mods/lord/Blocks/ArtisanBenches/anvil/init.lua +++ b/mods/lord/Blocks/ArtisanBenches/anvil/init.lua @@ -1,7 +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/workbench/init.lua b/mods/lord/Blocks/ArtisanBenches/workbench/init.lua index 45caa875a..680bb8ce3 100644 --- a/mods/lord/Blocks/ArtisanBenches/workbench/init.lua +++ b/mods/lord/Blocks/ArtisanBenches/workbench/init.lua @@ -1,5 +1,7 @@ minetest.mod(function(mod) - --require("workbench").init(mod) + require('workbench').init(mod) + + dofile(mod.path .. '/legacy.lua') end) diff --git a/mods/lord/Blocks/ArtisanBenches/workbench/legacy.lua b/mods/lord/Blocks/ArtisanBenches/workbench/legacy.lua new file mode 100644 index 000000000..fc8f595ba --- /dev/null +++ b/mods/lord/Blocks/ArtisanBenches/workbench/legacy.lua @@ -0,0 +1,6 @@ + +-- @tags: legacy + +minetest.register_alias('castle:workbench', 'workbench:workbench') +minetest.register_alias('lord_artisan_benches:workbench', 'workbench:workbench') +-- DEFAULTS (Ghost blocks) diff --git a/mods/lord/Blocks/ArtisanBenches/workbench/locale/workbench.en.tr b/mods/lord/Blocks/ArtisanBenches/workbench/locale/workbench.en.tr index ce2dc83bf..468483d40 100644 --- a/mods/lord/Blocks/ArtisanBenches/workbench/locale/workbench.en.tr +++ b/mods/lord/Blocks/ArtisanBenches/workbench/locale/workbench.en.tr @@ -1 +1,6 @@ # textdomain: workbench + +Workbench=Workbench +Source Material=Source Material +Recipe to Use=Recipe to Use +Craft Output=Craft Output diff --git a/mods/lord/Blocks/ArtisanBenches/workbench/locale/workbench.ru.tr b/mods/lord/Blocks/ArtisanBenches/workbench/locale/workbench.ru.tr index ce2dc83bf..84e841ec3 100644 --- a/mods/lord/Blocks/ArtisanBenches/workbench/locale/workbench.ru.tr +++ b/mods/lord/Blocks/ArtisanBenches/workbench/locale/workbench.ru.tr @@ -1 +1,6 @@ # textdomain: workbench + +Workbench=Верстак +Source Material=Материалы: +Recipe to Use=Схема: +Craft Output=Результат: diff --git a/mods/lord/Blocks/ArtisanBenches/workbench/mod.conf b/mods/lord/Blocks/ArtisanBenches/workbench/mod.conf index 1ac2c44e8..3010eae7e 100644 --- a/mods/lord/Blocks/ArtisanBenches/workbench/mod.conf +++ b/mods/lord/Blocks/ArtisanBenches/workbench/mod.conf @@ -1,2 +1,2 @@ name = workbench -depends = builtin +depends = builtin, default diff --git a/mods/lord/Blocks/lord_artisan_benches/models/workbench.blend b/mods/lord/Blocks/ArtisanBenches/workbench/models/workbench.blend similarity index 100% rename from mods/lord/Blocks/lord_artisan_benches/models/workbench.blend rename to mods/lord/Blocks/ArtisanBenches/workbench/models/workbench.blend diff --git a/mods/lord/Blocks/lord_artisan_benches/models/workbench.obj b/mods/lord/Blocks/ArtisanBenches/workbench/models/workbench.obj similarity index 100% rename from mods/lord/Blocks/lord_artisan_benches/models/workbench.obj rename to mods/lord/Blocks/ArtisanBenches/workbench/models/workbench.obj diff --git a/mods/lord/Blocks/lord_artisan_benches/src/artisan_benches/workbench.lua b/mods/lord/Blocks/ArtisanBenches/workbench/src/workbench.lua similarity index 65% rename from mods/lord/Blocks/lord_artisan_benches/src/artisan_benches/workbench.lua rename to mods/lord/Blocks/ArtisanBenches/workbench/src/workbench.lua index 03dbce5ab..6fbf57e5c 100644 --- a/mods/lord/Blocks/lord_artisan_benches/src/artisan_benches/workbench.lua +++ b/mods/lord/Blocks/ArtisanBenches/workbench/src/workbench.lua @@ -4,9 +4,6 @@ local S = minetest.get_mod_translator() -minetest.register_alias('castle:workbench', 'lord_artisan_benches:workbench') - - local get_recipe = function(inv) local result, needed, input needed = inv:get_list('rec') @@ -73,9 +70,9 @@ local workbench_formspec = 'size[8,9;]' .. minetest.register_lbm({ - label = "workbench formspec replacement", - name = ":castle:workbench_formspec_replacement", - nodenames = {"lord_artisan_benches:workbench"}, + label = 'workbench formspec replacement', + name = ':castle:workbench_formspec_replacement', + nodenames = {'workbench:workbench'}, run_at_every_load = true, action = function(pos, node) local meta = minetest.get_meta(pos) @@ -83,21 +80,13 @@ minetest.register_lbm({ end }) -minetest.register_node("lord_artisan_benches:workbench", { - description = S("Workbench"), - drawtype = "mesh", - mesh = "workbench.obj", - tiles = { "benches_workbench.png" }, - --tiles = { - -- "benches_workbench_top.png", - -- "default_wood.png", - -- "benches_workbench_1.png", - -- "benches_workbench_1.png", - -- "benches_workbench_2.png", - -- "benches_workbench_2.png" - --}, - paramtype2 = "facedir", - paramtype = "light", +minetest.register_node('workbench:workbench', { + description = S('Workbench'), + drawtype = 'mesh', + mesh = 'workbench.obj', + tiles = { 'benches_workbench.png' }, + paramtype2 = 'facedir', + paramtype = 'light', groups = { choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wooden = 1 }, sounds = default.node_sound_wood_defaults(), on_construct = function(pos) @@ -112,48 +101,42 @@ minetest.register_node("lord_artisan_benches:workbench", { can_dig = function(pos, player) local meta = minetest.get_meta(pos); local inv = meta:get_inventory() - return inv:is_empty("src") and inv:is_empty("dst") and inv:is_empty("rec") + return inv:is_empty('src') and inv:is_empty('dst') and inv:is_empty('rec') end, allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) if minetest.is_protected(pos, player:get_player_name()) then - minetest.log("action", player:get_player_name() .. - " attempt moves stuff in workbench at " .. minetest.pos_to_string(pos)) + minetest.log('action', player:get_player_name() .. + ' attempt moves stuff in workbench at ' .. minetest.pos_to_string(pos)) return 0 end - minetest.log("action", player:get_player_name() .. - " moves stuff in workbench at " .. minetest.pos_to_string(pos)) + minetest.log('action', player:get_player_name() .. + ' moves stuff in workbench at ' .. minetest.pos_to_string(pos)) return count end, allow_metadata_inventory_put = function(pos, listname, index, stack, player) if minetest.is_protected(pos, player:get_player_name()) then - minetest.log("action", player:get_player_name() .. - " attempt moves stuff to workbench at " .. minetest.pos_to_string(pos)) + minetest.log('action', player:get_player_name() .. + ' attempt moves stuff to workbench at ' .. minetest.pos_to_string(pos)) return 0 end - minetest.log("action", player:get_player_name() .. - " moves stuff to workbench at " .. minetest.pos_to_string(pos)) + minetest.log('action', player:get_player_name() .. + ' moves stuff to workbench at ' .. minetest.pos_to_string(pos)) return stack:get_count() end, allow_metadata_inventory_take = function(pos, listname, index, stack, player) if minetest.is_protected(pos, player:get_player_name()) then - minetest.log("action", player:get_player_name() .. - " attempt takes stuff from workbench at " .. minetest.pos_to_string(pos)) + minetest.log('action', player:get_player_name() .. + ' attempt takes stuff from workbench at ' .. minetest.pos_to_string(pos)) return 0 end - minetest.log("action", player:get_player_name() .. - " takes stuff from workbench at " .. minetest.pos_to_string(pos)) + minetest.log('action', player:get_player_name() .. + ' takes stuff from workbench at ' .. minetest.pos_to_string(pos)) return stack:get_count() end, - -- allow_metadata_inventory_put = function(pos, listname, index, stack, player) - -- end, - -- allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) - -- end, - -- allow_metadata_inventory_take = function(pos, listname, index, stack, player) - -- end, }) minetest.register_abm({ - nodenames = { 'lord_artisan_benches:workbench' }, + nodenames = { 'workbench:workbench' }, interval = 5, chance = 1, action = function(pos, node) @@ -179,10 +162,18 @@ minetest.register_abm({ }) minetest.register_craft({ - output = "lord_artisan_benches:workbench", + output = 'workbench:workbench', recipe = { - { "default:steel_ingot", "default:steel_ingot", "default:steel_ingot" }, - { "default:wood", "default:wood", "default:steel_ingot" }, - { "default:tree", "default:tree", "default:steel_ingot" }, + { 'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot' }, + { 'default:wood', 'default:wood', 'default:steel_ingot' }, + { 'default:tree', 'default:tree', '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/workbench/benches_workbench.png b/mods/lord/Blocks/ArtisanBenches/workbench/textures/benches_workbench.png similarity index 100% rename from mods/lord/Blocks/lord_artisan_benches/textures/workbench/benches_workbench.png rename to mods/lord/Blocks/ArtisanBenches/workbench/textures/benches_workbench.png 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 431f456dc..5eefb38d4 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 @@ -17,9 +17,3 @@ Barrel=Barrel ### Laboratory ### Laboratory=Laboratory - -### Workbench ### -Workbench=Workbench -Source Material=Source Material -Recipe to Use=Recipe to Use -Craft Output=Craft Output 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 7355d03df..49abc6bc3 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 @@ -17,9 +17,3 @@ Barrel=Бочка ### Laboratory ### Laboratory=Лаборатория - -### Workbench ### -Workbench=Верстак -Source Material=Материалы: -Recipe to Use=Схема: -Craft Output=Результат: 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 f1c962050..77e744240 100644 --- a/mods/lord/Blocks/lord_artisan_benches/src/artisan_benches.lua +++ b/mods/lord/Blocks/lord_artisan_benches/src/artisan_benches.lua @@ -7,6 +7,5 @@ return { require('artisan_benches.barrel') require('artisan_benches.cauldron') require('artisan_benches.laboratory') - require('artisan_benches.workbench') end } diff --git a/mods/lord/Blocks/lord_artisan_benches/textures/workbench/benches_workbench_1.png b/mods/lord/Blocks/lord_artisan_benches/textures/workbench/benches_workbench_1.png deleted file mode 100644 index af945b548..000000000 Binary files a/mods/lord/Blocks/lord_artisan_benches/textures/workbench/benches_workbench_1.png and /dev/null differ diff --git a/mods/lord/Blocks/lord_artisan_benches/textures/workbench/benches_workbench_2.png b/mods/lord/Blocks/lord_artisan_benches/textures/workbench/benches_workbench_2.png deleted file mode 100644 index 008a285c5..000000000 Binary files a/mods/lord/Blocks/lord_artisan_benches/textures/workbench/benches_workbench_2.png and /dev/null differ diff --git a/mods/lord/Blocks/lord_artisan_benches/textures/workbench/benches_workbench_top.png b/mods/lord/Blocks/lord_artisan_benches/textures/workbench/benches_workbench_top.png deleted file mode 100644 index 90e922779..000000000 Binary files a/mods/lord/Blocks/lord_artisan_benches/textures/workbench/benches_workbench_top.png and /dev/null differ