Merge pull request 'mobs_mc silverfish fixes' (#2935) from mc-mobs-silverfish-fixes into master

Reviewed-on: https://git.minetest.land/MineClone2/MineClone2/pulls/2935
Reviewed-by: kabou <kabou@noreply.git.minetest.land>
This commit is contained in:
AFCMS 2022-12-07 17:24:09 +00:00
commit 0f99373779

View File

@ -23,7 +23,7 @@ mcl_mobs.register_mob("mobs_mc:silverfish", {
{"mobs_mc_silverfish.png"}, {"mobs_mc_silverfish.png"},
}, },
pathfinding = 1, pathfinding = 1,
visual_size = {x=3, y=3}, visual_size = {x = 3, y = 3},
sounds = { sounds = {
random = "mobs_mc_silverfish_idle", random = "mobs_mc_silverfish_idle",
death = "mobs_mc_silverfish_death", death = "mobs_mc_silverfish_death",
@ -45,96 +45,14 @@ mcl_mobs.register_mob("mobs_mc:silverfish", {
}, },
replace_rate = 2, replace_rate = 2,
animation = { animation = {
speed_normal = 25, speed_run = 50, speed_normal = 25, speed_run = 50,
stand_start = 0, stand_end = 20, stand_start = 0, stand_end = 20,
walk_start = 0, walk_end = 20, walk_start = 0, walk_end = 20,
run_start = 0, run_end = 20, run_start = 0, run_end = 20,
}, },
view_range = 16, view_range = 16,
attack_type = "dogfight", attack_type = "dogfight",
damage = 1, damage = 1,
reach = 1,
}) })
mcl_mobs.register_egg("mobs_mc:silverfish", S("Silverfish"), "#6d6d6d", "#313131", 0) mcl_mobs.register_egg("mobs_mc:silverfish", S("Silverfish"), "#6d6d6d", "#313131", 0)
-- Monster egg blocks (Minetest Game)
if minetest.get_modpath("default") and mobs_mc.create_monster_egg_nodes then
local spawn_silverfish = function(pos, oldnode, oldmetadata, digger)
if not minetest.is_creative_enabled(digger:get_player_name()) then
minetest.add_entity(pos, "mobs_mc:silverfish")
end
end
minetest.register_node("mobs_mc:monster_egg_stone", {
description = "Stone Monster Egg",
tiles = {"default_stone.png"},
groups = {oddly_breakable_by_hand = 2, spawns_silverfish = 1},
drop = '',
is_ground_content = true,
sounds = default.node_sound_stone_defaults(),
after_dig_node = spawn_silverfish,
})
minetest.register_node("mobs_mc:monster_egg_cobble", {
description = "Cobblestone Monster Egg",
tiles = {"default_cobble.png"},
is_ground_content = false,
groups = {oddly_breakable_by_hand = 2, spawns_silverfish = 1},
drop = '',
sounds = default.node_sound_stone_defaults(),
after_dig_node = spawn_silverfish,
})
minetest.register_node("mobs_mc:monster_egg_mossycobble", {
description = "Mossy Cobblestone Monster Egg",
tiles = {"default_mossycobble.png"},
is_ground_content = false,
groups = {oddly_breakable_by_hand = 2, spawns_silverfish = 1},
drop = '',
sounds = default.node_sound_stone_defaults(),
after_dig_node = spawn_silverfish,
})
minetest.register_node("mobs_mc:monster_egg_stonebrick", {
description = "Stone Brick Monster Egg",
paramtype2 = "facedir",
place_param2 = 0,
tiles = {"default_stone_brick.png"},
is_ground_content = false,
groups = {oddly_breakable_by_hand = 2, spawns_silverfish = 1},
drop = '',
sounds = default.node_sound_stone_defaults(),
after_dig_node = spawn_silverfish,
})
minetest.register_node("mobs_mc:monster_egg_stone_block", {
description = "Stone Block Monster Egg",
tiles = {"default_stone_block.png"},
is_ground_content = false,
groups = {oddly_breakable_by_hand = 2, spawns_silverfish = 1},
drop = '',
sounds = default.node_sound_stone_defaults(),
after_dig_node = spawn_silverfish,
})
-- Randomly spawn stone monster eggs in the world
local mg_name = minetest.get_mapgen_setting("mg_name")
local scarcity
if mg_name == "v6" then
scarcity = 28 * 28 * 28
else
scarcity = 22 * 22 * 22
end
minetest.register_ore({
ore_type = "scatter",
ore = "mobs_mc:monster_egg_stone",
wherein = "default:stone",
clust_scarcity = scarcity,
clust_num_ores = 3,
clust_size = 2,
y_min = -31000,
y_max = 31000,
biomes = { "grassland" },
})
end