forked from Mineclonia/Mineclonia
Compare commits
6 Commits
master
...
add-ruined
Author | SHA1 | Date |
---|---|---|
Nils Dagsson Moskopp | bdde99f147 | |
Nils Dagsson Moskopp | 8fa8a6fe37 | |
Nils Dagsson Moskopp | d8d3f8364d | |
Nils Dagsson Moskopp | 0ba832776c | |
Nils Dagsson Moskopp | 180109bd30 | |
Nils Dagsson Moskopp | 25744f3ed4 |
|
@ -388,11 +388,12 @@ function mcl_farming:add_gourd(full_unconnected_stem, connected_stem_basename, s
|
|||
{ x=0, y=0, z=-1 },
|
||||
{ x=0, y=0, z=1 },
|
||||
}
|
||||
local floorpos, floor
|
||||
for n=#neighbors, 1, -1 do
|
||||
local offset = neighbors[n]
|
||||
local blockpos = vector.add(stempos, offset)
|
||||
local floorpos = { x=blockpos.x, y=blockpos.y-1, z=blockpos.z }
|
||||
local floor = minetest.get_node(floorpos)
|
||||
floorpos = { x=blockpos.x, y=blockpos.y-1, z=blockpos.z }
|
||||
floor = minetest.get_node(floorpos)
|
||||
local block = minetest.get_node(blockpos)
|
||||
local soilgroup = minetest.get_item_group(floor.name, "soil")
|
||||
if not ((minetest.get_item_group(floor.name, "grass_block") == 1 or floor.name=="mcl_core:dirt" or soilgroup == 2 or soilgroup == 3) and block.name == "air") then
|
||||
|
@ -406,8 +407,6 @@ function mcl_farming:add_gourd(full_unconnected_stem, connected_stem_basename, s
|
|||
local r = math.random(1, #neighbors)
|
||||
local offset = neighbors[r]
|
||||
local blockpos = vector.add(stempos, offset)
|
||||
local floorpos = { x=blockpos.x, y=blockpos.y-1, z=blockpos.z }
|
||||
local floor = minetest.get_node(floorpos)
|
||||
local p2
|
||||
if offset.x == 1 then
|
||||
minetest.set_node(stempos, {name=connected_stem_names[1]})
|
||||
|
|
|
@ -7,6 +7,21 @@ if mod_screwdriver then
|
|||
on_rotate = screwdriver.rotate_3way
|
||||
end
|
||||
|
||||
minetest.register_node("mcl_nether:crying_obsidian", {
|
||||
description = S("Crying Obsidian"),
|
||||
_doc_items_longdesc = S("Crying obsidian is an extremely hard mineral with an enourmous blast-resistance. It can be found in ruined portals."),
|
||||
tiles = {"mcl_nether_crying_obsidian.png"},
|
||||
paramtype = "light",
|
||||
light_source = 10,
|
||||
is_ground_content = true,
|
||||
sounds = mcl_sounds.node_sound_stone_defaults(),
|
||||
stack_max = 64,
|
||||
groups = {pickaxey=5, building_block=1, material_stone=1},
|
||||
_mcl_blast_resistance = 1200,
|
||||
_mcl_hardness = 50,
|
||||
})
|
||||
-- TODO: Nether particle effect when crying obsidian is placed.
|
||||
|
||||
minetest.register_node("mcl_nether:glowstone", {
|
||||
description = S("Glowstone"),
|
||||
_doc_items_longdesc = S("Glowstone is a naturally-glowing block which is home to the Nether."),
|
||||
|
@ -156,6 +171,18 @@ minetest.register_node("mcl_nether:nether_brick", {
|
|||
_mcl_hardness = 2,
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_nether:nether_brick_carved", {
|
||||
description = S("Chiseled Nether Bricks"),
|
||||
_doc_items_longdesc = doc.sub.items.temp.build,
|
||||
stack_max = 64,
|
||||
tiles = {"mcl_nether_nether_brick_carved.png"},
|
||||
is_ground_content = false,
|
||||
groups = {pickaxey=1, building_block=1, material_stone=1},
|
||||
sounds = mcl_sounds.node_sound_stone_defaults(),
|
||||
_mcl_blast_resistance = 6,
|
||||
_mcl_hardness = 2,
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_nether:red_nether_brick", {
|
||||
-- Original name: Red Nether Brick
|
||||
description = S("Red Nether Brick Block"),
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 381 B |
Binary file not shown.
After Width: | Height: | Size: 200 B |
Binary file not shown.
|
@ -22,6 +22,14 @@ minetest.register_craft({
|
|||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'mcl_nether:nether_brick_carved',
|
||||
recipe = {
|
||||
{'mcl_stairs:slab_nether_brick'},
|
||||
{'mcl_stairs:slab_nether_brick'}
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'mcl_end:purpur_pillar',
|
||||
recipe = {
|
||||
|
|
|
@ -89,6 +89,10 @@ mcl_structures.call_struct = function(pos, struct_style, rotation, pr)
|
|||
return mcl_structures.generate_end_exit_portal(pos, rotation)
|
||||
elseif struct_style == "end_portal_shrine" then
|
||||
return mcl_structures.generate_end_portal_shrine(pos, rotation, pr)
|
||||
elseif struct_style == "ruined_portal_large" then
|
||||
return mcl_structures.generate_ruined_portal_large(pos, rotation, pr)
|
||||
elseif struct_style == "ruined_portal_small" then
|
||||
return mcl_structures.generate_ruined_portal_small(pos, rotation, pr)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -404,6 +408,336 @@ mcl_structures.generate_end_portal_shrine = function(pos, rotation, pr)
|
|||
mcl_structures.place_schematic(newpos, path, "0", nil, true, nil, shrine_placement_callback, pr)
|
||||
end
|
||||
|
||||
local function ruined_portal_callback(p1, p2, size, rotation, pr)
|
||||
local biome_data = minetest.get_biome_data(p1)
|
||||
local biome_is_cold = (biome_data.heat < 15) or false
|
||||
local biome_name = minetest.get_biome_name(biome_data.biome)
|
||||
local biome_is_ocean = string.find(biome_name, "ocean") and true or false
|
||||
local r_boobytrapped = pr:next(1, 100)
|
||||
local nodes = minetest.find_nodes_in_area(p1, p2, {
|
||||
"mesecons_pistons:piston_normal_off",
|
||||
"mesecons_pistons:piston_sticky_off",
|
||||
"mcl_core:goldblock",
|
||||
"mcl_stairs:slab_goldblock",
|
||||
"mcl_stairs:slab_goldblock_double",
|
||||
"mcl_stairs:slab_goldblock_top",
|
||||
"mcl_stairs:stair_goldblock",
|
||||
"mcl_stairs:stair_goldblock_inner",
|
||||
"mcl_stairs:stair_goldblock_outer",
|
||||
"mcl_core:obsidian",
|
||||
"mcl_nether:netherrack",
|
||||
"mcl_core:lava_source",
|
||||
"mcl_core:stonebrick",
|
||||
"mcl_core:stonebrickcarved",
|
||||
"mcl_stairs:slab_stonebrick",
|
||||
"mcl_stairs:slab_stonebrick_top",
|
||||
"mcl_stairs:slab_stonebrick_double",
|
||||
"mcl_stairs:slab_stone",
|
||||
"mcl_stairs:slab_stone_top",
|
||||
"mcl_stairs:slab_stone_double",
|
||||
"mcl_stairs:stair_stonebrick",
|
||||
"mcl_stairs:stair_stonebrick_outer",
|
||||
"mcl_stairs:stair_stonebrick_inner",
|
||||
"mcl_walls:stonebrick",
|
||||
"mcl_walls:stonebrick_0",
|
||||
"mcl_walls:stonebrick_1",
|
||||
"mcl_walls:stonebrick_10",
|
||||
"mcl_walls:stonebrick_11",
|
||||
"mcl_walls:stonebrick_12",
|
||||
"mcl_walls:stonebrick_13",
|
||||
"mcl_walls:stonebrick_14",
|
||||
"mcl_walls:stonebrick_15",
|
||||
"mcl_walls:stonebrick_16",
|
||||
"mcl_walls:stonebrick_2",
|
||||
"mcl_walls:stonebrick_21",
|
||||
"mcl_walls:stonebrick_3",
|
||||
"mcl_walls:stonebrick_4",
|
||||
"mcl_walls:stonebrick_5",
|
||||
"mcl_walls:stonebrick_6",
|
||||
"mcl_walls:stonebrick_7",
|
||||
"mcl_walls:stonebrick_8",
|
||||
"mcl_walls:stonebrick_9"
|
||||
})
|
||||
for n=1, #nodes do
|
||||
local node = minetest.get_node(nodes[n])
|
||||
-- Rotate walls (needs to be done first)
|
||||
if rotation == "90" or rotation == "270" then
|
||||
if "mcl_walls:stonebrick_5" == node.name then
|
||||
node.name = "mcl_walls:stonebrick_10"
|
||||
elseif "mcl_walls:stonebrick_10" == node.name then
|
||||
node.name = "mcl_walls:stonebrick_5"
|
||||
end
|
||||
if "mcl_walls:stonebrick_16" == node.name then
|
||||
node.name = "mcl_walls:stonebrick_21"
|
||||
elseif "mcl_walls:stonebrick_21" == node.name then
|
||||
node.name = "mcl_walls:stonebrick_16"
|
||||
end
|
||||
end
|
||||
if (p1.y > mcl_vars.mg_overworld_min) and (p1.y < mcl_vars.mg_overworld_max) then
|
||||
local r_bricktype = pr:next(1, 100)
|
||||
-- Replace stone brick with mossy variants (30%)
|
||||
if r_bricktype <= 30 then -- 30%
|
||||
if "mcl_core:stonebrick" == node.name then
|
||||
node.name = "mcl_core:stonebrickmossy"
|
||||
elseif "mcl_stairs:slab_stonebrick" == node.name then
|
||||
node.name = "mcl_stairs:slab_stonebrickmossy"
|
||||
elseif "mcl_stairs:slab_stonebrick_top" == node.name then
|
||||
node.name = "mcl_stairs:slab_stonebrickmossy_top"
|
||||
elseif "mcl_stairs:slab_stonebrick_double" == node.name then
|
||||
node.name = "mcl_stairs:slab_stonebrickmossy_double"
|
||||
elseif "mcl_stairs:stair_stonebrick" == node.name then
|
||||
node.name = "mcl_stairs:stair_stonebrickmossy"
|
||||
elseif "mcl_stairs:stair_stonebrick_outer" == node.name then
|
||||
node.name = "mcl_stairs:stair_stonebrickmossy_outer"
|
||||
elseif "mcl_stairs:stair_stonebrick_inner" == node.name then
|
||||
node.name = "mcl_stairs:stair_stonebrickmossy_inner"
|
||||
elseif "mcl_walls:stonebrick" == node.name then
|
||||
node.name = "mcl_walls:stonebrickmossy"
|
||||
elseif "mcl_walls:stonebrick_0" == node.name then
|
||||
node.name = "mcl_walls:stonebrickmossy_0"
|
||||
elseif "mcl_walls:stonebrick_1" == node.name then
|
||||
node.name = "mcl_walls:stonebrickmossy_1"
|
||||
elseif "mcl_walls:stonebrick_10" == node.name then
|
||||
node.name = "mcl_walls:stonebrickmossy_10"
|
||||
elseif "mcl_walls:stonebrick_11" == node.name then
|
||||
node.name = "mcl_walls:stonebrickmossy_11"
|
||||
elseif "mcl_walls:stonebrick_12" == node.name then
|
||||
node.name = "mcl_walls:stonebrickmossy_12"
|
||||
elseif "mcl_walls:stonebrick_13" == node.name then
|
||||
node.name = "mcl_walls:stonebrickmossy_13"
|
||||
elseif "mcl_walls:stonebrick_14" == node.name then
|
||||
node.name = "mcl_walls:stonebrickmossy_14"
|
||||
elseif "mcl_walls:stonebrick_15" == node.name then
|
||||
node.name = "mcl_walls:stonebrickmossy_15"
|
||||
elseif "mcl_walls:stonebrick_16" == node.name then
|
||||
node.name = "mcl_walls:stonebrickmossy_16"
|
||||
elseif "mcl_walls:stonebrick_2" == node.name then
|
||||
node.name = "mcl_walls:stonebrickmossy_2"
|
||||
elseif "mcl_walls:stonebrick_21" == node.name then
|
||||
node.name = "mcl_walls:stonebrickmossy_21"
|
||||
elseif "mcl_walls:stonebrick_3" == node.name then
|
||||
node.name = "mcl_walls:stonebrickmossy_3"
|
||||
elseif "mcl_walls:stonebrick_4" == node.name then
|
||||
node.name = "mcl_walls:stonebrickmossy_4"
|
||||
elseif "mcl_walls:stonebrick_5" == node.name then
|
||||
node.name = "mcl_walls:stonebrickmossy_5"
|
||||
elseif "mcl_walls:stonebrick_6" == node.name then
|
||||
node.name = "mcl_walls:stonebrickmossy_6"
|
||||
elseif "mcl_walls:stonebrick_7" == node.name then
|
||||
node.name = "mcl_walls:stonebrickmossy_7"
|
||||
elseif "mcl_walls:stonebrick_8" == node.name then
|
||||
node.name = "mcl_walls:stonebrickmossy_8"
|
||||
elseif "mcl_walls:stonebrick_9" == node.name then
|
||||
node.name = "mcl_walls:stonebrickmossy_9"
|
||||
end
|
||||
-- Replace stone brick with cracked variants (20%)
|
||||
elseif r_bricktype <= 50 then -- 20%
|
||||
if "mcl_core:stonebrick" == node.name then
|
||||
node.name = "mcl_core:stonebrickcracked"
|
||||
elseif "mcl_stairs:slab_stonebrick" == node.name then
|
||||
node.name = "mcl_stairs:slab_stonebrickcracked"
|
||||
elseif "mcl_stairs:slab_stonebrick_top" == node.name then
|
||||
node.name = "mcl_stairs:slab_stonebrickcracked_top"
|
||||
elseif "mcl_stairs:slab_stonebrick_double" == node.name then
|
||||
node.name = "mcl_stairs:slab_stonebrickcracked_double"
|
||||
elseif "mcl_stairs:stair_stonebrick" == node.name then
|
||||
node.name = "mcl_stairs:stair_stonebrickcracked"
|
||||
elseif "mcl_stairs:stair_stonebrick_outer" == node.name then
|
||||
node.name = "mcl_stairs:stair_stonebrickcracked_outer"
|
||||
elseif "mcl_stairs:stair_stonebrick_inner" == node.name then
|
||||
node.name = "mcl_stairs:stair_stonebrickcracked_inner"
|
||||
end
|
||||
end
|
||||
end
|
||||
-- Booby trap all redstone mechanisms (20%)
|
||||
if r_boobytrapped <= 20 and (
|
||||
"mesecons_pistons:piston_normal_off" == node.name or
|
||||
"mesecons_pistons:piston_sticky_off" == node.name
|
||||
) then
|
||||
node.name = "mcl_tnt:tnt"
|
||||
-- Replace gold with air (30%)
|
||||
elseif (
|
||||
"mcl_core:goldblock" == node.name or
|
||||
"mcl_stairs:slab_goldblock" == node.name or
|
||||
"mcl_stairs:slab_goldblock_double" == node.name or
|
||||
"mcl_stairs:slab_goldblock_top" == node.name or
|
||||
"mcl_stairs:stair_goldblock" == node.name or
|
||||
"mcl_stairs:stair_goldblock_inner" == node.name or
|
||||
"mcl_stairs:stair_goldblock_outer" == node.name
|
||||
) then
|
||||
local r_air = pr:next(1,100)
|
||||
if r_air <= 30 then
|
||||
node.name = "air"
|
||||
end
|
||||
-- Replace obsidian with crying obsidian (20%)
|
||||
elseif "mcl_core:obsidian" == node.name then
|
||||
local r_crying = pr:next(1,100)
|
||||
if r_crying <= 30 then
|
||||
node.name = "mcl_nether:crying_obsidian"
|
||||
end
|
||||
-- Replace Nether rack with magma (7% if not cold)
|
||||
elseif "mcl_nether:netherrack" == node.name then
|
||||
if not biome_is_cold then
|
||||
local r_magma = pr:next(1,100)
|
||||
if r_magma <= 7 then
|
||||
node.name = "mcl_nether:magma"
|
||||
end
|
||||
end
|
||||
-- Replace lava (underwater: 100% magma / cold: 100% Nether rack / else: 20% magma)
|
||||
elseif "mcl_core:lava_source" == node.name then
|
||||
if biome_is_ocean and nodes[n].y < 0 then -- do not replace at surface
|
||||
node.name = "mcl_nether:magma"
|
||||
elseif biome_is_cold then
|
||||
node.name = "mcl_nether:netherrack"
|
||||
else
|
||||
local r_magma = pr:next(1,100)
|
||||
if r_magma <= 20 then
|
||||
node.name = "mcl_nether:magma"
|
||||
end
|
||||
end
|
||||
end
|
||||
-- Replace stone brick variants with (red) Nether brick in the Nether
|
||||
-- TODO: Replace stone brick variants with blackstone when we have it
|
||||
if (p1.y > mcl_vars.mg_nether_min) and (p1.y < mcl_vars.mg_nether_max) then
|
||||
if "mcl_core:stonebrick" == node.name then
|
||||
node.name = "mcl_nether:nether_brick"
|
||||
elseif "mcl_core:stonebrickcarved" == node.name then
|
||||
node.name = "mcl_nether:nether_brick_carved"
|
||||
elseif "mcl_stairs:slab_stonebrick" == node.name then
|
||||
node.name = "mcl_stairs:slab_nether_brick"
|
||||
elseif "mcl_stairs:slab_stonebrick_top" == node.name then
|
||||
node.name = "mcl_stairs:slab_nether_brick_top"
|
||||
elseif "mcl_stairs:slab_stonebrick_double" == node.name then
|
||||
node.name = "mcl_stairs:slab_nether_brick_double"
|
||||
elseif "mcl_stairs:slab_stone" == node.name then
|
||||
node.name = "mcl_stairs:slab_red_nether_brick"
|
||||
elseif "mcl_stairs:slab_stone_top" == node.name then
|
||||
node.name = "mcl_stairs:slab_red_nether_brick_top"
|
||||
elseif "mcl_stairs:slab_stone_double" == node.name then
|
||||
node.name = "mcl_stairs:slab_red_nether_brick_double"
|
||||
elseif "mcl_stairs:stair_stonebrick" == node.name then
|
||||
node.name = "mcl_stairs:stair_nether_brick"
|
||||
elseif "mcl_stairs:stair_stonebrick_outer" == node.name then
|
||||
node.name = "mcl_stairs:stair_nether_brick_outer"
|
||||
elseif "mcl_stairs:stair_stonebrick_inner" == node.name then
|
||||
node.name = "mcl_stairs:stair_nether_brick_inner"
|
||||
elseif "mcl_walls:stonebrick" == node.name then
|
||||
node.name = "mcl_walls:netherbrick"
|
||||
elseif "mcl_walls:stonebrick_0" == node.name then
|
||||
node.name = "mcl_walls:netherbrick_0"
|
||||
elseif "mcl_walls:stonebrick_1" == node.name then
|
||||
node.name = "mcl_walls:netherbrick_1"
|
||||
elseif "mcl_walls:stonebrick_10" == node.name then
|
||||
node.name = "mcl_walls:netherbrick_10"
|
||||
elseif "mcl_walls:stonebrick_11" == node.name then
|
||||
node.name = "mcl_walls:netherbrick_11"
|
||||
elseif "mcl_walls:stonebrick_12" == node.name then
|
||||
node.name = "mcl_walls:netherbrick_12"
|
||||
elseif "mcl_walls:stonebrick_13" == node.name then
|
||||
node.name = "mcl_walls:netherbrick_13"
|
||||
elseif "mcl_walls:stonebrick_14" == node.name then
|
||||
node.name = "mcl_walls:netherbrick_14"
|
||||
elseif "mcl_walls:stonebrick_15" == node.name then
|
||||
node.name = "mcl_walls:netherbrick_15"
|
||||
elseif "mcl_walls:stonebrick_16" == node.name then
|
||||
node.name = "mcl_walls:netherbrick_16"
|
||||
elseif "mcl_walls:stonebrick_2" == node.name then
|
||||
node.name = "mcl_walls:netherbrick_2"
|
||||
elseif "mcl_walls:stonebrick_21" == node.name then
|
||||
node.name = "mcl_walls:netherbrick_21"
|
||||
elseif "mcl_walls:stonebrick_3" == node.name then
|
||||
node.name = "mcl_walls:netherbrick_3"
|
||||
elseif "mcl_walls:stonebrick_4" == node.name then
|
||||
node.name = "mcl_walls:netherbrick_4"
|
||||
elseif "mcl_walls:stonebrick_5" == node.name then
|
||||
node.name = "mcl_walls:netherbrick_5"
|
||||
elseif "mcl_walls:stonebrick_6" == node.name then
|
||||
node.name = "mcl_walls:netherbrick_6"
|
||||
elseif "mcl_walls:stonebrick_7" == node.name then
|
||||
node.name = "mcl_walls:netherbrick_7"
|
||||
elseif "mcl_walls:stonebrick_8" == node.name then
|
||||
node.name = "mcl_walls:netherbrick_8"
|
||||
elseif "mcl_walls:stonebrick_9" == node.name then
|
||||
node.name = "mcl_walls:netherbrick_9"
|
||||
-- Replace lava with Nether lava
|
||||
elseif "mcl_core:lava_source" == node.name then
|
||||
node.name = "mcl_nether:nether_lava_source"
|
||||
end
|
||||
end
|
||||
minetest.set_node(nodes[n], node)
|
||||
end
|
||||
-- Add loot into chests.
|
||||
local chests = minetest.find_nodes_in_area(p1, p2, {
|
||||
"mcl_chests:chest_small",
|
||||
"mcl_chests:trapped_chest_small"
|
||||
})
|
||||
for c=1, #chests do
|
||||
local lootitems = mcl_loot.get_multi_loot({
|
||||
{
|
||||
stacks_min = 4,
|
||||
stacks_max = 8,
|
||||
items = {
|
||||
{ itemstring = "mcl_core:iron_nugget", weight = 46, amount_min = 9, amount_max = 18 },
|
||||
{ itemstring = "mcl_core:flint", weight = 46, amount_min = 1, amount_max = 4 },
|
||||
{ itemstring = "mcl_core:obsidian", weight = 46, amount_min = 1, amount_max = 2 },
|
||||
{ itemstring = "mcl_fire:fire_charge", weight = 46, },
|
||||
{ itemstring = "mcl_fire:flint_and_steel", weight = 46, },
|
||||
{ itemstring = "mcl_core:gold_nugget", weight = 21, amount_min = 4, amount_max = 24 },
|
||||
{ itemstring = "mcl_core:apple_gold", weight = 21 },
|
||||
-- TODO: enchanted golden axe / hoe / pickaxe / shovel / sword / helmet / chestplate / leggings / boots
|
||||
{ itemstring = "mcl_potions:speckled_melon", weight = 7, amount_min = 4, amount_max = 12 },
|
||||
{ itemstring = "mcl_farming:carrot_item_gold", weight = 7, amount_min = 4, amount_max = 12 },
|
||||
{ itemstring = "mcl_core:gold_ingot", weight = 7, amount_min = 2, amount_max = 6 },
|
||||
{ itemstring = "mcl_clock:clock", weight = 7, },
|
||||
{ itemstring = "mobs_mc:gold_horse_armor", weight = 7, },
|
||||
{ itemstring = "mcl_core:goldblock", weight = 2, amount_min = 1, amount_max = 2 },
|
||||
{ itemstring = "mcl_core:apple_gold_enchanted", weight = 2, },
|
||||
}
|
||||
}
|
||||
}, pr)
|
||||
|
||||
local meta = minetest.get_meta(chests[c])
|
||||
init_node_construct(chests[c])
|
||||
local meta = minetest.get_meta(chests[c])
|
||||
local inv = meta:get_inventory()
|
||||
mcl_loot.fill_inventory(inv, "main", lootitems, pr)
|
||||
end
|
||||
end
|
||||
|
||||
mcl_structures.generate_ruined_portal_large = function(pos, orientation, pr)
|
||||
-- Generates one out of 1 possible small ruined nether portals
|
||||
local newpos = {
|
||||
x = pos.x,
|
||||
y = pos.y - 10,
|
||||
z = pos.z
|
||||
}
|
||||
local portals = {
|
||||
"mcl_structures_ruined_portal_large_1.mts",
|
||||
}
|
||||
local r = pr:next(1, #portals)
|
||||
local path = minetest.get_modpath("mcl_structures") .. "/schematics/" .. portals[r]
|
||||
return mcl_structures.place_schematic(newpos, path, orientation, nil, true, nil, ruined_portal_callback, pr)
|
||||
end
|
||||
|
||||
mcl_structures.generate_ruined_portal_small = function(pos, orientation, pr)
|
||||
-- Generates one out of 5 possible small ruined nether portals
|
||||
local newpos = {
|
||||
x = pos.x,
|
||||
y = pos.y - 4,
|
||||
z = pos.z
|
||||
}
|
||||
local portals = {
|
||||
"mcl_structures_ruined_portal_small_1.mts",
|
||||
"mcl_structures_ruined_portal_small_2.mts",
|
||||
"mcl_structures_ruined_portal_small_3.mts",
|
||||
"mcl_structures_ruined_portal_small_4.mts",
|
||||
"mcl_structures_ruined_portal_small_5.mts"
|
||||
}
|
||||
local r = pr:next(1, #portals)
|
||||
local path = minetest.get_modpath("mcl_structures") .. "/schematics/" .. portals[r]
|
||||
return mcl_structures.place_schematic(newpos, path, orientation, nil, true, nil, ruined_portal_callback, pr)
|
||||
end
|
||||
|
||||
local function temple_placement_callback(p1, p2, size, rotation, pr)
|
||||
|
||||
-- Delete cacti leftovers:
|
||||
|
@ -534,7 +868,7 @@ end
|
|||
|
||||
-- Debug command
|
||||
minetest.register_chatcommand("spawnstruct", {
|
||||
params = "desert_temple | desert_well | igloo | witch_hut | boulder | ice_spike_small | ice_spike_large | fossil | end_exit_portal | end_portal_shrine",
|
||||
params = "desert_temple | desert_well | igloo | witch_hut | boulder | ice_spike_small | ice_spike_large | fossil | end_exit_portal | end_portal_shrine | ruined_portal_large | ruined_portal_small",
|
||||
description = S("Generate a pre-defined structure near your position."),
|
||||
privs = {debug = true},
|
||||
func = function(name, param)
|
||||
|
@ -568,6 +902,10 @@ minetest.register_chatcommand("spawnstruct", {
|
|||
mcl_structures.generate_end_exit_portal(pos, rot, pr)
|
||||
elseif param == "end_portal_shrine" then
|
||||
mcl_structures.generate_end_portal_shrine(pos, rot, pr)
|
||||
elseif param == "ruined_portal_large" then
|
||||
mcl_structures.generate_ruined_portal_large(pos, rot, pr)
|
||||
elseif param == "ruined_portal_small" then
|
||||
mcl_structures.generate_ruined_portal_small(pos, rot, pr)
|
||||
elseif param == "" then
|
||||
message = S("Error: No structure type given. Please use “/spawnstruct <type>”.")
|
||||
errord = true
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
name = mcl_structures
|
||||
depends = mcl_loot
|
||||
depends = mcl_init, mcl_loot
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue