Drop falling node in multiplayer, add falling for furniture

This commit is contained in:
MoNTE48 2019-06-30 20:29:05 +02:00
parent 100a0e3348
commit 37ab30c2cc
8 changed files with 28 additions and 32 deletions

View File

@ -197,7 +197,7 @@ end
function core.check_single_for_falling(p)
local n = core.get_node(p)
if core.get_item_group(n.name, "falling_node") ~= 0 then
if core.get_item_group(n.name, "falling_node") ~= 0 and core.is_singleplayer() then
local p_bottom = {x = p.x, y = p.y - 1, z = p.z}
-- Only spawn falling node if node below is loaded
local n_bottom = core.get_node_or_nil(p_bottom)
@ -224,6 +224,13 @@ function core.check_single_for_falling(p)
end
end
if core.get_item_group(n.name, "falling_node") ~= 0 and not core.is_singleplayer() then
if not builtin_shared.check_attached_node(p, n) then
drop_attached_node(p)
return true
end
end
if core.get_item_group(n.name, "attached_node") ~= 0 then
if not builtin_shared.check_attached_node(p, n) then
drop_attached_node(p)

View File

@ -61,6 +61,9 @@ function beds.register_bed(name, def)
end
for _, p in pairs({pos_front, pos}) do
local node_def = minetest.registered_nodes[minetest.get_node(p).name]
if node_def.buildable_to then
minetest.remove_node(pos_front)
end
if not node_def or not node_def.buildable_to then
return itemstack
end

View File

@ -190,20 +190,6 @@ minetest.register_node("default:redsand", {
sounds = default.node_sound_sand_defaults(),
})
if not minetest.is_singleplayer() then
minetest.override_item("default:sand", {
groups = {crumbly = 3, falling_node = 0, sand = 1},
})
minetest.override_item("default:gravel", {
groups = {crumbly = 2, falling_node = 0},
})
minetest.override_item("default:redsand", {
groups = {crumbly = 3, falling_node = 0, redsand = 1},
})
end
minetest.register_node("default:clay", {
description = "Clay",
tiles = {"default_clay.png"},
@ -262,7 +248,6 @@ minetest.register_node("default:snowblock", {
end,
})
-- 'is ground content = false' to avoid tunnels in sea ice or ice rivers
minetest.register_node("default:ice", {
description = "Ice",
drawtype = "glasslike",

View File

@ -1,5 +1,5 @@
MultiCraft Game mod: ts_furniture
=================================
MultiCraft Game mod: furniture
==============================
https://github.com/minetest-mods/ts_furniture

View File

@ -135,7 +135,8 @@ function ts_furniture.register_furniture(recipe, description, texture)
return
end
local groups = {}
local groups = {falling_node = 1}
for k, v in pairs(recipe_def.groups) do
if not ignore_groups[k] then
groups[k] = v

View File

@ -346,32 +346,32 @@ local stairs_aliases = {
for i=1, #nodes do
local node = nodes[i]
for _, d in pairs(workbench.defs) do
minetest.register_alias("stairs:"..d[1].."_"..node:match(":(.*)"), "stairs:"..d[1].."_"..node:gsub(":", "_"))
minetest.register_alias("stairs:"..d[1].."_"..node:match(":(.*)"), "stairs:"..d[1].."_"..node:gsub(":", "_"))
end
for _, e in pairs(stairs_aliases) do
minetest.register_alias("stairs:"..e[1].."_"..node:match(":(.*)"), "stairs:"..e[2].."_"..node:gsub(":", "_"))
minetest.register_alias("stairs:"..e[1].."_"..node:gsub(":", "_"), "stairs:"..e[2].."_"..node:gsub(":", "_"))
minetest.register_alias("stairs:"..e[1].."_"..node:match(":(.*)"), "stairs:"..e[2].."_"..node:gsub(":", "_"))
minetest.register_alias("stairs:"..e[1].."_"..node:gsub(":", "_"), "stairs:"..e[2].."_"..node:gsub(":", "_"))
end
end
for _, d in pairs(workbench.defs) do
minetest.register_alias("stairs:"..d[1].."_coal", "stairs:"..d[1].."_default_coalblock")
minetest.register_alias("stairs:"..d[1].."_coal", "stairs:"..d[1].."_default_coalblock")
end
for _, e in pairs(stairs_aliases) do
minetest.register_alias("stairs:"..e[1].."_coal", "stairs:"..e[2].."_default_coalblock")
minetest.register_alias("stairs:"..e[1].."_coal", "stairs:"..e[2].."_default_coalblock")
end
minetest.register_alias("stairs:stair_steel", "stairs:stair_default_steelblock")
minetest.register_alias("stairs:slab_steel", "stairs:slab_default_steelblock")
minetest.register_alias("stairs:corner_steel", "stairs:corner_default_steelblock")
minetest.register_alias("stairs:stair_gold", "stairs:stair_default_goldblock")
minetest.register_alias("stairs:slab_gold", "stairs:slab_default_goldblock")
minetest.register_alias("stairs:corner_gold", "stairs:corner_default_goldblock")
minetest.register_alias("stairs:stair_diamond", "stairs:stair_default_diamondblock")
minetest.register_alias("stairs:slab_diamond", "stairs:slab_default_diamondblock")
minetest.register_alias("stairs:stair_steel", "stairs:stair_default_steelblock")
minetest.register_alias("stairs:slab_steel", "stairs:slab_default_steelblock")
minetest.register_alias("stairs:corner_steel", "stairs:corner_default_steelblock")
minetest.register_alias("stairs:stair_gold", "stairs:stair_default_goldblock")
minetest.register_alias("stairs:slab_gold", "stairs:slab_default_goldblock")
minetest.register_alias("stairs:corner_gold", "stairs:corner_default_goldblock")
minetest.register_alias("stairs:stair_diamond", "stairs:stair_default_diamondblock")
minetest.register_alias("stairs:slab_diamond", "stairs:slab_default_diamondblock")
minetest.register_alias("stairs:corner_diamond", "stairs:corner_default_diamondblock")
-- Craft items