This commit is contained in:
tchncs 2016-03-18 18:51:32 +01:00
commit 02c87c3b01
21 changed files with 114 additions and 41 deletions

View File

@ -1,3 +1,27 @@
local reverse = true
local function destruct_bed(pos, n)
local node = minetest.get_node(pos)
local other
if n == 2 then
local dir = minetest.facedir_to_dir(node.param2)
other = vector.subtract(pos, dir)
elseif n == 1 then
local dir = minetest.facedir_to_dir(node.param2)
other = vector.add(pos, dir)
end
if reverse then
reverse = not reverse
minetest.remove_node(other)
nodeupdate(other)
else
reverse = not reverse
end
end
function beds.register_bed(name, def)
minetest.register_node(name .. "_bottom", {
description = def.description,
@ -39,14 +63,7 @@ function beds.register_bed(name, def)
end,
on_destruct = function(pos)
local n = minetest.get_node_or_nil(pos)
if not n then return end
local dir = minetest.facedir_to_dir(n.param2)
local p = vector.add(pos, dir)
local n2 = minetest.get_node(p)
if minetest.get_item_group(n2.name, "bed") == 2 and n.param2 == n2.param2 then
minetest.remove_node(p)
end
destruct_bed(pos, 1)
end,
on_rightclick = function(pos, node, clicker)
@ -95,10 +112,14 @@ function beds.register_bed(name, def)
pointable = false,
groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, bed = 2},
sounds = default.node_sound_wood_defaults(),
drop = name .. "_bottom",
node_box = {
type = "fixed",
fixed = def.nodebox.top,
},
on_destruct = function(pos)
destruct_bed(pos, 2)
end,
})
minetest.register_alias(name, name .. "_bottom")

View File

@ -5,7 +5,7 @@ bones = {}
local function is_owner(pos, name)
local owner = minetest.get_meta(pos):get_string("owner")
if owner == "" or owner == name or minetest.check_player_privs(placer, "protection_bypass") then
if owner == "" or owner == name or minetest.check_player_privs(name, "protection_bypass") then
return true
end
return false

View File

@ -178,6 +178,7 @@ Gambit (WTFPL):
default_diamond_block.png
default_ladder_steel.png
default_sign_wall_wood.png
default_flint.png
asl97 (WTFPL):
default_ice.png

View File

@ -190,3 +190,9 @@ minetest.register_craftitem("default:obsidian_shard", {
description = "Obsidian Shard",
inventory_image = "default_obsidian_shard.png",
})
minetest.register_craftitem("default:flint", {
description = "Flint",
inventory_image = "default_flint.png"
})

Binary file not shown.

