diff --git a/init.lua b/init.lua index 06d5b35..9235433 100644 --- a/init.lua +++ b/init.lua @@ -126,20 +126,27 @@ local function return_remove_next(allowed_name) return remove_next end + + local function log_access(pos, player, text) minetest.log("action", player:get_player_name().. " moves stuff "..text.." at "..minetest.pos_to_string(pos)) end +-- Adds the big chests + +local top_texture = "connected_chests_top.png^default_chest_top.png^([combine:16x16:5,0=default_chest_top.png^connected_chests_frame.png^[makealpha:255,126,126)^connected_chests_top.png" +local side_texture = "connected_chests_side.png^default_chest_side.png^([combine:16x16:5,0=default_chest_side.png^connected_chests_frame.png^[makealpha:255,126,126)^connected_chests_side.png" + local chest = table.copy(minetest.registered_nodes["default:chest"]) chest.description = nil chest.legacy_facedir_simple = nil chest.after_place_node = nil chest.on_construct = nil chest.on_receive_fields = nil -chest.tiles = {"connected_chests_top.png", "connected_chests_top.png", "default_obsidian_glass.png", - "default_chest_side.png", "connected_chests_side.png^[transformFX", "connected_chests_side.png^connected_chests_front.png"} +chest.tiles = {top_texture, top_texture, "default_obsidian_glass.png", + "default_chest_side.png", side_texture.."^[transformFX", side_texture.."^connected_chests_front.png"} chest.drop = "default:chest 2" chest.selection_box = { type = "fixed", @@ -161,15 +168,14 @@ end minetest.register_node("connected_chests:chest_left", chest) - local chest_locked = table.copy(minetest.registered_nodes["default:chest_locked"]) chest_locked.description = nil chest_locked.legacy_facedir_simple = nil chest_locked.after_place_node = nil chest_locked.on_construct = nil chest_locked.on_receive_fields = nil -chest_locked.tiles = {"connected_chests_top.png", "connected_chests_top.png", "default_obsidian_glass.png", - "default_chest_side.png", "connected_chests_side.png^[transformFX", "connected_chests_side.png^connected_chests_lock.png"} +chest_locked.tiles = {top_texture, top_texture, "default_obsidian_glass.png", + "default_chest_side.png", side_texture.."^[transformFX", side_texture.."^connected_chests_front.png^connected_chests_lock.png"} chest_locked.drop = "default:chest_locked 2" chest_locked.selection_box = { type = "fixed", @@ -204,8 +210,8 @@ minetest.register_node("connected_chests:chest_locked_left", chest_locked) minetest.register_node("connected_chests:chest_right", { - tiles = {"connected_chests_top.png^[transformFX", "connected_chests_top.png^[transformFX", "default_chest_side.png", - "default_obsidian_glass.png", "connected_chests_side.png", "connected_chests_side.png^connected_chests_front.png^[transformFX"}, + tiles = {top_texture.."^[transformFX", top_texture.."^[transformFX", "default_chest_side.png", + "default_obsidian_glass.png", side_texture, side_texture.."^connected_chests_front.png^[transformFX"}, paramtype2 = "facedir", drop = "", pointable = false, @@ -213,14 +219,15 @@ minetest.register_node("connected_chests:chest_right", { }) minetest.register_node("connected_chests:chest_locked_right", { - tiles = {"connected_chests_top.png^[transformFX", "connected_chests_top.png^[transformFX", "default_chest_side.png", - "default_obsidian_glass.png", "connected_chests_side.png", "connected_chests_side.png^connected_chests_lock.png^[transformFX"}, + tiles = {top_texture.."^[transformFX", top_texture.."^[transformFX", "default_chest_side.png", + "default_obsidian_glass.png", side_texture, side_texture.."^connected_chests_front.png^connected_chests_lock.png^[transformFX"}, paramtype2 = "facedir", drop = "", pointable = false, diggable = false, }) +-- abms to fix half chests for _,i in pairs({"chest", "chest_locked"}) do minetest.register_abm ({ nodenames = {"connected_chests:"..i.."_right"}, diff --git a/textures/connected_chests_frame.png b/textures/connected_chests_frame.png new file mode 100644 index 0000000..c7af3f9 Binary files /dev/null and b/textures/connected_chests_frame.png differ diff --git a/textures/connected_chests_front.png b/textures/connected_chests_front.png index fc1b629..5b9e68b 100644 Binary files a/textures/connected_chests_front.png and b/textures/connected_chests_front.png differ diff --git a/textures/connected_chests_lock.png b/textures/connected_chests_lock.png index 842d849..1dca172 100644 Binary files a/textures/connected_chests_lock.png and b/textures/connected_chests_lock.png differ diff --git a/textures/connected_chests_side.png b/textures/connected_chests_side.png index b0b19a7..ada6be5 100644 Binary files a/textures/connected_chests_side.png and b/textures/connected_chests_side.png differ diff --git a/textures/connected_chests_top.png b/textures/connected_chests_top.png deleted file mode 100644 index 1056ef5..0000000 Binary files a/textures/connected_chests_top.png and /dev/null differ diff --git a/textures/connected_chests_top.png b/textures/connected_chests_top.png new file mode 120000 index 0000000..ae4a17c --- /dev/null +++ b/textures/connected_chests_top.png @@ -0,0 +1 @@ +connected_chests_side.png \ No newline at end of file