mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-11-18 00:08:25 +01:00
Fixed texture, and animation bug in 3dchest
- 3dChests can't be open if the two nodes standing behing them are not air - 3dChests now use our textures in inventory, wield, and entity - Solves #221
This commit is contained in:
parent
7f211b53cc
commit
195a0822a2
1
mods/3dchest/depends.txt
Normal file
1
mods/3dchest/depends.txt
Normal file
@ -0,0 +1 @@
|
||||
default
|
@ -81,8 +81,7 @@ minetest.register_node("3dchest:chest", {
|
||||
tiles = {"default_chest_top.png", "default_chest_top.png", "default_chest_side.png",
|
||||
"default_chest_side.png", "default_chest_side.png", "default_chest_front.png"},
|
||||
paramtype2 = "facedir",
|
||||
-- temporary workaround
|
||||
wield_image = "default_chest_front.png", --minetest.inventorycube("default_chest_top.png", "default_chest_side.png", "default_chest_front.png"),
|
||||
wield_image = minetest.inventorycube("default_chest_top.png", "default_chest_front.png", "default_chest_side.png"),
|
||||
inventory_image = minetest.inventorycube("default_chest_top.png", "default_chest_front.png", "default_chest_side.png"),
|
||||
drawtype = "nodebox",
|
||||
node_box = {
|
||||
@ -225,6 +224,20 @@ minetest.register_node("3dchest:chest", {
|
||||
local name = '3dchest:3dchest'
|
||||
local pll = clicker:get_player_name()
|
||||
local formspec = meta:get_string('formspect')
|
||||
local dir = (meta:get_int("dir")+2)%4
|
||||
local directions = {
|
||||
[0] = {x = pos.x, y = pos.y, z = pos.z + 1},
|
||||
[1] = {x = pos.x - 1, y = pos.y, z = pos.z},
|
||||
[2] = {x = pos.x, y = pos.y, z = pos.z - 1},
|
||||
[3] = {x = pos.x + 1, y = pos.y, z = pos.z}
|
||||
}
|
||||
local backnode = minetest.get_node(directions[dir])
|
||||
local upnode = minetest.get_node({x = directions[dir].x, y = directions[dir].y + 1, z = directions[dir].z})
|
||||
if (not backnode or (backnode and backnode.name ~= "air"))
|
||||
or (not upnode or (upnode and upnode.name ~= "air")) then
|
||||
minetest.chat_send_player(clicker:get_player_name(), "Cannot open chest's lid, move it.")
|
||||
return
|
||||
end
|
||||
|
||||
if not self then
|
||||
minetest.show_formspec(pll, name..'_'..minetest.serialize(pos), formspec)
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.2 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
Before Width: | Height: | Size: 838 B |
Binary file not shown.
Before Width: | Height: | Size: 843 B |
Loading…
Reference in New Issue
Block a user