From 1f000e760da90bb8355dac088578890b71e6a1b5 Mon Sep 17 00:00:00 2001 From: AFCMS Date: Tue, 22 Feb 2022 17:55:52 +0100 Subject: [PATCH] move barrels to mcl_chests --- .../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 -- .../init.lua => mcl_chests/barrel.lua} | 30 ++++++++---------- 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 ++ .../textures/mcl_chests_barrel_bottom.png} | Bin .../textures/mcl_chests_barrel_side.png} | Bin .../textures/mcl_chests_barrel_top.png} | Bin .../textures/mcl_chests_barrel_top_open.png} | Bin 15 files changed, 20 insertions(+), 49 deletions(-) delete mode 100644 mods/ITEMS/mcl_barrels/locale/mcl_barrels.de.tr delete mode 100644 mods/ITEMS/mcl_barrels/locale/mcl_barrels.es.tr delete mode 100644 mods/ITEMS/mcl_barrels/locale/mcl_barrels.fr.tr delete mode 100644 mods/ITEMS/mcl_barrels/locale/mcl_barrels.pl.tr delete mode 100644 mods/ITEMS/mcl_barrels/locale/mcl_barrels.ru.tr delete mode 100644 mods/ITEMS/mcl_barrels/locale/template.txt delete mode 100644 mods/ITEMS/mcl_barrels/mod.conf rename mods/ITEMS/{mcl_barrels/init.lua => mcl_chests/barrel.lua} (81%) rename mods/ITEMS/{mcl_barrels/textures/mcl_barrels_barrel_bottom.png => mcl_chests/textures/mcl_chests_barrel_bottom.png} (100%) rename mods/ITEMS/{mcl_barrels/textures/mcl_barrels_barrel_side.png => mcl_chests/textures/mcl_chests_barrel_side.png} (100%) rename mods/ITEMS/{mcl_barrels/textures/mcl_barrels_barrel_top.png => mcl_chests/textures/mcl_chests_barrel_top.png} (100%) rename mods/ITEMS/{mcl_barrels/textures/mcl_barrels_barrel_top_open.png => mcl_chests/textures/mcl_chests_barrel_top_open.png} (100%) diff --git a/mods/ITEMS/mcl_barrels/locale/mcl_barrels.de.tr b/mods/ITEMS/mcl_barrels/locale/mcl_barrels.de.tr deleted file mode 100644 index e1fa1b603a..0000000000 --- a/mods/ITEMS/mcl_barrels/locale/mcl_barrels.de.tr +++ /dev/null @@ -1,5 +0,0 @@ -# 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 deleted file mode 100644 index e1fa1b603a..0000000000 --- a/mods/ITEMS/mcl_barrels/locale/mcl_barrels.es.tr +++ /dev/null @@ -1,5 +0,0 @@ -# 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 deleted file mode 100644 index 0e93d1ee5a..0000000000 --- a/mods/ITEMS/mcl_barrels/locale/mcl_barrels.fr.tr +++ /dev/null @@ -1,5 +0,0 @@ -# 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 deleted file mode 100644 index e1fa1b603a..0000000000 --- a/mods/ITEMS/mcl_barrels/locale/mcl_barrels.pl.tr +++ /dev/null @@ -1,5 +0,0 @@ -# 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 deleted file mode 100644 index e1fa1b603a..0000000000 --- a/mods/ITEMS/mcl_barrels/locale/mcl_barrels.ru.tr +++ /dev/null @@ -1,5 +0,0 @@ -# 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 deleted file mode 100644 index e1fa1b603a..0000000000 --- a/mods/ITEMS/mcl_barrels/locale/template.txt +++ /dev/null @@ -1,5 +0,0 @@ -# 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 deleted file mode 100644 index 2b0088b79d..0000000000 --- a/mods/ITEMS/mcl_barrels/mod.conf +++ /dev/null @@ -1,3 +0,0 @@ -name = mcl_barrels -depends = mcl_util, mcl_formspec, mcl_sounds -author = AFCMS \ No newline at end of file diff --git a/mods/ITEMS/mcl_barrels/init.lua b/mods/ITEMS/mcl_chests/barrel.lua similarity index 81% rename from mods/ITEMS/mcl_barrels/init.lua rename to mods/ITEMS/mcl_chests/barrel.lua index 964f23fde4..bc62165786 100644 --- a/mods/ITEMS/mcl_barrels/init.lua +++ b/mods/ITEMS/mcl_chests/barrel.lua @@ -1,9 +1,7 @@ -local S = minetest.get_translator("mcl_barrels") +local S = minetest.get_translator("mcl_chests") 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") @@ -24,7 +22,7 @@ local function barrel_open(pos, node, clicker) local playername = clicker:get_player_name() minetest.show_formspec(playername, - "mcl_barrels:barrel_"..pos.x.."_"..pos.y.."_"..pos.z, + "mcl_chests:barrel_"..pos.x.."_"..pos.y.."_"..pos.z, table.concat({ "size[9,8.75]", "label[0,0;"..F(C("#313131", name)).."]", @@ -40,13 +38,13 @@ local function barrel_open(pos, node, clicker) }) ) - minetest.swap_node(pos, { name = "mcl_barrels:barrel_open", param2 = node.param2 }) + minetest.swap_node(pos, { name = "mcl_chests:barrel_open", param2 = node.param2 }) open_barrels[playername] = pos end local function close_forms(pos) local players = minetest.get_connected_players() - local formname = "mcl_barrels:barrel_"..pos.x.."_"..pos.y.."_"..pos.z + local formname = "mcl_chests: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) @@ -57,8 +55,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_barrels:barrel_open" then - minetest.swap_node(pos, {name = "mcl_barrels:barrel_closed", param2 = node.param2}) + if node.name == "mcl_chests:barrel_open" then + minetest.swap_node(pos, {name = "mcl_chests:barrel_closed", param2 = node.param2}) end end @@ -74,12 +72,12 @@ local function close_barrel(player) open_barrels[name] = nil end -minetest.register_node("mcl_barrels:barrel_closed", { +minetest.register_node("mcl_chests: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_barrels_barrel_top.png^[transformR270", "mcl_barrels_barrel_bottom.png", "mcl_barrels_barrel_side.png"}, + tiles = {"mcl_chests_barrel_top.png^[transformR270", "mcl_chests_barrel_bottom.png", "mcl_chests_barrel_side.png"}, paramtype = "light", paramtype2 = "facedir", --on_place = mcl_util.rotate_axis, @@ -106,16 +104,16 @@ minetest.register_node("mcl_barrels:barrel_closed", { _mcl_hardness = 2.5, }) -minetest.register_node("mcl_barrels:barrel_open", { +minetest.register_node("mcl_chests: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_barrels_barrel_top_open.png", "mcl_barrels_barrel_bottom.png", "mcl_barrels_barrel_side.png"}, + tiles = {"mcl_chests_barrel_top_open.png", "mcl_chests_barrel_bottom.png", "mcl_chests_barrel_side.png"}, paramtype = "light", paramtype2 = "facedir", - drop = "mcl_barrels:barrel_closed", + drop = "mcl_chests: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}, @@ -128,7 +126,7 @@ minetest.register_node("mcl_barrels:barrel_open", { }) minetest.register_on_player_receive_fields(function(player, formname, fields) - if formname:find("mcl_barrels:") == 1 and fields.quit then + if formname:find("mcl_chests:barrel") == 1 and fields.quit then close_barrel(player) end end) @@ -139,10 +137,10 @@ end) --Minecraft Java Edition craft minetest.register_craft({ - output = "mcl_barrels:barrel_closed", + output = "mcl_chests: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_chests/init.lua b/mods/ITEMS/mcl_chests/init.lua index 35712dfd16..b4cadcef1c 100644 --- a/mods/ITEMS/mcl_chests/init.lua +++ b/mods/ITEMS/mcl_chests/init.lua @@ -1419,3 +1419,5 @@ 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 b84dac0221..0956c8705c 100644 --- a/mods/ITEMS/mcl_chests/locale/mcl_chests.fr.tr +++ b/mods/ITEMS/mcl_chests/locale/mcl_chests.fr.tr @@ -34,3 +34,5 @@ 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 d680c24c9d..fffeaaac79 100644 --- a/mods/ITEMS/mcl_chests/locale/template.txt +++ b/mods/ITEMS/mcl_chests/locale/template.txt @@ -34,3 +34,5 @@ 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.= diff --git a/mods/ITEMS/mcl_barrels/textures/mcl_barrels_barrel_bottom.png b/mods/ITEMS/mcl_chests/textures/mcl_chests_barrel_bottom.png similarity index 100% rename from mods/ITEMS/mcl_barrels/textures/mcl_barrels_barrel_bottom.png rename to mods/ITEMS/mcl_chests/textures/mcl_chests_barrel_bottom.png diff --git a/mods/ITEMS/mcl_barrels/textures/mcl_barrels_barrel_side.png b/mods/ITEMS/mcl_chests/textures/mcl_chests_barrel_side.png similarity index 100% rename from mods/ITEMS/mcl_barrels/textures/mcl_barrels_barrel_side.png rename to mods/ITEMS/mcl_chests/textures/mcl_chests_barrel_side.png diff --git a/mods/ITEMS/mcl_barrels/textures/mcl_barrels_barrel_top.png b/mods/ITEMS/mcl_chests/textures/mcl_chests_barrel_top.png similarity index 100% rename from mods/ITEMS/mcl_barrels/textures/mcl_barrels_barrel_top.png rename to mods/ITEMS/mcl_chests/textures/mcl_chests_barrel_top.png diff --git a/mods/ITEMS/mcl_barrels/textures/mcl_barrels_barrel_top_open.png b/mods/ITEMS/mcl_chests/textures/mcl_chests_barrel_top_open.png similarity index 100% rename from mods/ITEMS/mcl_barrels/textures/mcl_barrels_barrel_top_open.png rename to mods/ITEMS/mcl_chests/textures/mcl_chests_barrel_top_open.png