merge github.com/minetest/minetest_game

This commit is contained in:
tchncs 2016-09-01 14:07:55 +02:00
commit d2dcd64203
41 changed files with 610 additions and 396 deletions

View file

@ -42,7 +42,7 @@ end
local function eject_drops(drops, pos, radius)
local drop_pos = vector.new(pos)
for _, item in pairs(drops) do
local count = item:get_count()
local count = math.min(item:get_count(), item:get_stack_max())
while count > 0 do
local take = math.max(1,math.min(radius * radius,
count,
@ -78,7 +78,6 @@ local function add_drop(drops, item)
end
end
local function destroy(drops, npos, cid, c_air, c_fire, on_blast_queue, ignore_protection, ignore_on_blast)
if not ignore_protection and minetest.is_protected(npos, "") then
return cid
@ -102,7 +101,6 @@ local function destroy(drops, npos, cid, c_air, c_fire, on_blast_queue, ignore_p
end
end
local function calc_velocity(pos1, pos2, old_vel, power)
-- Avoid errors caused by a vector of zero length
if vector.equals(pos1, pos2) then
@ -488,28 +486,31 @@ minetest.register_node("tnt:gunpowder_burning", {
end,
})
minetest.register_abm({
nodenames = {"group:tnt", "tnt:gunpowder"},
neighbors = {"fire:basic_flame", "default:lava_source", "default:lava_flowing"},
interval = 4,
chance = 1,
action = tnt.burn,
})
minetest.register_craft({
output = "tnt:gunpowder",
type = "shapeless",
recipe = {"default:coal_lump", "default:gravel"}
})
minetest.register_craft({
output = "tnt:tnt",
recipe = {
{"", "group:wood", ""},
{"group:wood", "tnt:gunpowder", "group:wood"},
{"", "group:wood", ""}
}
})
if enable_tnt then
minetest.register_craft({
output = "tnt:tnt",
recipe = {
{"", "group:wood", ""},
{"group:wood", "tnt:gunpowder", "group:wood"},
{"", "group:wood", ""}
}
})
minetest.register_abm({
label = "TNT ignition",
nodenames = {"group:tnt", "tnt:gunpowder"},
neighbors = {"fire:basic_flame", "default:lava_source", "default:lava_flowing"},
interval = 4,
chance = 1,
action = tnt.burn,
})
end
function tnt.register_tnt(def)
local name
@ -588,4 +589,3 @@ tnt.register_tnt({
description = "TNT",
radius = tnt_radius,
})