From 360a1604ba959d3af2b641077116dd47821a12e0 Mon Sep 17 00:00:00 2001 From: AFCMS Date: Tue, 22 Feb 2022 20:20:21 +0100 Subject: [PATCH] Revert "move barrels to mcl_chests" This reverts commit a272322cb5ec77d6e856e2034f407ea1c1d73438. --- .../barrel.lua => mcl_barrels/init.lua} | 30 ++++++++++-------- .../mcl_barrels/locale/mcl_barrels.de.tr | 5 +++ .../mcl_barrels/locale/mcl_barrels.es.tr | 5 +++ .../mcl_barrels/locale/mcl_barrels.fr.tr | 5 +++ .../mcl_barrels/locale/mcl_barrels.pl.tr | 5 +++ .../mcl_barrels/locale/mcl_barrels.ru.tr | 5 +++ mods/ITEMS/mcl_barrels/locale/template.txt | 5 +++ mods/ITEMS/mcl_barrels/mod.conf | 3 ++ .../textures/mcl_barrels_barrel_bottom.png} | Bin .../textures/mcl_barrels_barrel_side.png} | Bin .../textures/mcl_barrels_barrel_top.png} | Bin .../textures/mcl_barrels_barrel_top_open.png} | Bin mods/ITEMS/mcl_chests/init.lua | 2 -- mods/ITEMS/mcl_chests/locale/mcl_chests.fr.tr | 2 -- mods/ITEMS/mcl_chests/locale/template.txt | 2 -- 15 files changed, 49 insertions(+), 20 deletions(-) rename mods/ITEMS/{mcl_chests/barrel.lua => mcl_barrels/init.lua} (81%) create mode 100644 mods/ITEMS/mcl_barrels/locale/mcl_barrels.de.tr create mode 100644 mods/ITEMS/mcl_barrels/locale/mcl_barrels.es.tr create mode 100644 mods/ITEMS/mcl_barrels/locale/mcl_barrels.fr.tr create mode 100644 mods/ITEMS/mcl_barrels/locale/mcl_barrels.pl.tr create mode 100644 mods/ITEMS/mcl_barrels/locale/mcl_barrels.ru.tr create mode 100644 mods/ITEMS/mcl_barrels/locale/template.txt create mode 100644 mods/ITEMS/mcl_barrels/mod.conf rename mods/ITEMS/{mcl_chests/textures/mcl_chests_barrel_bottom.png => mcl_barrels/textures/mcl_barrels_barrel_bottom.png} (100%) rename mods/ITEMS/{mcl_chests/textures/mcl_chests_barrel_side.png => mcl_barrels/textures/mcl_barrels_barrel_side.png} (100%) rename mods/ITEMS/{mcl_chests/textures/mcl_chests_barrel_top.png => mcl_barrels/textures/mcl_barrels_barrel_top.png} (100%) rename mods/ITEMS/{mcl_chests/textures/mcl_chests_barrel_top_open.png => mcl_barrels/textures/mcl_barrels_barrel_top_open.png} (100%) diff --git a/mods/ITEMS/mcl_chests/barrel.lua b/mods/ITEMS/mcl_barrels/init.lua similarity index 81% rename from mods/ITEMS/mcl_chests/barrel.lua rename to mods/ITEMS/mcl_barrels/init.lua index bc62165786..964f23fde4 100644 --- a/mods/ITEMS/mcl_chests/barrel.lua +++ b/mods/ITEMS/mcl_barrels/init.lua @@ -1,7 +1,9 @@ -local S = minetest.get_translator("mcl_chests") +local S = minetest.get_translator("mcl_barrels") local F = minetest.formspec_escape local C = minetest.colorize +--TODO: fix barrel rotation placement + local open_barrels = {} local drop_content = mcl_util.drop_items_from_meta_container("main") @@ -22,7 +24,7 @@ local function barrel_open(pos, node, clicker) local playername = clicker:get_player_name() minetest.show_formspec(playername, - "mcl_chests:barrel_"..pos.x.."_"..pos.y.."_"..pos.z, + "mcl_barrels:barrel_"..pos.x.."_"..pos.y.."_"..pos.z, table.concat({ "size[9,8.75]", "label[0,0;"..F(C("#313131", name)).."]", @@ -38,13 +40,13 @@ local function barrel_open(pos, node, clicker) }) ) - minetest.swap_node(pos, { name = "mcl_chests:barrel_open", param2 = node.param2 }) + minetest.swap_node(pos, { name = "mcl_barrels:barrel_open", param2 = node.param2 }) open_barrels[playername] = pos end local function close_forms(pos) local players = minetest.get_connected_players() - local formname = "mcl_chests:barrel_"..pos.x.."_"..pos.y.."_"..pos.z + local formname = "mcl_barrels:barrel_"..pos.x.."_"..pos.y.."_"..pos.z for p = 1, #players do if vector.distance(players[p]:get_pos(), pos) <= 30 then minetest.close_formspec(players[p]:get_player_name(), formname) @@ -55,8 +57,8 @@ end local function update_after_close(pos) local node = minetest.get_node_or_nil(pos) if not node then return end - if node.name == "mcl_chests:barrel_open" then - minetest.swap_node(pos, {name = "mcl_chests:barrel_closed", param2 = node.param2}) + if node.name == "mcl_barrels:barrel_open" then + minetest.swap_node(pos, {name = "mcl_barrels:barrel_closed", param2 = node.param2}) end end @@ -72,12 +74,12 @@ local function close_barrel(player) open_barrels[name] = nil end -minetest.register_node("mcl_chests:barrel_closed", { +minetest.register_node("mcl_barrels:barrel_closed", { description = S("Barrel"), _tt_help = S("27 inventory slots"), _doc_items_longdesc = S("Barrels are containers which provide 27 inventory slots."), _doc_items_usagehelp = S("To access its inventory, rightclick it. When broken, the items will drop out."), - tiles = {"mcl_chests_barrel_top.png^[transformR270", "mcl_chests_barrel_bottom.png", "mcl_chests_barrel_side.png"}, + tiles = {"mcl_barrels_barrel_top.png^[transformR270", "mcl_barrels_barrel_bottom.png", "mcl_barrels_barrel_side.png"}, paramtype = "light", paramtype2 = "facedir", --on_place = mcl_util.rotate_axis, @@ -104,16 +106,16 @@ minetest.register_node("mcl_chests:barrel_closed", { _mcl_hardness = 2.5, }) -minetest.register_node("mcl_chests:barrel_open", { +minetest.register_node("mcl_barrels:barrel_open", { description = S("Barrel Open"), _tt_help = S("27 inventory slots"), _doc_items_longdesc = S("Barrels are containers which provide 27 inventory slots."), _doc_items_usagehelp = S("To access its inventory, rightclick it. When broken, the items will drop out."), _doc_items_create_entry = false, - tiles = {"mcl_chests_barrel_top_open.png", "mcl_chests_barrel_bottom.png", "mcl_chests_barrel_side.png"}, + tiles = {"mcl_barrels_barrel_top_open.png", "mcl_barrels_barrel_bottom.png", "mcl_barrels_barrel_side.png"}, paramtype = "light", paramtype2 = "facedir", - drop = "mcl_chests:barrel_closed", + drop = "mcl_barrels:barrel_closed", stack_max = 64, sounds = mcl_sounds.node_sound_wood_defaults(), groups = {handy = 1, axey = 1, container = 2, material_wood = 1, flammable = -1, deco_block = 1, not_in_creative_inventory = 1}, @@ -126,7 +128,7 @@ minetest.register_node("mcl_chests:barrel_open", { }) minetest.register_on_player_receive_fields(function(player, formname, fields) - if formname:find("mcl_chests:barrel") == 1 and fields.quit then + if formname:find("mcl_barrels:") == 1 and fields.quit then close_barrel(player) end end) @@ -137,10 +139,10 @@ end) --Minecraft Java Edition craft minetest.register_craft({ - output = "mcl_chests:barrel_closed", + output = "mcl_barrels:barrel_closed", recipe = { {"group:wood", "group:wood_slab", "group:wood"}, {"group:wood", "", "group:wood"}, {"group:wood", "group:wood_slab", "group:wood"}, - }, + } }) \ No newline at end of file diff --git a/mods/ITEMS/mcl_barrels/locale/mcl_barrels.de.tr b/mods/ITEMS/mcl_barrels/locale/mcl_barrels.de.tr new file mode 100644 index 0000000000..e1fa1b603a --- /dev/null +++ b/mods/ITEMS/mcl_barrels/locale/mcl_barrels.de.tr @@ -0,0 +1,5 @@ +# textdomain: mcl_barrels +Barrel= +Barrels are containers which provide 27 inventory slots.= +To access its inventory, rightclick it. When broken, the items will drop out.= +27 inventory slots= \ No newline at end of file diff --git a/mods/ITEMS/mcl_barrels/locale/mcl_barrels.es.tr b/mods/ITEMS/mcl_barrels/locale/mcl_barrels.es.tr new file mode 100644 index 0000000000..e1fa1b603a --- /dev/null +++ b/mods/ITEMS/mcl_barrels/locale/mcl_barrels.es.tr @@ -0,0 +1,5 @@ +# textdomain: mcl_barrels +Barrel= +Barrels are containers which provide 27 inventory slots.= +To access its inventory, rightclick it. When broken, the items will drop out.= +27 inventory slots= \ No newline at end of file diff --git a/mods/ITEMS/mcl_barrels/locale/mcl_barrels.fr.tr b/mods/ITEMS/mcl_barrels/locale/mcl_barrels.fr.tr new file mode 100644 index 0000000000..0e93d1ee5a --- /dev/null +++ b/mods/ITEMS/mcl_barrels/locale/mcl_barrels.fr.tr @@ -0,0 +1,5 @@ +# textdomain: mcl_barrels +Barrel=Tonneau +Barrels are containers which provide 27 inventory slots.=Les tonneaux sont des conteneurs qui offrent 27 emplacements d'inventaire. +To access its inventory, rightclick it. When broken, the items will drop out.=Pour accéder à son inventaire, faites un clic droit dessus. Une fois cassés, les articles tomberont. +27 inventory slots=27 emplacements d'inventaire \ No newline at end of file diff --git a/mods/ITEMS/mcl_barrels/locale/mcl_barrels.pl.tr b/mods/ITEMS/mcl_barrels/locale/mcl_barrels.pl.tr new file mode 100644 index 0000000000..e1fa1b603a --- /dev/null +++ b/mods/ITEMS/mcl_barrels/locale/mcl_barrels.pl.tr @@ -0,0 +1,5 @@ +# textdomain: mcl_barrels +Barrel= +Barrels are containers which provide 27 inventory slots.= +To access its inventory, rightclick it. When broken, the items will drop out.= +27 inventory slots= \ No newline at end of file diff --git a/mods/ITEMS/mcl_barrels/locale/mcl_barrels.ru.tr b/mods/ITEMS/mcl_barrels/locale/mcl_barrels.ru.tr new file mode 100644 index 0000000000..e1fa1b603a --- /dev/null +++ b/mods/ITEMS/mcl_barrels/locale/mcl_barrels.ru.tr @@ -0,0 +1,5 @@ +# textdomain: mcl_barrels +Barrel= +Barrels are containers which provide 27 inventory slots.= +To access its inventory, rightclick it. When broken, the items will drop out.= +27 inventory slots= \ No newline at end of file diff --git a/mods/ITEMS/mcl_barrels/locale/template.txt b/mods/ITEMS/mcl_barrels/locale/template.txt new file mode 100644 index 0000000000..e1fa1b603a --- /dev/null +++ b/mods/ITEMS/mcl_barrels/locale/template.txt @@ -0,0 +1,5 @@ +# textdomain: mcl_barrels +Barrel= +Barrels are containers which provide 27 inventory slots.= +To access its inventory, rightclick it. When broken, the items will drop out.= +27 inventory slots= \ No newline at end of file diff --git a/mods/ITEMS/mcl_barrels/mod.conf b/mods/ITEMS/mcl_barrels/mod.conf new file mode 100644 index 0000000000..2b0088b79d --- /dev/null +++ b/mods/ITEMS/mcl_barrels/mod.conf @@ -0,0 +1,3 @@ +name = mcl_barrels +depends = mcl_util, mcl_formspec, mcl_sounds +author = AFCMS \ No newline at end of file diff --git a/mods/ITEMS/mcl_chests/textures/mcl_chests_barrel_bottom.png b/mods/ITEMS/mcl_barrels/textures/mcl_barrels_barrel_bottom.png similarity index 100% rename from mods/ITEMS/mcl_chests/textures/mcl_chests_barrel_bottom.png rename to mods/ITEMS/mcl_barrels/textures/mcl_barrels_barrel_bottom.png diff --git a/mods/ITEMS/mcl_chests/textures/mcl_chests_barrel_side.png b/mods/ITEMS/mcl_barrels/textures/mcl_barrels_barrel_side.png similarity index 100% rename from mods/ITEMS/mcl_chests/textures/mcl_chests_barrel_side.png rename to mods/ITEMS/mcl_barrels/textures/mcl_barrels_barrel_side.png diff --git a/mods/ITEMS/mcl_chests/textures/mcl_chests_barrel_top.png b/mods/ITEMS/mcl_barrels/textures/mcl_barrels_barrel_top.png similarity index 100% rename from mods/ITEMS/mcl_chests/textures/mcl_chests_barrel_top.png rename to mods/ITEMS/mcl_barrels/textures/mcl_barrels_barrel_top.png diff --git a/mods/ITEMS/mcl_chests/textures/mcl_chests_barrel_top_open.png b/mods/ITEMS/mcl_barrels/textures/mcl_barrels_barrel_top_open.png similarity index 100% rename from mods/ITEMS/mcl_chests/textures/mcl_chests_barrel_top_open.png rename to mods/ITEMS/mcl_barrels/textures/mcl_barrels_barrel_top_open.png diff --git a/mods/ITEMS/mcl_chests/init.lua b/mods/ITEMS/mcl_chests/init.lua index b4cadcef1c..35712dfd16 100644 --- a/mods/ITEMS/mcl_chests/init.lua +++ b/mods/ITEMS/mcl_chests/init.lua @@ -1419,5 +1419,3 @@ minetest.register_lbm({ minetest.get_meta(pos):set_string("formspec", "") end, }) - -dofile(minetest.get_modpath("mcl_chests").."/barrel.lua") \ No newline at end of file diff --git a/mods/ITEMS/mcl_chests/locale/mcl_chests.fr.tr b/mods/ITEMS/mcl_chests/locale/mcl_chests.fr.tr index 0956c8705c..b84dac0221 100644 --- a/mods/ITEMS/mcl_chests/locale/mcl_chests.fr.tr +++ b/mods/ITEMS/mcl_chests/locale/mcl_chests.fr.tr @@ -34,5 +34,3 @@ Can be combined to a large chest=Peut être combiné à un grand coffre 27 interdimensional inventory slots=27 emplacements d'inventaire interdimensionnels Put items inside, retrieve them from any ender chest=Mettez des objets à l'intérieur, récupérez-les dans n'importe quel coffre Emits a redstone signal when opened=Émet un signal redstone à l'ouverture -Barrel=Tonneau -Barrels are containers which provide 27 inventory slots.=Les tonneaux sont des conteneurs qui offrent 27 emplacements d'inventaire. diff --git a/mods/ITEMS/mcl_chests/locale/template.txt b/mods/ITEMS/mcl_chests/locale/template.txt index fffeaaac79..d680c24c9d 100644 --- a/mods/ITEMS/mcl_chests/locale/template.txt +++ b/mods/ITEMS/mcl_chests/locale/template.txt @@ -34,5 +34,3 @@ Can be combined to a large chest= 27 interdimensional inventory slots= Put items inside, retrieve them from any ender chest= Emits a redstone signal when opened= -Barrel= -Barrels are containers which provide 27 inventory slots.=