View File

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@ -353,9 +353,15 @@ minetest.register_node("default:gravel", {
footstep = {name = "default_gravel_footstep", gain = 0.5},
dug = {name = "default_gravel_footstep", gain = 1.0},
}),
drop = {
max_items = 1,
items = {
{items = {'default:flint'}, rarity = 16},
{items = {'default:gravel'}}
}
}
})
minetest.register_node("default:clay", {
description = "Clay",
tiles = {"default_clay.png"},

Binary file not shown.

Before

Width:  |  Height:  |  Size: 235 B

After

Width:  |  Height:  |  Size: 280 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -75,4 +75,7 @@ fencegate_open.ogg:
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
Steel door sounds (open & close (CC-BY-3.0) by HazMatt
- http://www.freesound.org/people/HazMattt/sounds/187283/
doors_steel_door_open.ogg
doors_steel_door_close.ogg

View File

@ -287,6 +287,9 @@ function doors.register(name, def)
if not def.protected then
return true
end
if minetest.check_player_privs(digger, "protection_bypass") then
return true
end
local meta = minetest.get_meta(pos)
local name = ""
if digger then
@ -438,6 +441,8 @@ doors.register("door_steel", {
inventory_image = "doors_item_steel.png",
protected = true,
groups = { snappy = 1, bendy = 2, cracky = 1, melty = 2, level = 2 },
sound_open = "doors_steel_door_open",
sound_close = "doors_steel_door_close",
recipe = {
{"default:steel_ingot", "default:steel_ingot"},
{"default:steel_ingot", "default:steel_ingot"},
@ -628,6 +633,8 @@ doors.register_trapdoor("doors:trapdoor_steel", {
tile_front = "doors_trapdoor_steel.png",
tile_side = "doors_trapdoor_steel_side.png",
protected = true,
sound_open = "doors_steel_door_open",
sound_close = "doors_steel_door_close",
groups = {snappy=1, bendy=2, cracky=1, melty=2, level=2, door=1},
})

View File

@ -3,21 +3,21 @@
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.500100 0.125000
v -0.625000 -0.500000 -0.125000
v -0.625000 0.500000 -0.125000
v -0.625000 0.500100 -0.125000
v -0.375000 -0.500000 0.125000
v -0.375000 0.500000 0.125000
v -0.375000 0.500100 0.125000
v -0.375000 -0.500000 -0.125000
v -0.375000 0.500000 -0.125000
v -0.375000 0.500100 -0.125000
v 0.375000 -0.500000 0.125000
v 0.375000 0.500000 0.125000
v 0.375000 0.500100 0.125000
v 0.375000 -0.500000 -0.125000
v 0.375000 0.500000 -0.125000
v 0.375000 0.500100 -0.125000
v 0.625000 -0.500000 0.125000
v 0.625000 0.500000 0.125000
v 0.625000 0.500100 0.125000
v 0.625000 -0.500000 -0.125000
v 0.625000 0.500000 -0.125000
v 0.625000 0.500100 -0.125000
v -0.375000 0.187500 0.062500
v -0.375000 0.312500 0.062500
v -0.375000 0.187500 -0.062500

View File

@ -3,21 +3,21 @@
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.500100 0.125000
v -0.625000 -0.500000 -0.125000
v -0.625000 0.500000 -0.125000
v -0.625000 0.500100 -0.125000
v -0.375000 -0.500000 0.125000
v -0.375000 0.500000 0.125000
v -0.375000 0.500100 0.125000
v -0.375000 -0.500000 -0.125000
v -0.375000 0.500000 -0.125000
v -0.375000 0.500100 -0.125000
v 0.375000 -0.500000 0.125000
v 0.375000 0.500000 0.125000
v 0.375000 0.500100 0.125000
v 0.375000 -0.500000 -0.125000
v 0.375000 0.500000 -0.125000
v 0.375000 0.500100 -0.125000
v 0.625000 -0.500000 0.125000
v 0.625000 0.500000 0.125000
v 0.625000 0.500100 0.125000
v 0.625000 -0.500000 -0.125000
v 0.625000 0.500000 -0.125000
v 0.625000 0.500100 -0.125000
v 0.434859 0.187500 -0.872359
v 0.434859 0.312500 -0.872359
v 0.559859 0.187500 -0.872359

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 B

After

Width:  |  Height:  |  Size: 186 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 186 B

View File

@ -30,3 +30,7 @@ fire_large.ogg sampled from:
fire_basic_flame_animated.png:
Muadtralk
fire_flint_steel.png
Gambit (WTFPL)

View File

@ -8,7 +8,6 @@ fire = {}
-- Register flame nodes
minetest.register_node("fire:basic_flame", {
description = "Basic Flame",
drawtype = "firelike",
tiles = {
{
@ -28,7 +27,7 @@ minetest.register_node("fire:basic_flame", {
buildable_to = true,
sunlight_propagates = true,
damage_per_second = 4,
groups = {igniter = 2, dig_immediate = 3},
groups = {igniter = 2, dig_immediate = 3, not_in_creative_inventory = 1},
drop = "",
on_construct = function(pos)
@ -71,6 +70,34 @@ minetest.register_node("fire:permanent_flame", {
end,
})
minetest.register_tool("fire:flint_and_steel", {
description = "Flint and Steel",
inventory_image = "fire_flint_steel.png",
on_use = function(itemstack, user, pointed_thing)
local player_name = user:get_player_name()
local pt = pointed_thing
if pt.type == "node" and minetest.get_node(pt.above).name == "air" then
if not minetest.is_protected(pt.above, player_name) then
minetest.set_node(pt.above, {name="fire:basic_flame"})
else
minetest.chat_send_player(player_name, "This area is protected")
end
end
if not minetest.setting_getbool("creative_mode") then
itemstack:add_wear(1000)
return itemstack
end
end
})
minetest.register_craft({
output = "fire:flint_and_steel",
recipe = {
{"default:flint", "default:steel_ingot"}
}
})
-- Get sound area of position
@ -227,22 +254,20 @@ else
catch_up = false,
action = function(p0, node, _, _)
-- If there are no flammable nodes around flame, remove flame
if not minetest.find_node_near(p0, 1, {"group:flammable"}) then
local p = minetest.find_node_near(p0, 1, {"group:flammable"})
if not p then
minetest.remove_node(p0)
return
end
if math.random(1, 4) == 1 then
-- remove flammable nodes around flame
local p = minetest.find_node_near(p0, 1, {"group:flammable"})
if p then
local node = minetest.get_node(p)
local def = minetest.registered_nodes[node.name]
if def.on_burn then
def.on_burn(p)
else
minetest.remove_node(p)
nodeupdate(p)
end
local node = minetest.get_node(p)
local def = minetest.registered_nodes[node.name]
if def.on_burn then
def.on_burn(p)
else
minetest.remove_node(p)
nodeupdate(p)
end
end
end,

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -29,7 +29,7 @@ walls.register = function(wall_name, wall_desc, wall_texture, wall_mat, wall_sou
connect_back = {{-3/16, -1/2, 1/4, 3/16, 3/8, 1/2}},
connect_right = {{ 1/4, -1/2, -3/16, 1/2, 3/8, 3/16}},
},
connects_to = { "group:cracky", "group:wall", "group:stone" },
connects_to = { "group:wall", "group:stone" },
paramtype = "light",
is_ground_content = false,
tiles = { wall_texture, },