1
0
Fork 0

Revert "move barrels to mcl_chests"

This reverts commit a272322cb5.
This commit is contained in:
AFCMS 2022-02-22 20:20:21 +01:00
parent 61f4c5b885
commit 360a1604ba
Signed by untrusted user: AFCMS
GPG Key ID: 8720389A25B652E3
15 changed files with 49 additions and 20 deletions

View File

@ -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"},
},
}
})

View File

@ -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=

View File

@ -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=

View File

@ -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

View File

@ -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=

View File

@ -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=

View File

@ -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=

View File

@ -0,0 +1,3 @@
name = mcl_barrels
depends = mcl_util, mcl_formspec, mcl_sounds
author = AFCMS

View File

Before

Width:  |  Height:  |  Size: 542 B

After

Width:  |  Height:  |  Size: 542 B

View File

Before

Width:  |  Height:  |  Size: 499 B

After

Width:  |  Height:  |  Size: 499 B

View File

Before

Width:  |  Height:  |  Size: 566 B

After

Width:  |  Height:  |  Size: 566 B

View File

Before

Width:  |  Height:  |  Size: 421 B

After

Width:  |  Height:  |  Size: 421 B

View File

@ -1419,5 +1419,3 @@ minetest.register_lbm({
minetest.get_meta(pos):set_string("formspec", "")
end,
})
dofile(minetest.get_modpath("mcl_chests").."/barrel.lua")

View File

@ -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.

View File

@ -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.=