From dc9ca163212c46bf4bfa07989f63f3a193e3e270 Mon Sep 17 00:00:00 2001 From: MysticTempest Date: Tue, 9 Feb 2021 06:06:19 -0600 Subject: [PATCH] Enable villager spawning. --- mods/ENTITIES/mobs_mc/5_spawn_abm_check.lua | 2 +- mods/ENTITIES/mobs_mc/villager.lua | 2 +- mods/ENTITIES/mobs_mc_gameconfig/init.lua | 1 + mods/MAPGEN/mcl_villages/buildings.lua | 1 + mods/MAPGEN/mcl_villages/init.lua | 22 +++++++++++++-------- 5 files changed, 18 insertions(+), 10 deletions(-) diff --git a/mods/ENTITIES/mobs_mc/5_spawn_abm_check.lua b/mods/ENTITIES/mobs_mc/5_spawn_abm_check.lua index 85886a995a..8fcaaf31f6 100644 --- a/mods/ENTITIES/mobs_mc/5_spawn_abm_check.lua +++ b/mods/ENTITIES/mobs_mc/5_spawn_abm_check.lua @@ -11,7 +11,7 @@ function mobs:spawn_abm_check(pos, node, name) elseif is_forbidden_node(pos, node) or is_forbidden_node(vector.add(pos, vector.new(0, 1, 0))) then return true -- Spawn on opaque or liquid nodes - elseif minetest.get_item_group(node.name, "opaque") ~= 0 or minetest.registered_nodes[node.name].liquidtype ~= "none" then + elseif minetest.get_item_group(node.name, "opaque") ~= 0 or minetest.registered_nodes[node.name].liquidtype ~= "none" or node.name == "mcl_core:grass_path" then return false end diff --git a/mods/ENTITIES/mobs_mc/villager.lua b/mods/ENTITIES/mobs_mc/villager.lua index dc3fbd9cab..7e6921f90e 100644 --- a/mods/ENTITIES/mobs_mc/villager.lua +++ b/mods/ENTITIES/mobs_mc/villager.lua @@ -1067,7 +1067,7 @@ mobs:register_mob("mobs_mc:villager", { -mobs:spawn_specific("mobs_mc:villager", mobs_mc.spawn.village, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 8000, 4, mobs_mc.spawn_height.water+1, mobs_mc.spawn_height.overworld_max) +mobs:spawn_specific("mobs_mc:villager", mobs_mc.spawn.village, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 20, 4, mobs_mc.spawn_height.water+1, mobs_mc.spawn_height.overworld_max) -- spawn eggs mobs:register_egg("mobs_mc:villager", S("Villager"), "mobs_mc_spawn_icon_villager.png", 0) diff --git a/mods/ENTITIES/mobs_mc_gameconfig/init.lua b/mods/ENTITIES/mobs_mc_gameconfig/init.lua index 5f4e37c43f..06d7eb87fa 100644 --- a/mods/ENTITIES/mobs_mc_gameconfig/init.lua +++ b/mods/ENTITIES/mobs_mc_gameconfig/init.lua @@ -225,6 +225,7 @@ mobs_mc.override.spawn = { nether_fortress = { "mcl_nether:nether_brick", "mcl_nether:netherrack" }, nether_portal = { mobs_mc.override.items.nether_portal }, wolf = { mobs_mc.override.items.grass_block, "mcl_core:dirt", "mcl_core:dirt_with_grass_snow", "mcl_core:snow", "mcl_core:snowblock", "mcl_core:podzol" }, + village = { "mcl_villages:stonebrickcarved", "mcl_core:grass_path", "mcl_core:sandstonesmooth2" }, } -- This table contains important spawn height references for the mob spawn height. diff --git a/mods/MAPGEN/mcl_villages/buildings.lua b/mods/MAPGEN/mcl_villages/buildings.lua index 05f08bdcc9..6dfa807bfc 100644 --- a/mods/MAPGEN/mcl_villages/buildings.lua +++ b/mods/MAPGEN/mcl_villages/buildings.lua @@ -188,6 +188,7 @@ function settlements.place_schematics(settlement_info, pr) local schem_lua = minetest.serialize_schematic(building, "lua", {lua_use_comments = false, lua_num_indent_spaces = 0}).." return(schematic)" + schem_lua = schem_lua:gsub("mcl_core:stonebrickcarved", "mcl_villages:stonebrickcarved") -- replace material if replace_wall then --Note, block substitution isn't matching node names exactly; so nodes that are to be substituted that have the same prefixes cause bugs. diff --git a/mods/MAPGEN/mcl_villages/init.lua b/mods/MAPGEN/mcl_villages/init.lua index 5ee3b054ad..6413174db5 100644 --- a/mods/MAPGEN/mcl_villages/init.lua +++ b/mods/MAPGEN/mcl_villages/init.lua @@ -13,18 +13,24 @@ dofile(settlements.modpath.."/paths.lua") settlements_in_world = settlements.load() settlements.grundstellungen() ---[[ Disable custom node spawning. + -- -- register block for npc spawn -- -minetest.register_node("settlements:junglewood", { - description = "special junglewood floor", - tiles = {"default_junglewood.png"}, - groups = {choppy=3, wood=2}, - sounds = default.node_sound_wood_defaults(), - }) +minetest.register_node("mcl_villages:stonebrickcarved", { + description = ("Chiseled Stone Village Bricks"), + _doc_items_longdesc = doc.sub.items.temp.build, + tiles = {"mcl_core_stonebrick_carved.png"}, + stack_max = 64, + drop = "mcl_core:stonebrickcarved", + groups = {pickaxey=1, stone=1, stonebrick=1, building_block=1, material_stone=1}, + sounds = mcl_sounds.node_sound_stone_defaults(), + is_ground_content = false, + _mcl_blast_resistance = 6, + _mcl_hardness = 1.5, +}) + ---]] --[[ Enable for testing, but use MineClone2's own spawn code if/when merging.