Copyright (C) 2012 PilzAdam
modified by BlockMen (added sounds, glassdoors[glass, obsidian glass], trapdoor)
Steel trapdoor added by sofar.
-Copyright (C) 2015 sofar@foo-projects.org
+Copyright (C) 2016 sofar@foo-projects.org
Re-implemented most of the door algorithms, added meshes, UV wrapped texture
Added doors API to facilitate coding mods accessing and operating doors.
+Added Fence Gate model, code, and sounds
This program is free software. It comes without any warranty, to
the extent permitted by applicable law. You can redistribute it
doors_trapdoor_steel_side.png
door_trapdoor_side.png
-Door 3d models by sofar (CC-BY-SA-3.0)
- door_a.obj
- door_b.obj
Obsidian door textures by red-001 based on textures by Pilzadam and BlockMen: WTFPL
door_obsidian_glass.png
Door textures were converted to the new texture map by sofar, paramat and
red-001, under the same license as the originals.
+Models:
+--------------------------------------
+Door 3d models by sofar (CC-BY-SA-3.0)
+ - door_a.obj
+ - door_b.obj
+Fence gate models by sofar (CC-BY-SA-3.0)
+ - fencegate_open.obj
+ - fencegate_closed.obj
License of sounds
--------------------------------------
door_open.ogg
Closing-Sound created by bennstir (CC BY 3.0)
door_close.ogg
+fencegate_open.ogg:
+ http://www.freesound.org/people/mhtaylor67/sounds/126041/ - CC0
+fencegate_close.ogg:
+ http://www.freesound.org/people/BarkersPinhead/sounds/274807/ - CC-BY-3.0
+ http://www.freesound.org/people/rivernile7/sounds/249573/ - CC-BY-3.0
+
}
})
+
+----fence gate----
+
+local fence = {
+ description = "Fence Gate",
+ drawtype = "mesh",
+ tiles = {"default_wood.png"},
+ paramtype = "light",
+ paramtype2 = "facedir",
+ sunlight_propagates = true,
+ is_ground_content = false,
+ drop = "doors:gate_closed",
+ connect_sides = { "left", "right" },
+ groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2,
+ flammable = 2, fence = 1},
+ on_rightclick = function(pos, clicker)
+ local node = minetest.get_node(pos)
+ local def = minetest.registered_nodes[node.name]
+ minetest.swap_node(pos, {name = def.gate, param2 = node.param2})
+ minetest.sound_play(def.sound, {pos = pos, gain = 0.3,
+ max_hear_distance = 8})
+ end,
+ selection_box = {
+ type = "fixed",
+ fixed = {-1/2, -1/2, -1/4, 1/2, 1/2, 1/4},
+ },
+}
+
+local fence_closed = table.copy(fence)
+fence_closed.mesh = "doors_fencegate_closed.obj"
+fence_closed.gate = "doors:gate_open"
+fence_closed.sound = "doors_fencegate_open"
+fence_closed.collision_box = {
+ type = "fixed",
+ fixed = {-1/2, -1/2, -1/4, 1/2, 1/2, 1/4},
+}
+
+local fence_open = table.copy(fence)
+fence_open.mesh = "doors_fencegate_open.obj"
+fence_open.gate = "doors:gate_closed"
+fence_open.sound = "doors_fencegate_close"
+fence_open.groups.not_in_creative_inventory = 1
+fence_open.collision_box = {
+ type = "fixed",
+ fixed = {{-1/2, -1/2, -1/4, -3/8, 1/2, 1/4},
+ {-5/8, -3/8, -14/16, -3/8, 3/8, 0}},
+}
+
+minetest.register_node("doors:gate_closed", fence_closed)
+minetest.register_node("doors:gate_open", fence_open)
+
+minetest.register_craft({
+ output = "doors:gate_closed",
+ recipe = {
+ {"default:stick", "group:wood", "default:stick"},
+ {"default:stick", "group:wood", "default:stick"},
+ },
+})
+
--- /dev/null
+# Blender v2.76 (sub 0) OBJ File: 'gate_closed.blend'
+# www.blender.org
+mtllib gate_closed.mtl
+o Cube_Cube.001
+v -0.625000 -0.500000 0.125000
+v -0.625000 0.500000 0.125000
+v -0.625000 -0.500000 -0.125000
+v -0.625000 0.500000 -0.125000
+v -0.375000 -0.500000 0.125000
+v -0.375000 0.500000 0.125000
+v -0.375000 -0.500000 -0.125000
+v -0.375000 0.500000 -0.125000
+v 0.375000 -0.500000 0.125000
+v 0.375000 0.500000 0.125000
+v 0.375000 -0.500000 -0.125000
+v 0.375000 0.500000 -0.125000
+v 0.625000 -0.500000 0.125000
+v 0.625000 0.500000 0.125000
+v 0.625000 -0.500000 -0.125000
+v 0.625000 0.500000 -0.125000
+v -0.375000 0.187500 0.062500
+v -0.375000 0.312500 0.062500
+v -0.375000 0.187500 -0.062500
+v -0.375000 0.312500 -0.062500
+v 0.375000 0.187500 0.062500
+v 0.375000 0.312500 0.062500
+v 0.375000 0.187500 -0.062500
+v 0.375000 0.312500 -0.062500
+v -0.374831 0.187348 0.062500
+v -0.156342 0.187363 0.062500
+v -0.374831 0.187348 -0.062500
+v -0.156342 0.187363 -0.062500
+v 0.374981 -0.343683 0.062500
+v 0.375065 -0.187304 0.062500
+v 0.374981 -0.343683 -0.062500
+v 0.375065 -0.187304 -0.062500
+vt 0.000000 0.750000
+vt 0.000000 0.500000
+vt 1.000000 0.500000
+vt 1.000000 0.750000
+vt 1.000000 1.000000
+vt -0.000000 1.000000
+vt 1.000000 -0.000000
+vt 1.000000 0.250000
+vt 0.000000 0.250000
+vt -0.000000 0.000000
+vt 0.250000 0.000000
+vt 0.250000 0.250000
+vt 0.250000 0.750000
+vt 0.250000 1.000000
+vt 0.500000 -0.000000
+vt 0.500000 0.250000
+vt 0.500000 0.750000
+vt 0.500000 1.000000
+vt 1.000000 0.625000
+vt 0.000000 0.625000
+vt 1.000000 0.875000
+vt 0.000000 0.875000
+vt -0.000000 0.687500
+vt 0.000000 0.562500
+vt 1.000000 0.562500
+vt 1.000000 0.687500
+vt 0.813740 0.249033
+vt 0.201557 0.249293
+vt 0.120995 0.125498
+vt 0.987404 0.125469
+vt 0.125000 0.375000
+vt 0.812500 0.375000
+vt 0.937500 0.500000
+vt 0.062500 0.500000
+vt 0.000000 0.125000
+vt 1.000000 0.125000
+vt 0.312500 0.437500
+vt 0.312500 0.312500
+vt 1.000000 0.312500
+vt 1.000000 0.437500
+vn -1.000000 0.000000 0.000000
+vn 0.000000 0.000000 -1.000000
+vn 1.000000 0.000000 0.000000
+vn 0.000000 0.000000 1.000000
+vn 0.000000 -1.000000 0.000000
+vn 0.000000 1.000000 0.000000
+vn -0.578000 -0.816100 0.000000
+vn 0.576200 0.817300 0.000000
+usemtl None
+s off
+f 2/1/1 4/2/1 3/3/1 1/4/1
+f 4/4/2 8/5/2 7/6/2 3/1/2
+f 8/7/3 6/8/3 5/9/3 7/10/3
+f 6/2/4 2/9/4 1/8/4 5/3/4
+f 1/9/5 3/10/5 7/11/5 5/12/5
+f 6/6/6 8/1/6 4/13/6 2/14/6
+f 10/1/1 12/2/1 11/3/1 9/4/1
+f 12/2/2 16/9/2 15/8/2 11/3/2
+f 16/7/3 14/8/3 13/9/3 15/10/3
+f 14/4/4 10/5/4 9/6/4 13/1/4
+f 9/12/5 11/11/5 15/15/5 13/16/5
+f 14/14/6 16/13/6 12/17/6 10/18/6
+f 20/2/2 24/3/2 23/19/2 19/20/2
+f 22/1/4 18/4/4 17/21/4 21/22/4
+f 17/23/5 19/24/5 23/25/5 21/26/5
+f 22/21/6 24/5/6 20/6/6 18/22/6
+f 28/27/2 32/28/2 31/29/2 27/30/2
+f 30/31/4 26/32/4 25/33/4 29/34/4
+f 25/35/7 27/10/7 31/7/7 29/36/7
+f 30/37/8 32/38/8 28/39/8 26/40/8
--- /dev/null
+# Blender v2.76 (sub 0) OBJ File: 'gate_open.blend'
+# www.blender.org
+mtllib gate_open.mtl
+o Cube_Cube.001
+v -0.625000 -0.500000 0.125000
+v -0.625000 0.500000 0.125000
+v -0.625000 -0.500000 -0.125000
+v -0.625000 0.500000 -0.125000
+v -0.375000 -0.500000 0.125000
+v -0.375000 0.500000 0.125000
+v -0.375000 -0.500000 -0.125000
+v -0.375000 0.500000 -0.125000
+v 0.375000 -0.500000 0.125000
+v 0.375000 0.500000 0.125000
+v 0.375000 -0.500000 -0.125000
+v 0.375000 0.500000 -0.125000
+v 0.625000 -0.500000 0.125000
+v 0.625000 0.500000 0.125000
+v 0.625000 -0.500000 -0.125000
+v 0.625000 0.500000 -0.125000
+v 0.434859 0.187500 -0.872359
+v 0.434859 0.312500 -0.872359
+v 0.559859 0.187500 -0.872359
+v 0.559859 0.312500 -0.872359
+v 0.434859 0.187500 -0.122359
+v 0.434859 0.312500 -0.122359
+v 0.559859 0.187500 -0.122359
+v 0.559859 0.312500 -0.122359
+v 0.434859 0.187348 -0.872190
+v 0.434859 0.187363 -0.653701
+v 0.559859 0.187348 -0.872190
+v 0.559859 0.187363 -0.653701
+v 0.434859 -0.343683 -0.122379
+v 0.434859 -0.187304 -0.122294
+v 0.559859 -0.343683 -0.122379
+v 0.559859 -0.187304 -0.122294
+v 0.499560 -0.442900 0.005495
+vt 0.000000 0.750000
+vt 0.000000 0.500000
+vt 1.000000 0.500000
+vt 1.000000 0.750000
+vt 1.000000 1.000000
+vt -0.000000 1.000000
+vt 1.000000 -0.000000
+vt 1.000000 0.250000
+vt 0.000000 0.250000
+vt -0.000000 0.000000
+vt 0.250000 0.000000
+vt 0.250000 0.250000
+vt 0.250000 0.750000
+vt 0.250000 1.000000
+vt 0.500000 -0.000000
+vt 0.500000 0.250000
+vt 0.500000 0.750000
+vt 0.500000 1.000000
+vt 1.000000 0.625000
+vt 0.000000 0.625000
+vt 1.000000 0.875000
+vt 0.000000 0.875000
+vt -0.000000 0.687500
+vt 0.000000 0.562500
+vt 1.000000 0.562500
+vt 1.000000 0.687500
+vt 0.813740 0.249033
+vt 0.201557 0.249293
+vt 0.120995 0.125498
+vt 0.987404 0.125469
+vt 0.125000 0.375000
+vt 0.812500 0.375000
+vt 0.937500 0.500000
+vt 0.062500 0.500000
+vt 0.000000 0.125000
+vt 1.000000 0.125000
+vt 0.312500 0.437500
+vt 0.312500 0.312500
+vt 1.000000 0.312500
+vt 1.000000 0.437500
+vt 0.312500 0.625000
+vt 0.312500 0.500000
+vt 0.187500 0.500000
+vt 0.187500 0.625000
+vn -1.000000 0.000000 0.000000
+vn 0.000000 0.000000 -1.000000
+vn 1.000000 0.000000 0.000000
+vn 0.000000 0.000000 1.000000
+vn 0.000000 -1.000000 0.000000
+vn 0.000000 1.000000 0.000000
+vn 0.000000 -0.816100 -0.578000
+vn 0.000000 0.817300 0.576200
+usemtl None
+s off
+f 2/1/1 4/2/1 3/3/1 1/4/1
+f 4/4/2 8/5/2 7/6/2 3/1/2
+f 8/7/3 6/8/3 5/9/3 7/10/3
+f 6/2/4 2/9/4 1/8/4 5/3/4
+f 1/9/5 3/10/5 7/11/5 5/12/5
+f 6/6/6 8/1/6 4/13/6 2/14/6
+f 10/1/1 12/2/1 11/3/1 9/4/1
+f 12/2/2 16/9/2 15/8/2 11/3/2
+f 16/7/3 14/8/3 13/9/3 15/10/3
+f 14/4/4 10/5/4 9/6/4 13/1/4
+f 9/12/5 11/11/5 15/15/5 13/16/5
+f 14/14/6 16/13/6 12/17/6 10/18/6
+f 20/2/3 24/3/3 23/19/3 19/20/3
+f 22/1/1 18/4/1 17/21/1 21/22/1
+f 17/23/5 19/24/5 23/25/5 21/26/5
+f 22/21/6 24/5/6 20/6/6 18/22/6
+f 28/27/3 32/28/3 31/29/3 27/30/3
+f 30/31/1 26/32/1 25/33/1 29/34/1
+f 25/35/7 27/10/7 31/7/7 29/36/7
+f 30/37/8 32/38/8 28/39/8 26/40/8
+f 17/41/2 18/42/2 20/43/2 19/44/2