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