forked from MineClone5/MineClone5
Compare commits
17 Commits
production
...
master
Author | SHA1 | Date |
---|---|---|
kay27 | 30ab997358 | |
Daniel Cassidy | d0d7ebe53b | |
kay27 | 0693afe869 | |
Daniel Cassidy | 978f23c70e | |
Daniel Cassidy | 802d214d7b | |
Daniel Cassidy | a0708abb9c | |
Daniel Cassidy | 554f22b802 | |
Daniel Cassidy | 1d03a3d150 | |
Daniel Cassidy | 7c72ce1d0d | |
Daniel Cassidy | 2bdaa77932 | |
Daniel Cassidy | 5cad35dbfe | |
Daniel Cassidy | 51cdc69b99 | |
Daniel Cassidy | b73c0e8f2c | |
Daniel Cassidy | 012d0bd942 | |
Daniel Cassidy | c52f598e64 | |
kay27 | fc3dc63f01 | |
Daniel Cassidy | af03b030a0 |
|
@ -214,7 +214,6 @@ end
|
||||||
--a function used for despawning mobs
|
--a function used for despawning mobs
|
||||||
mobs.check_for_player_within_area = function(self, radius)
|
mobs.check_for_player_within_area = function(self, radius)
|
||||||
local pos1 = self.object:get_pos()
|
local pos1 = self.object:get_pos()
|
||||||
if not pos1 then return end
|
|
||||||
--get players in radius
|
--get players in radius
|
||||||
for _,player in pairs(minetest_get_connected_players()) do
|
for _,player in pairs(minetest_get_connected_players()) do
|
||||||
if player and player:get_hp() > 0 then
|
if player and player:get_hp() > 0 then
|
||||||
|
|
Before Width: | Height: | Size: 212 B After Width: | Height: | Size: 212 B |
File diff suppressed because it is too large
Load Diff
|
@ -1,5 +1,5 @@
|
||||||
name = mcl_mapgen_core
|
name = mcl_mapgen_core
|
||||||
author = Wuzzy
|
author = Wuzzy
|
||||||
description = The core of the MCL2 mapgen
|
description = The core of the MCL2 mapgen
|
||||||
depends = mcl_init, mcl_core, biomeinfo, mcl_worlds, mcl_cocoas, mcl_sponges, mcl_ocean, mcl_stairs, mcl_monster_eggs, mcl_structures
|
depends = mcl_init, mcl_core, biomeinfo, mcl_worlds
|
||||||
optional_depends = mclx_core
|
optional_depends = mclx_core, mcl_cocoas, mcl_sponges, mcl_ocean, mcl_stairs, mcl_monster_eggs, mcl_structures, mcl_flowers, mcl_farming, mcl_mushrooms, mcl_nether
|
||||||
|
|
|
@ -69,7 +69,7 @@ local function init_node_construct(pos)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- The call of Struct
|
-- The call of Struct
|
||||||
function mcl_structures.call_struct(pos, struct_style, rotation, pr, callback)
|
function mcl_structures.call_struct(pos, struct_style, rotation, pr)
|
||||||
minetest.log("action","[mcl_structures] call_struct " .. struct_style.." at "..minetest.pos_to_string(pos))
|
minetest.log("action","[mcl_structures] call_struct " .. struct_style.." at "..minetest.pos_to_string(pos))
|
||||||
if not rotation then
|
if not rotation then
|
||||||
rotation = "random"
|
rotation = "random"
|
||||||
|
@ -91,31 +91,13 @@ function mcl_structures.call_struct(pos, struct_style, rotation, pr, callback)
|
||||||
elseif struct_style == "fossil" then
|
elseif struct_style == "fossil" then
|
||||||
return mcl_structures.generate_fossil(pos, rotation, pr)
|
return mcl_structures.generate_fossil(pos, rotation, pr)
|
||||||
elseif struct_style == "end_exit_portal" then
|
elseif struct_style == "end_exit_portal" then
|
||||||
return mcl_structures.generate_end_exit_portal(pos, rotation, pr, callback)
|
return mcl_structures.generate_end_exit_portal(pos, rotation)
|
||||||
elseif struct_style == "end_exit_portal_open" then
|
elseif struct_style == "end_exit_portal_open" then
|
||||||
return mcl_structures.generate_end_exit_portal_open(pos, rotation)
|
return mcl_structures.generate_end_exit_portal_open(pos, rotation)
|
||||||
elseif struct_style == "end_gateway_portal" then
|
elseif struct_style == "end_gateway_portal" then
|
||||||
return mcl_structures.generate_end_gateway_portal(pos, rotation)
|
return mcl_structures.generate_end_gateway_portal(pos, rotation)
|
||||||
elseif struct_style == "end_portal_shrine" then
|
elseif struct_style == "end_portal_shrine" then
|
||||||
return mcl_structures.generate_end_portal_shrine(pos, rotation, pr)
|
return mcl_structures.generate_end_portal_shrine(pos, rotation, pr)
|
||||||
elseif struct_style == "end_portal" then
|
|
||||||
return mcl_structures.generate_end_portal(pos, rotation, pr)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function mcl_structures.generate_end_portal(pos, rotation, pr)
|
|
||||||
-- todo: proper facedir
|
|
||||||
local x0, y0, z0 = pos.x - 2, pos.y, pos.z - 2
|
|
||||||
for x = 0, 4 do
|
|
||||||
for z = 0, 4 do
|
|
||||||
if x % 4 == 0 or z % 4 == 0 then
|
|
||||||
if x % 4 ~= 0 or z % 4 ~= 0 then
|
|
||||||
minetest.swap_node({x = x0 + x, y = y0, z = z0 + z}, {name = "mcl_portals:end_portal_frame_eye"})
|
|
||||||
end
|
|
||||||
else
|
|
||||||
minetest.swap_node({x = x0 + x, y = y0, z = z0 + z}, {name = "mcl_portals:portal_end"})
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -342,9 +324,9 @@ function mcl_structures.generate_fossil(pos, rotation, pr)
|
||||||
return mcl_structures.place_schematic(newpos, path, rotation or "random", nil, true)
|
return mcl_structures.place_schematic(newpos, path, rotation or "random", nil, true)
|
||||||
end
|
end
|
||||||
|
|
||||||
function mcl_structures.generate_end_exit_portal(pos, rot, pr, callback)
|
function mcl_structures.generate_end_exit_portal(pos, rot)
|
||||||
local path = modpath.."/schematics/mcl_structures_end_exit_portal.mts"
|
local path = modpath.."/schematics/mcl_structures_end_exit_portal.mts"
|
||||||
return mcl_structures.place_schematic(pos, path, rot or "0", {["mcl_portals:portal_end"] = "air"}, true, nil, callback)
|
return mcl_structures.place_schematic(pos, path, rot or "0", {["mcl_portals:portal_end"] = "air"}, true)
|
||||||
end
|
end
|
||||||
|
|
||||||
function mcl_structures.generate_end_exit_portal_open(pos, rot)
|
function mcl_structures.generate_end_exit_portal_open(pos, rot)
|
||||||
|
@ -574,7 +556,7 @@ end
|
||||||
|
|
||||||
-- Debug command
|
-- Debug command
|
||||||
minetest.register_chatcommand("spawnstruct", {
|
minetest.register_chatcommand("spawnstruct", {
|
||||||
params = "desert_temple | desert_well | igloo | witch_hut | boulder | ice_spike_small | ice_spike_large | fossil | end_exit_portal | end_exit_portal_open | end_gateway_portal | end_portal_shrine | end_portal | nether_portal | dungeon",
|
params = "desert_temple | desert_well | igloo | witch_hut | boulder | ice_spike_small | ice_spike_large | fossil | end_exit_portal | end_exit_portal_open | end_gateway_portal | end_portal_shrine | nether_portal | dungeon",
|
||||||
description = S("Generate a pre-defined structure near your position."),
|
description = S("Generate a pre-defined structure near your position."),
|
||||||
privs = {debug = true},
|
privs = {debug = true},
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
|
@ -614,8 +596,6 @@ minetest.register_chatcommand("spawnstruct", {
|
||||||
mcl_structures.generate_end_portal_shrine(pos, rot, pr)
|
mcl_structures.generate_end_portal_shrine(pos, rot, pr)
|
||||||
elseif param == "dungeon" and mcl_dungeons and mcl_dungeons.spawn_dungeon then
|
elseif param == "dungeon" and mcl_dungeons and mcl_dungeons.spawn_dungeon then
|
||||||
mcl_dungeons.spawn_dungeon(pos, rot, pr)
|
mcl_dungeons.spawn_dungeon(pos, rot, pr)
|
||||||
elseif param == "end_portal" then
|
|
||||||
mcl_structures.generate_end_portal(pos, rot, pr)
|
|
||||||
elseif param == "nether_portal" and mcl_portals and mcl_portals.spawn_nether_portal then
|
elseif param == "nether_portal" and mcl_portals and mcl_portals.spawn_nether_portal then
|
||||||
mcl_portals.spawn_nether_portal(pos, rot, pr, name)
|
mcl_portals.spawn_nether_portal(pos, rot, pr, name)
|
||||||
elseif param == "" then
|
elseif param == "" then
|
||||||
|
|
Loading…
Reference in New Issue