Version MFF.
This commit is contained in:
parent
c2a5f1a46d
commit
73fadbc33a
0
README.txt
Normal file → Executable file
0
README.txt
Normal file → Executable file
0
depends.txt
Normal file → Executable file
0
depends.txt
Normal file → Executable file
82
init.lua
Normal file → Executable file
82
init.lua
Normal file → Executable file
@ -12,48 +12,48 @@ local function find_dock(pos, second)
|
||||
return false
|
||||
end
|
||||
|
||||
local h1 = minetest.env:get_node({x=pos.x+1, y=pos.y, z=pos.z})
|
||||
local v1 = minetest.env:get_node({x=pos.x-1, y=pos.y, z=pos.z})
|
||||
local r1 = minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z+1})
|
||||
local l1 = minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z-1})
|
||||
local h1 = minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z})
|
||||
local v1 = minetest.get_node({x=pos.x-1, y=pos.y, z=pos.z})
|
||||
local r1 = minetest.get_node({x=pos.x, y=pos.y, z=pos.z+1})
|
||||
local l1 = minetest.get_node({x=pos.x, y=pos.y, z=pos.z-1})
|
||||
local code = 0
|
||||
if dockable(l1.name) then
|
||||
code = code+1
|
||||
if second < 2 then
|
||||
minetest.env:punch_node({x=pos.x, y=pos.y, z=pos.z-1})
|
||||
minetest.punch_node({x=pos.x, y=pos.y, z=pos.z-1})
|
||||
end
|
||||
end
|
||||
if dockable(r1.name) then
|
||||
code = code+2
|
||||
if second < 2 then
|
||||
minetest.env:punch_node({x=pos.x, y=pos.y, z=pos.z+1})
|
||||
minetest.punch_node({x=pos.x, y=pos.y, z=pos.z+1})
|
||||
end
|
||||
end
|
||||
if dockable(v1.name) then
|
||||
code = code+11
|
||||
if second < 2 then
|
||||
minetest.env:punch_node({x=pos.x-1, y=pos.y, z=pos.z})
|
||||
minetest.punch_node({x=pos.x-1, y=pos.y, z=pos.z})
|
||||
end
|
||||
end
|
||||
if dockable(h1.name) then
|
||||
code = code+21
|
||||
if second < 2 then
|
||||
minetest.env:punch_node({x=pos.x+1, y=pos.y, z=pos.z})
|
||||
minetest.punch_node({x=pos.x+1, y=pos.y, z=pos.z})
|
||||
end
|
||||
end
|
||||
local me = minetest.env:get_node(pos)
|
||||
local me = minetest.get_node(pos)
|
||||
if code > 0 then
|
||||
local tmp_name = "fences:fence_wood_"..code
|
||||
--minetest.chat_send_all(tmp_name)
|
||||
local tmp_node = {name=tmp_name, param1=me.param1, param2=me.param2}
|
||||
if second > 0 then
|
||||
local tmp_node = {name=tmp_name, param1=me.param1, param2=me.param2}
|
||||
minetest.env:set_node(pos, tmp_node)
|
||||
minetest.set_node(pos, tmp_node)
|
||||
end
|
||||
elseif code == 0 then
|
||||
if second == 2 then
|
||||
local tmp_node = {name="fences:fence_wood", param1=me.param1, param2=me.param2}
|
||||
minetest.env:set_node(pos, tmp_node)
|
||||
minetest.set_node(pos, tmp_node)
|
||||
end
|
||||
end
|
||||
|
||||
@ -69,29 +69,30 @@ end
|
||||
|
||||
|
||||
local p0 = {-2/16, -1/2, -2/16, 2/16, 1/2, 2/16}
|
||||
local p1 = {-2/16, 1/2, -2/16, -2/16, 1/2+8/16, -2/16}
|
||||
local p2 = {-2/16, 1/2, 2/16, -2/16, 1/2+8/16, 2/16}
|
||||
local p4 = {2/16, 1/2, -2/16, 2/16, 1/2+8/16, -2/16}
|
||||
local p5 = {2/16, 1/2, 2/16, 2/16, 1/2+8/16, 2/16}
|
||||
local p1 = {-2/16, 1/2, -2/16, -2/16, 1/2--[[+8/16]], -2/16}
|
||||
local p2 = {-2/16, 1/2, 2/16, -2/16, 1/2--[[+8/16]], 2/16}
|
||||
local p3 = {0, 0, 0, 0, 0, 0}
|
||||
local p4 = {2/16, 1/2, -2/16, 2/16, 1/2--[[+8/16]], -2/16}
|
||||
local p5 = {2/16, 1/2, 2/16, 2/16, 1/2--[[+8/16]], 2/16}
|
||||
|
||||
local x1 = {-2/16, 1/2-4/16, 1/16, -1/2, 1/2-1/16, -1/16} --oben(quer) -x
|
||||
local x12 = {-2/16, -1/2+6/16, 1/16, -1/2, -1/2+9/16, -1/16} --unten(quer) -x
|
||||
local x12 = {-2/16, -1/2+6/16, 1/16, -1/2, -1/2--[[+9/16]], -1/16} --unten(quer) -x
|
||||
local x2 = {2/16, 1/2-4/16, -1/16, 1/2, 1/2-1/16, 1/16} --oben(quer) x
|
||||
local x22 = {2/16, -1/2+6/16, -1/16, 1/2, -1/2+9/16, 1/16} --unten(quer) x
|
||||
local x22 = {2/16, -1/2+6/16, -1/16, 1/2, -1/2--[[+9/16]], 1/16} --unten(quer) x
|
||||
local z1 = {1/16, 1/2-4/16, -2/16, -1/16, 1/2-1/16, -1/2} --oben(quer) -z
|
||||
local z12 = {1/16, -1/2+6/16, -2/16, -1/16, -1/2+9/16, -1/2} --unten(quer) -z
|
||||
local z12 = {1/16, -1/2+6/16, -2/16, -1/16, -1/2--[[+9/16]], -1/2} --unten(quer) -z
|
||||
local z2 = {-1/16, 1/2-4/16, 2/16, 1/16, 1/2-1/16, 1/2} --oben(quer) z
|
||||
local z22 = {-1/16, -1/2+6/16, 2/16, 1/16, -1/2+9/16, 1/2} --unten(quer) z
|
||||
local z22 = {-1/16, -1/2+6/16, 2/16, 1/16, -1/2--[[+9/16]], 1/2} --unten(quer) z
|
||||
|
||||
local bz1 = {1/16, 1/2-1/16, -6/16, 1/16, 1/2+8/16, -6/16} --oben_block(quer) -z 1seite
|
||||
local bz11 = {-1/16, 1/2-1/16, -6/16, -1/16, 1/2+8/16, -6/16} --oben_block(quer) -z 2seite
|
||||
local bz2 = {1/16, 1/2-1/16, 5/16, 1/16, 1/2+8/16, 5/16} --oben_block(quer) z 1seite
|
||||
local bz21 = {-1/16, 1/2-1/16, 5/16, -1/16, 1/2+8/16, 5/16} --oben_block(quer) z 2seite
|
||||
local bz1 = {1/16, 1/2-1/16, -6/16, 1/16, 1/2--[[+8/16]], -6/16} --oben_block(quer) -z 1seite
|
||||
local bz11 = {-1/16, 1/2-1/16, -6/16, -1/16, 1/2--[[+8/16]], -6/16} --oben_block(quer) -z 2seite
|
||||
local bz2 = {1/16, 1/2-1/16, 5/16, 1/16, 1/2--[[+8/16]], 5/16} --oben_block(quer) z 1seite
|
||||
local bz21 = {-1/16, 1/2-1/16, 5/16, -1/16, 1/2--[[+8/16]], 5/16} --oben_block(quer) z 2seite
|
||||
|
||||
local bx1 = {-6/16, 1/2-1/16, 1/16, -6/16, 1/2+8/16, 1/16} --oben_block(quer) -x 1seite
|
||||
local bx11 = {-6/16, 1/2-1/16, -1/16, -6/16, 1/2+8/16, -1/16} --oben_block(quer) -x 2seite
|
||||
local bx2 = {5/16, 1/2-1/16, 1/16, 5/16, 1/2+8/16, 1/16} --oben_block(quer) x 1seite
|
||||
local bx21 = {5/16, 1/2-1/16, -1/16, 5/16, 1/2+8/16, -1/16} --oben_block(quer) x 2seite
|
||||
local bx1 = {-6/16, 1/2-1/16, 1/16, -6/16, 1/2--[[+8/16]], 1/16} --oben_block(quer) -x 1seite
|
||||
local bx11 = {-6/16, 1/2-1/16, -1/16, -6/16, 1/2--[[+8/16]], -1/16} --oben_block(quer) -x 2seite
|
||||
local bx2 = {5/16, 1/2-1/16, 1/16, 5/16, 1/2--[[+8/16]], 1/16} --oben_block(quer) x 1seite
|
||||
local bx21 = {5/16, 1/2-1/16, -1/16, 5/16, 1/2--[[+8/16]], -1/16} --oben_block(quer) x 2seite
|
||||
|
||||
|
||||
minetest.register_node("fences:fence_wood", {
|
||||
@ -100,7 +101,7 @@ minetest.register_node("fences:fence_wood", {
|
||||
inventory_image = "default_fence.png",
|
||||
wield_image = "default_fence.png",
|
||||
paramtype = "light",
|
||||
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2,fences=1},
|
||||
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2,fences=1,not_in_creative_inventory=1},
|
||||
drop = 'fences:fence_wood',
|
||||
sunlight_propagates = true,
|
||||
drawtype = "nodebox",
|
||||
@ -448,7 +449,7 @@ minetest.register_node("fences:fence_wood_33", { --left(1)+top+bottom(32)=33
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
p0,p1,p2,p3,p4,p5,
|
||||
z1,z12,x1,x12,x2,x21,
|
||||
z1,z12,x1,x12,x2,x22,
|
||||
bz1,bz11,bx1,bx11,bx2,bx21,
|
||||
}
|
||||
},
|
||||
@ -549,7 +550,7 @@ minetest.register_node("fences:fence_wood_13", { --right(2)+top(11)=13
|
||||
})
|
||||
|
||||
|
||||
|
||||
--[[
|
||||
minetest.register_craft({
|
||||
output = 'fences:fence_wood 2',
|
||||
recipe = {
|
||||
@ -557,7 +558,7 @@ minetest.register_craft({
|
||||
{'default:stick', 'default:stick', 'default:stick'},
|
||||
{'', '', ''},
|
||||
}
|
||||
})
|
||||
})]]
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'fences:fencegate',
|
||||
@ -575,20 +576,20 @@ local meta2
|
||||
local state2 = 0
|
||||
|
||||
local function update_gate(pos, node)
|
||||
minetest.env:set_node(pos, node)
|
||||
minetest.set_node(pos, node)
|
||||
end
|
||||
|
||||
local function punch_gate(pos, node)
|
||||
meta2 = minetest.env:get_meta(pos)
|
||||
meta2 = minetest.get_meta(pos)
|
||||
state2 = meta2:get_int("state")
|
||||
local tmp_node2
|
||||
if state2 == 1 then
|
||||
state2 = 0
|
||||
minetest.sound_play("door_close", {gain = 0.3, max_hear_distance = 10})
|
||||
minetest.sound_play("doors_door_close", {gain = 0.3, max_hear_distance = 10})
|
||||
tmp_node2 = {name="fences:fencegate", param1=node.param1, param2=node.param2}
|
||||
else
|
||||
state2 = 1
|
||||
minetest.sound_play("door_open", {gain = 0.3, max_hear_distance = 10})
|
||||
minetest.sound_play("doors_door_open", {gain = 0.3, max_hear_distance = 10})
|
||||
tmp_node2 = {name="fences:fencegate_open", param1=node.param1, param2=node.param2}
|
||||
end
|
||||
update_gate(pos, tmp_node2)
|
||||
@ -622,8 +623,8 @@ minetest.register_node("fences:fencegate_open", {
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-1/2, -1/2+5/16, -1/16, -1/2+2/16, 1/2, 1/2}, --links
|
||||
{1/2, -1/2+5/16, -1/16, 1/2, 1/2, 1/2-2/16}, --rechts
|
||||
{-0.5, -0.5+5/16, -1/16, -1/2+2/16, 1/2, 1/2}, --links
|
||||
{ 0.5, -1/2+5/16, -1/16, 1/2-2/16, 1/2, 1/2}, --rechts
|
||||
}
|
||||
},
|
||||
--on_punch = function(pos, node, puncher)
|
||||
@ -669,8 +670,7 @@ minetest.register_node("fences:fencegate", {
|
||||
}
|
||||
},
|
||||
on_construct = function(pos)
|
||||
me2 = minetest.env:get_node(pos)
|
||||
meta2 = minetest.env:get_meta(pos)
|
||||
meta2 = minetest.get_meta(pos)
|
||||
meta2:set_int("state", 0)
|
||||
state2 = 0
|
||||
find_dock(pos, -1)
|
||||
@ -691,8 +691,8 @@ if override_original == true then
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local tmp_node3 = {name="fences:fence_wood"}
|
||||
minetest.env:set_node(pos, tmp_node3)
|
||||
minetest.env:punch_node(pos)
|
||||
minetest.set_node(pos, tmp_node3)
|
||||
minetest.punch_node(pos)
|
||||
end
|
||||
})
|
||||
end
|
BIN
textures/default_fence.png
Executable file
BIN
textures/default_fence.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 429 B |
0
textures/fences_fencegate.png
Normal file → Executable file
0
textures/fences_fencegate.png
Normal file → Executable file
Before Width: | Height: | Size: 580 B After Width: | Height: | Size: 580 B |
Loading…
Reference in New Issue
Block a user