support texture packs

This commit is contained in:
HybridDog 2015-04-18 15:05:26 +02:00
parent f31f96b4bd
commit cf0b3a4915
6 changed files with 16 additions and 9 deletions

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 B

After

Width:  |  Height:  |  Size: 105 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 162 B

After

Width:  |  Height:  |  Size: 113 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 627 B

After

Width:  |  Height:  |  Size: 74 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 561 B

After

Width:  |  Height:  |  Size: 25 B

View File

@ -0,0 +1 @@
connected_chests_side.png

Before

Width:  |  Height:  |  Size: 561 B

After

Width:  |  Height:  |  Size: 25 B