added spawner + birch trees
This commit is contained in:
parent
ec688f288e
commit
c461203b30
BIN
mods/default/schematics/birchtree1.mts
Normal file
BIN
mods/default/schematics/birchtree1.mts
Normal file
Binary file not shown.
BIN
mods/default/schematics/birchtree2.mts
Normal file
BIN
mods/default/schematics/birchtree2.mts
Normal file
Binary file not shown.
@ -214,7 +214,7 @@ minetest.register_decoration({
|
||||
deco_type = "schematic",
|
||||
place_on = {"default:grass"},
|
||||
sidelen = 16,
|
||||
fill_ratio = 0.02,
|
||||
fill_ratio = 0.01,
|
||||
biomes = {"forest"},
|
||||
y_min = 1,
|
||||
y_max = 31000,
|
||||
@ -226,7 +226,7 @@ minetest.register_decoration({
|
||||
deco_type = "schematic",
|
||||
place_on = {"default:grass"},
|
||||
sidelen = 16,
|
||||
fill_ratio = 0.005,
|
||||
fill_ratio = 0.004,
|
||||
biomes = {"forest"},
|
||||
y_min = 1,
|
||||
y_max = 31000,
|
||||
@ -246,6 +246,19 @@ minetest.register_decoration({
|
||||
flags = "place_center_x, place_center_z",
|
||||
})
|
||||
|
||||
minetest.register_decoration({
|
||||
deco_type = "schematic",
|
||||
place_on = {"default:grass"},
|
||||
sidelen = 16,
|
||||
fill_ratio = 0.005,
|
||||
biomes = {"forest"},
|
||||
y_min = 1,
|
||||
y_max = 31000,
|
||||
schematic = minetest.get_modpath("default").."/schematics/birchtree1.mts",
|
||||
flags = "place_center_x, place_center_z",
|
||||
})
|
||||
|
||||
|
||||
minetest.register_decoration({
|
||||
deco_type = "schematic",
|
||||
place_on = {"default:dirt_with_snow"},
|
||||
|
@ -7,4 +7,5 @@ local modpath = minetest.get_modpath("mobs")
|
||||
dofile(modpath.."/api.lua")
|
||||
dofile(modpath.."/components.lua")
|
||||
dofile(modpath.."/mobs.lua")
|
||||
dofile(modpath.."/spawner.lua")
|
||||
|
||||
|
31
mods/mobs/spawner.lua
Normal file
31
mods/mobs/spawner.lua
Normal file
@ -0,0 +1,31 @@
|
||||
minetest.register_node("mobs:spawner", {
|
||||
description = "Spawner",
|
||||
tiles = {"mobs_spawner.png", "mobs_spawner.png", "mobs_spawner_side.png"},
|
||||
groups = {cracky = 3},
|
||||
paramtype = "light",
|
||||
drawtype = "nodebox",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-8/16, -8/16, -8/16, 8/16, -6/16, 8/16},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"mobs:spawner"},
|
||||
neighbors = {},
|
||||
interval = 5,
|
||||
chance = 2,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
for i, player in ipairs(minetest.get_connected_players()) do
|
||||
local p = player:getpos()
|
||||
local d = vector.distance(pos, p)
|
||||
|
||||
if d < 6 then
|
||||
local n = mobs.get_mob(xp.player_levels[player:get_player_name()])
|
||||
minetest.add_entity(vector.new(pos.x, pos.y + 1, pos.z), n)
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
BIN
mods/mobs/textures/mobs_spawner.png
Normal file
BIN
mods/mobs/textures/mobs_spawner.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 234 B |
BIN
mods/mobs/textures/mobs_spawner_side.png
Normal file
BIN
mods/mobs/textures/mobs_spawner_side.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 200 B |
Loading…
x
Reference in New Issue
Block a user