diff --git a/files/bluestone/mesecons_button/init.lua b/files/bluestone/mesecons_button/init.lua index 9e90aba..043831f 100644 --- a/files/bluestone/mesecons_button/init.lua +++ b/files/bluestone/mesecons_button/init.lua @@ -42,6 +42,12 @@ minetest.register_node("mesecons_button:button_stone_off", { minetest.sound_play("mesecons_button_push", {pos=pos}) minetest.get_node_timer(pos):start(1) end, + on_rightclick = function (pos, node) + minetest.swap_node(pos, {name = "mesecons_button:button_stone_on", param2=node.param2}) + mesecon.receptor_on(pos, mesecon.rules.buttonlike_get(node)) + minetest.sound_play("mesecons_button_push", {pos=pos}) + minetest.get_node_timer(pos):start(1) + end, sounds = default.node_sound_stone_defaults(), mesecons = {receptor = { state = mesecon.state.off, @@ -105,6 +111,12 @@ minetest.register_node("mesecons_button:button_wood_off", { minetest.sound_play("mesecons_button_push", {pos=pos}) minetest.get_node_timer(pos):start(1) end, + on_rightclick = function (pos, node) + minetest.swap_node(pos, {name = "mesecons_button:button_wood_on", param2=node.param2}) + mesecon.receptor_on(pos, mesecon.rules.buttonlike_get(node)) + minetest.sound_play("mesecons_button_push", {pos=pos}) + minetest.get_node_timer(pos):start(1) + end, sounds = default.node_sound_stone_defaults(), mesecons = {receptor = { state = mesecon.state.off, diff --git a/files/bluestone/mesecons_delayer/init.lua b/files/bluestone/mesecons_delayer/init.lua index 02f17f6..4eafe3e 100644 --- a/files/bluestone/mesecons_delayer/init.lua +++ b/files/bluestone/mesecons_delayer/init.lua @@ -36,9 +36,9 @@ end for i = 1, 4 do local groups = {} if i == 1 then - groups = {bendy = 2, snappy = 1, dig_immediate = 2} + groups = {bendy = 2, snappy = 1, dig_immediate = 2, attached_node = 1} else - groups = {bendy = 2, snappy = 1, dig_immediate = 2, not_in_creative_inventory = 1} + groups = {bendy = 2, snappy = 1, dig_immediate = 2, attached_node = 1, not_in_creative_inventory = 1} end local delaytime diff --git a/files/bluestone/mesecons_lightstone/init.lua b/files/bluestone/mesecons_lightstone/init.lua index 630c54a..7cb52a6 100644 --- a/files/bluestone/mesecons_lightstone/init.lua +++ b/files/bluestone/mesecons_lightstone/init.lua @@ -32,7 +32,7 @@ minetest.register_node("mesecons_lightstone:lightstone_off", { minetest.register_node("mesecons_lightstone:lightstone_on", { tiles = {"jeija_lightstone_gray_on.png"}, is_ground_content = false, - groups = {cracky=2,not_in_creative_inventory=1, mesecon = 2}, + groups = {cracky=2, not_in_creative_inventory=1, mesecon = 2}, drop = "mesecons_lightstone:lightstone_off", light_source = minetest.LIGHT_MAX - 2, sounds = default.node_sound_glass_defaults(), diff --git a/files/bluestone/mesecons_noteblock/init.lua b/files/bluestone/mesecons_noteblock/init.lua index d7aa135..0fb8d6b 100644 --- a/files/bluestone/mesecons_noteblock/init.lua +++ b/files/bluestone/mesecons_noteblock/init.lua @@ -3,6 +3,7 @@ minetest.register_node("mesecons_noteblock:noteblock", { tiles = {"mesecons_noteblock.png"}, is_ground_content = false, groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 2}, + stack_max = 1, on_punch = function (pos, node) -- change sound when punched node.param2 = (node.param2+1)%12 mesecon.noteblock_play(pos, node.param2) diff --git a/files/bluestone/mesecons_pistons/init.lua b/files/bluestone/mesecons_pistons/init.lua index e9ebb54..c1cb23f 100644 --- a/files/bluestone/mesecons_pistons/init.lua +++ b/files/bluestone/mesecons_pistons/init.lua @@ -65,7 +65,7 @@ local piston_remove_pusher = function (pos, node) return end - minetest.remove_node(pusherpos) + minetest.remove_node(pusherpos) minetest.sound_play("piston_retract", { pos = pos, max_hear_distance = 20, @@ -174,6 +174,7 @@ minetest.register_node("mesecons_pistons:piston_normal_off", { "mesecons_piston_pusher_front.png" }, groups = {cracky = 3}, + stack_max = 1, paramtype2 = "facedir", after_place_node = piston_orientate, mesecons_piston = pistonspec_normal, @@ -253,6 +254,7 @@ minetest.register_node("mesecons_pistons:piston_sticky_off", { "mesecons_piston_pusher_front_sticky.png" }, groups = {cracky = 3}, + stack_max = 1, paramtype2 = "facedir", after_place_node = piston_orientate, mesecons_piston = pistonspec_sticky, diff --git a/files/bluestone/mesecons_pressureplates/init.lua b/files/bluestone/mesecons_pressureplates/init.lua index bbb7d93..5116873 100644 --- a/files/bluestone/mesecons_pressureplates/init.lua +++ b/files/bluestone/mesecons_pressureplates/init.lua @@ -93,7 +93,7 @@ mesecon.register_pressure_plate( {"default_wood.png"}, {"default_wood.png"}, {{"default:wood", "default:wood"}}, - { choppy = 3, oddly_breakable_by_hand = 3 }, + { choppy = 3, oddly_breakable_by_hand = 3, attached_node = 1 }, default.node_sound_wood_defaults()) mesecon.register_pressure_plate( @@ -102,5 +102,5 @@ mesecon.register_pressure_plate( {"default_stone.png"}, {"default_stone.png"}, {{"default:cobble", "default:cobble"}}, - { cracky = 3, oddly_breakable_by_hand = 3 }, + { cracky = 3, oddly_breakable_by_hand = 3, attached_node = 1 }, default.node_sound_stone_defaults()) diff --git a/files/bluestone/mesecons_solarpanel/init.lua b/files/bluestone/mesecons_solarpanel/init.lua index 09c5155..923af64 100644 --- a/files/bluestone/mesecons_solarpanel/init.lua +++ b/files/bluestone/mesecons_solarpanel/init.lua @@ -14,7 +14,7 @@ minetest.register_node("mesecons_solarpanel:solar_panel_on", { wall_side = { -2/16, -8/16, -8/16, -8/16, 8/16, 8/16 }, }, drop = "mesecons_solarpanel:solar_panel_off", - groups = {dig_immediate=3, not_in_creative_inventory = 1}, + groups = {dig_immediate = 3, attached_node = 1, not_in_creative_inventory = 1}, sounds = default.node_sound_glass_defaults(), mesecons = {receptor = { state = mesecon.state.on, @@ -38,7 +38,7 @@ minetest.register_node("mesecons_solarpanel:solar_panel_off", { wall_top = { -8/16, 2/16, -8/16, 8/16, 8/16, 8/16 }, wall_side = { -2/16, -8/16, -8/16, -8/16, 8/16, 8/16 }, }, - groups = {dig_immediate=3}, + groups = {dig_immediate = 3, attached_node = 1}, description="Solar Panel", sounds = default.node_sound_glass_defaults(), mesecons = {receptor = { diff --git a/files/bluestone/mesecons_torch/init.lua b/files/bluestone/mesecons_torch/init.lua index f928539..7f32eb3 100644 --- a/files/bluestone/mesecons_torch/init.lua +++ b/files/bluestone/mesecons_torch/init.lua @@ -58,7 +58,7 @@ local torch_selectionbox = walkable = false, paramtype2 = "wallmounted", selection_box = torch_selectionbox, - groups = {dig_immediate = 3, not_in_creative_inventory = 1}, + groups = {dig_immediate = 3, attached_node = 1, not_in_creative_inventory = 1}, drop = "mesecons_torch:mesecon_torch_on", sounds = default.node_sound_defaults(), mesecons = {receptor = { diff --git a/files/bluestone/mesecons_walllever/init.lua b/files/bluestone/mesecons_walllever/init.lua index 4b35f7c..11a18a5 100644 --- a/files/bluestone/mesecons_walllever/init.lua +++ b/files/bluestone/mesecons_walllever/init.lua @@ -39,7 +39,7 @@ mesecon.register_node("mesecons_walllever:wall_lever", { }, node_box = { type = "fixed", - fixed = {{ -2/16, -3/16, 8/16, 2/16, 3/16, 4/16 }, -- the base + fixed = {{ -2/16, -3/16, 8/16, 2/16, 3/16, 4/16 }, -- the base { -1/16, -8/16, 7/16, 1/16, 0/16, 5/16 }} -- the lever itself. }, mesecons = {receptor = { @@ -58,8 +58,8 @@ mesecon.register_node("mesecons_walllever:wall_lever", { }, node_box = { type = "fixed", - fixed = {{ -2/16, -3/16, 8/16, 2/16, 3/16, 4/16 }, -- the base - { -1/16, 0/16, 7/16, 1/16, 8/16, 5/16 }} -- the lever itself. + fixed = {{ -2/16, -3/16, 8/16, 2/16, 3/16, 4/16 }, -- the base + { -1/16, 0/16, 7/16, 1/16, 8/16, 5/16 }} -- the lever itself. }, on_rotate = false, mesecons = {receptor = { diff --git a/files/default/aliases.lua b/files/default/aliases.lua index edf8c3a..9dd6cd1 100644 --- a/files/default/aliases.lua +++ b/files/default/aliases.lua @@ -24,7 +24,6 @@ minetest.register_alias("glass", "default:glass") minetest.register_alias("wooden_fence", "default:fence_wood") minetest.register_alias("ladder", "default:ladder") minetest.register_alias("wood", "default:wood") -minetest.register_alias("cloud", "default:cloud") minetest.register_alias("water_flowing", "default:water_flowing") minetest.register_alias("water_source", "default:water_source") minetest.register_alias("lava_flowing", "default:lava_flowing") diff --git a/files/default/craftitems.lua b/files/default/craftitems.lua index 88abd33..6d60d89 100644 --- a/files/default/craftitems.lua +++ b/files/default/craftitems.lua @@ -228,14 +228,12 @@ minetest.register_craftitem("default:glowstone_dust", { minetest.register_craftitem("default:fish_raw", { description = "Raw Fish", - groups = {}, inventory_image = "default_fish.png", on_use = minetest.item_eat(2), }) minetest.register_craftitem("default:fish", { description = "Cooked Fish", - groups = {}, inventory_image = "default_fish_cooked.png", on_use = minetest.item_eat(4), }) diff --git a/files/default/nodes.lua b/files/default/nodes.lua index 3acaac3..3ed66d6 100644 --- a/files/default/nodes.lua +++ b/files/default/nodes.lua @@ -872,10 +872,11 @@ minetest.register_node("default:cactus", { }) minetest.register_abm({ + label = "Cactus damage", nodenames = {"default:cactus"}, interval = 1, chance = 1, - action = function(pos, node, active_object_count, active_object_count_wider) + action = function(pos) local players = minetest.get_objects_inside_radius(pos, 1) for i, player in ipairs(players) do player:set_hp(player:get_hp() - 2) @@ -1393,7 +1394,7 @@ minetest.register_node("default:ladder_wood", { --wall_bottom = = --wall_side = = }, - groups = {choppy = 2, oddly_breakable_by_hand = 3, flammable = 2}, + groups = {choppy = 2, oddly_breakable_by_hand = 3, flammable = 2, attached_node = 1}, legacy_wallmounted = true, sounds = default.node_sound_wood_defaults(), }) @@ -1538,18 +1539,6 @@ minetest.register_node("default:quartz_pillar", { sounds = default.node_sound_stone_defaults(), }) --- --- Misc --- - -minetest.register_node("default:cloud", { - description = "Cloud", - tiles = {"default_cloud.png"}, - is_ground_content = false, - sounds = default.node_sound_defaults(), - groups = {not_in_creative_inventory = 1}, -}) - -- -- register trees for leafdecay -- diff --git a/files/default/textures/default_cloud.png b/files/default/textures/default_cloud.png deleted file mode 100644 index 8529fa8..0000000 Binary files a/files/default/textures/default_cloud.png and /dev/null differ diff --git a/files/default/trees.lua b/files/default/trees.lua index de6c04e..82cc8bf 100644 --- a/files/default/trees.lua +++ b/files/default/trees.lua @@ -489,7 +489,7 @@ function default.sapling_on_place(itemstack, placer, pointed_thing, return itemstack end -- Check tree volume for protection - if core.intersects_protection( + if minetest.is_area_protected( vector.add(pos, minp_relative), vector.add(pos, maxp_relative), player_name, diff --git a/files/fire/init.lua b/files/fire/init.lua index ebf3ba0..f3d904d 100644 --- a/files/fire/init.lua +++ b/files/fire/init.lua @@ -43,8 +43,8 @@ minetest.register_node("fire:basic_flame", { name = "fire_basic_flame_animated.png", animation = { type = "vertical_frames", - aspect_w = 16, - aspect_h = 16, + aspect_w = 32, + aspect_h = 32, length = 1 }, }, @@ -103,7 +103,7 @@ minetest.register_node("fire:permanent_flame", { sunlight_propagates = true, floodable = true, damage_per_second = 4, - groups = {igniter = 2, dig_immediate = 3}, + groups = {igniter = 2, dig_immediate = 3, not_in_creative_inventory = 1}, drop = "", on_flood = flood_flame, diff --git a/files/itemframes/init.lua b/files/itemframes/init.lua index 90d3d41..7823abb 100644 --- a/files/itemframes/init.lua +++ b/files/itemframes/init.lua @@ -122,7 +122,7 @@ minetest.register_node("itemframes:frame",{ paramtype = "light", paramtype2 = "facedir", sunlight_propagates = true, - groups = {choppy = 2, dig_immediate = 2}, + groups = {choppy = 2, dig_immediate = 2, attached_node = 1}, legacy_wallmounted = true, sounds = default.node_sound_wood_defaults(), after_place_node = function(pos, placer, itemstack) diff --git a/files/mobs_animal/bear.lua b/files/mobs_animal/bear.lua index cdef7e0..d9398b3 100644 --- a/files/mobs_animal/bear.lua +++ b/files/mobs_animal/bear.lua @@ -94,10 +94,8 @@ mobs:spawn({ name = "mobs_animal:bear", nodes = {"default:dirt", "default:sand", "default:redsand", "default:snow", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass", "default:dirt_with_dry_grass"}, min_light = 0, - interval = 30, - chance = 15000, + chance = 30000, min_height = 0, - max_height = 31000, day_toggle = true, }) diff --git a/files/mobs_animal/bunny.lua b/files/mobs_animal/bunny.lua index afe4f01..ec54eeb 100644 --- a/files/mobs_animal/bunny.lua +++ b/files/mobs_animal/bunny.lua @@ -104,10 +104,8 @@ mobs:spawn({ name = "mobs_animal:bunny", nodes = {"default:snow", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass", "default:dirt_with_dry_grass"}, min_light = 10, - interval = 30, - chance = 8000, + chance = 20000, min_height = 0, - max_height = 31000, day_toggle = true, }) diff --git a/files/mobs_animal/chicken.lua b/files/mobs_animal/chicken.lua index f900d09..f7627e0 100644 --- a/files/mobs_animal/chicken.lua +++ b/files/mobs_animal/chicken.lua @@ -77,10 +77,8 @@ mobs:spawn({ name = "mobs_animal:chicken", nodes = {"default:dirt", "default:sand", "default:redsand", "default:snow", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass"}, min_light = 5, - interval = 30, - chance = 8000, + chance = 20000, min_height = 0, - max_height = 31000, day_toggle = true, }) diff --git a/files/mobs_animal/cow.lua b/files/mobs_animal/cow.lua index 73c0e24..2864498 100644 --- a/files/mobs_animal/cow.lua +++ b/files/mobs_animal/cow.lua @@ -129,10 +129,8 @@ mobs:spawn({ name = "mobs_animal:cow", nodes = {"default:dirt", "default:sand", "default:redsand", "default:snow", "default:snowblock", "default:dirt_with_dry_grass", "default:dirt_with_grass"}, min_light = 5, - interval = 30, - chance = 10000, + chance = 20000, min_height = 0, - max_height = 31000, day_toggle = true, }) diff --git a/files/mobs_animal/dog.lua b/files/mobs_animal/dog.lua index f3e6bae..7fc7bf7 100644 --- a/files/mobs_animal/dog.lua +++ b/files/mobs_animal/dog.lua @@ -62,10 +62,8 @@ mobs:spawn({ name = "mobs_animal:wolf", nodes = {"default:dirt", "default:sand", "default:redsand", "default:snow", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass", "default:dirt_with_dry_grass"}, min_light = 0, - interval = 30, - chance = 15000, + chance = 20000, min_height = 0, - max_height = 31000, day_toggle = true, }) diff --git a/files/mobs_animal/kitten.lua b/files/mobs_animal/kitten.lua index 51264ef..bdb0eee 100644 --- a/files/mobs_animal/kitten.lua +++ b/files/mobs_animal/kitten.lua @@ -55,10 +55,8 @@ mobs:spawn({ name = "mobs_animal:kitten", nodes = {"default:dirt", "default:sand", "default:redsand", "default:snow", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass", "default:dirt_with_dry_grass"}, min_light = 10, - interval = 30, - chance = 10000, + chance = 20000, min_height = 0, - max_height = 31000, day_toggle = true, }) diff --git a/files/mobs_animal/pig.lua b/files/mobs_animal/pig.lua index 8a355a6..5640990 100644 --- a/files/mobs_animal/pig.lua +++ b/files/mobs_animal/pig.lua @@ -59,10 +59,8 @@ mobs:spawn({ name = "mobs_animal:pig", nodes = {"default:dirt", "default:sand", "default:redsand", "default:snow", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass", "default:dirt_with_dry_grass"}, min_light = 5, - interval = 30, - chance = 15000, + chance = 20000, min_height = 0, - max_height = 31000, day_toggle = true, }) diff --git a/files/mobs_animal/sheep.lua b/files/mobs_animal/sheep.lua index 82a4e42..35edde0 100644 --- a/files/mobs_animal/sheep.lua +++ b/files/mobs_animal/sheep.lua @@ -158,10 +158,8 @@ mobs:spawn({ name = "mobs_animal:sheep_white", nodes = {"default:dirt", "default:sand", "default:redsand", "default:snow", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass"}, min_light = 7, - interval = 30, - chance = 40000, + chance = 100000, min_height = 0, - max_height = 31000, day_toggle = true, }) @@ -169,10 +167,8 @@ mobs:spawn({ name = "mobs_animal:sheep_grey", nodes = {"default:dirt", "default:sand", "default:redsand", "default:snow", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass"}, min_light = 7, - interval = 30, - chance = 40000, + chance = 100000, min_height = 0, - max_height = 31000, day_toggle = true, }) @@ -180,10 +176,8 @@ mobs:spawn({ name = "mobs_animal:sheep_dark_grey", nodes = {"default:dirt", "default:sand", "default:redsand", "default:snow", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass"}, min_light = 7, - interval = 30, - chance = 40000, + chance = 100000, min_height = 0, - max_height = 31000, day_toggle = true, }) @@ -191,10 +185,8 @@ mobs:spawn({ name = "mobs_animal:sheep_black", nodes = {"default:dirt", "default:sand", "default:redsand", "default:dirt_with_dry_grass", "default:dirt_with_grass"}, min_light = 7, - interval = 30, - chance = 40000, + chance = 100000, min_height = 0, - max_height = 31000, day_toggle = true, }) @@ -202,9 +194,7 @@ mobs:spawn({ name = "mobs_animal:sheep_brown", nodes = {"default:dirt", "default:sand", "default:redsand", "default:dirt_with_dry_grass", "default:dirt_with_grass"}, min_light = 7, - interval = 30, - chance = 40000, + chance = 100000, min_height = 0, - max_height = 31000, day_toggle = true, }) diff --git a/files/mobs_monster/skeleton.lua b/files/mobs_monster/skeleton.lua index 4978a3f..9e3fba3 100644 --- a/files/mobs_monster/skeleton.lua +++ b/files/mobs_monster/skeleton.lua @@ -52,11 +52,9 @@ mobs:register_mob("mobs_monster:skeleton", { mobs:spawn({ name = "mobs_monster:skeleton", nodes = {"default:dirt", "default:sandstone", "default:sand", "default:redsand", "default:stone", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass", "default:dirt_with_dry_grass", "default:cobble", "default:mossycobble"}, - min_light = 0, max_light = 10, - chance = 7000, - min_height = -50, - max_height = 31000, + chance = 15000, + min_height = -64, }) mobs:register_egg("mobs_monster:skeleton", "Skeleton egg", "mobs_chicken_egg.png^default_bone.png", 1) diff --git a/files/mobs_monster/spider.lua b/files/mobs_monster/spider.lua index 5b8eeb7..3d03ed2 100644 --- a/files/mobs_monster/spider.lua +++ b/files/mobs_monster/spider.lua @@ -62,12 +62,9 @@ mobs:register_mob("mobs_monster:spider", { mobs:spawn({ name = "mobs_monster:spider", nodes = {"default:dirt", "default:sandstone", "default:sand", "default:redsand", "default:redsand", "default:stone", "default:dirt_with_snow", "default:dirt_with_grass", "default:dirt_with_dry_grass", "default:cobble", "default:mossycobble"}, - min_light = 0, max_light = 12, - interval = 30, - chance = 10000, - min_height = -50, - max_height = 31000, + chance = 20000, + min_height = -64, }) mobs:register_egg("mobs_monster:spider", "Spider egg", "mobs_chicken_egg.png^mobs_cobweb.png", 1) @@ -138,12 +135,8 @@ mobs:register_mob("mobs_monster:small_spider", { mobs:spawn({ name = "mobs_monster:small_spider", nodes = {"default:dirt", "default:sandstone", "default:sand", "default:redsand", "default:redsand", "default:stone", "default:dirt_with_snow", "default:dirt_with_grass", "default:dirt_with_dry_grass", "default:cobble", "default:mossycobble"}, - min_light = 0, - max_light = 15, - interval = 30, - chance = 10000, - min_height = -50, - max_height = 31000, + chance = 20000, + min_height = -64, }) minetest.register_craft({ diff --git a/files/mobs_monster/zombie.lua b/files/mobs_monster/zombie.lua index f1c7d11..5bef201 100644 --- a/files/mobs_monster/zombie.lua +++ b/files/mobs_monster/zombie.lua @@ -52,11 +52,9 @@ mobs:register_mob("mobs_monster:zombie", { mobs:spawn({ name = "mobs_monster:zombie", nodes = {"default:dirt", "default:sandstone", "default:sand", "default:redsand", "default:stone", "default:snowblock", "default:dirt_with_snow", "default:dirt_with_grass", "default:dirt_with_dry_grass", "default:cobble", "default:mossycobble"}, - min_light = 0, max_light = 10, - chance = 7000, - min_height = -50, - max_height = 31000, + chance = 15000, + min_height = -64, }) mobs:register_egg("mobs_monster:zombie", "Zombie Head", "zombie_head.png", 0) diff --git a/files/mobs_redo/api.lua b/files/mobs_redo/api.lua index 879cf06..2d35bf6 100644 --- a/files/mobs_redo/api.lua +++ b/files/mobs_redo/api.lua @@ -37,7 +37,6 @@ end -- Load settings -local damage_enabled = minetest.settings:get_bool("enable_damage") local mobs_spawn = minetest.settings:get_bool("mobs_spawn") ~= false local peaceful_only = minetest.settings:get_bool("only_peaceful_mobs") local disable_blood = minetest.settings:get_bool("mobs_disable_blood") ~= true @@ -48,8 +47,14 @@ local spawn_protected = minetest.settings:get_bool("mobs_spawn_protected") ~= fa local remove_far = minetest.settings:get_bool("remove_far_mobs") ~= false local difficulty = tonumber(minetest.settings:get("mob_difficulty")) or 1.0 local show_health = minetest.settings:get_bool("mob_show_health") ~= true -local max_per_block = tonumber(minetest.settings:get("max_objects_per_block") or 99) +local max_per_block = tonumber(minetest.settings:get("max_objects_per_block")) local mob_chance_multiplier = tonumber(minetest.settings:get("mob_chance_multiplier") or 1) +local lifetime = 1200 -- 20 min +local spawn_interval = 10 +if not minetest.is_singleplayer() then + lifetime = 300 -- 5 min + spawn_interval = 60 +end -- Peaceful mode message so players will know there are no monsters if peaceful_only then @@ -74,10 +79,6 @@ local node_ice = "default:ice" local node_snowblock = "default:snowblock" local node_snow = "default:snow" mobs.fallback_node = minetest.registered_aliases["mapgen_dirt"] or "default:dirt" -local lifetime = 1200 -- 20 min -if not minetest.is_singleplayer() then - lifetime = 300 -- 5 min -end local mob_class = { stepheight = 1.1, -- was 0.6 @@ -900,16 +901,15 @@ function mob_class:do_env_damage() if self.light_damage ~= 0 then local light = minetest.get_node_light(pos) or 0 - if light >= self.light_damage_min and light <= self.light_damage_max then - self.health = self.health - self.light_damage pos.y = pos.y + 0.75 -- for particle effect position effect(pos, 5, "heart.png") - self.nametag = "Health: " .. self.health .. " / " .. self.hp_max - self:update_tag() - + if show_health then + self.nametag = "Health: " .. self.health .. " / " .. self.hp_max + self:update_tag() + end if self:check_for_death({type = "light"}) then return end end end @@ -2707,22 +2707,6 @@ end -- only play hit sound and show blood effects if damage is 1 or over if damage >= 1 then - -- weapon sounds - --[[ if weapon_def.sounds then - - local s = random(0, #weapon_def.sounds) - - minetest.sound_play(weapon_def.sounds[s], { - object = self.object, - max_hear_distance = 8 - }) - else - minetest.sound_play("default_punch", { - object = self.object, - max_hear_distance = 5 - }) - end ]] - -- blood_particles if not disable_blood and self.blood_amount > 0 then @@ -3584,7 +3568,7 @@ function mobs:spawn(def) def.neighbors or {"air"}, def.min_light or 0, def.max_light or 15, - def.interval or 30, + def.interval or spawn_interval, def.chance or 5000, def.active_object_count or 1, def.min_height or -31000, @@ -4166,7 +4150,7 @@ function mobs:feed_tame(self, clicker, feed_count, breed, tame) end -- make sound when fed so many times - --self:mob_sound(self.sounds.random) + self:mob_sound(self.sounds.random) end return true