From 695f64f86dee18ce5c5aeb53f67e8d42cebb6fab Mon Sep 17 00:00:00 2001 From: Milan Date: Mon, 1 Feb 2021 12:06:49 +0100 Subject: [PATCH] illuna_aestival: properly introduce astroportal, closes #12 --- illuna_aestival/init.lua | 3 +- illuna_aestival/schematics/astroportal.lua | 24 ++++++++ illuna_aestival/src/mapgen.lua | 54 ++++++++++++------ illuna_aestival/src/nodes.lua | 8 +++ illuna_aestival/src/portal.lua | 4 +- .../textures/illuna_astroportal_block.png | Bin 0 -> 143 bytes 6 files changed, 71 insertions(+), 22 deletions(-) create mode 100644 illuna_aestival/schematics/astroportal.lua create mode 100644 illuna_aestival/textures/illuna_astroportal_block.png diff --git a/illuna_aestival/init.lua b/illuna_aestival/init.lua index ddd079f..9e6b10d 100755 --- a/illuna_aestival/init.lua +++ b/illuna_aestival/init.lua @@ -1,4 +1,5 @@ local path = minetest.get_modpath("illuna_aestival") .. "/src" +illuna = {} -- stuff dofile(path .. "/nodes.lua") @@ -14,4 +15,4 @@ dofile(path .. "/signs.lua") dofile(path .. "/replacer.lua") dofile(path .. "/mobs.lua") dofile(path .. "/portal.lua") -dofile(path .. "/moreblocks.lua") \ No newline at end of file +dofile(path .. "/moreblocks.lua") diff --git a/illuna_aestival/schematics/astroportal.lua b/illuna_aestival/schematics/astroportal.lua new file mode 100644 index 0000000..80ce45f --- /dev/null +++ b/illuna_aestival/schematics/astroportal.lua @@ -0,0 +1,24 @@ +local ai = {name = "air", param1 = 000} +local ap = {name = "illuna:astroportal_block", param = 100} + +illuna.astroportal = { + size = {x = 5, y = 2, z = 5}, + data = { + + ai, ai, ai, ai, ai, + ai, ap, ap, ap, ai, + + ai, ap, ap, ap, ai, + ap, ai, ai, ai, ap, + + ai, ap, ap, ap, ai, + ap, ai, ai, ai, ap, + + ai, ap, ap, ap, ai, + ap, ai, ai, ai, ap, + + ai, ai, ai, ai, ai, + ai, ap, ap, ap, ai, + + }, +} diff --git a/illuna_aestival/src/mapgen.lua b/illuna_aestival/src/mapgen.lua index e7f9c9d..15e54a0 100755 --- a/illuna_aestival/src/mapgen.lua +++ b/illuna_aestival/src/mapgen.lua @@ -3,27 +3,24 @@ local path = minetest.get_modpath("illuna_aestival") local dpath = minetest.get_modpath("default") .. "/schematics/" path = path .. "/schematics/" - local add_node = function(a, b, c, d, e, f, g, h, i, j) - - if j ~= 1 then return end - -minetest.register_decoration({ -deco_type = "simple", -place_on = a, -sidelen = 80, -fill_ratio = b, -biomes = c, -y_min = d, -y_max = e, -decoration = f, -height_max = g, -spawn_by = h, -num_spawn_by = i, - rotation = "random", - }) - end +if j ~= 1 then return end + minetest.register_decoration({ + deco_type = "simple", + place_on = a, + sidelen = 80, + fill_ratio = b, + biomes = c, + y_min = d, + y_max = e, + decoration = f, + height_max = g, + spawn_by = h, + num_spawn_by = i, + rotation = "random", + }) +end @@ -114,3 +111,22 @@ local add_schem = function(a, b, c, d, e, f, g, h) }) end add_schem({"ethereal:mesa_dirt"}, 0.04, {"mesa"}, 1, 100, path .. "douglasie.mts") + +dofile(path .. "astroportal.lua") + +minetest.register_decoration({ + name = "Ancient broken astro portal", + deco_type = "schematic", + place_on = "default:sand", + sidelen = 80, + fill_ratio = 0.00018, + biomes = "desert", + y_max = 2300, + y_min = 1250, + schematic = illuna.astroportal, + place_offset_y = 0, + rotation = "random", +}) + + + diff --git a/illuna_aestival/src/nodes.lua b/illuna_aestival/src/nodes.lua index 9ce0172..a306b34 100755 --- a/illuna_aestival/src/nodes.lua +++ b/illuna_aestival/src/nodes.lua @@ -323,3 +323,11 @@ minetest.register_entity(":illuna:wikitop", { minetest.register_craftitem(":illuna:wikitop", { inventory_image = "illuna_wikitop.png", }) + +minetest.register_node(":illuna:astroportal_block", { + description = "Ancient Astro Portal Block", + tiles = {"illuna_astroportal_block.png"}, + is_ground_content = false, + groups = {wood = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 3}, + sounds = default.node_sound_wood_defaults(), +}) diff --git a/illuna_aestival/src/portal.lua b/illuna_aestival/src/portal.lua index 238ec80..86b8dcd 100644 --- a/illuna_aestival/src/portal.lua +++ b/illuna_aestival/src/portal.lua @@ -5,7 +5,7 @@ nether.register_portal( "asteroid_portal", { shape = nether.PortalShape_Platform, - frame_node_name = "default:goldblock", + frame_node_name = "illuna:astroportal_block", wormhole_node_color = 5, particle_texture = { name = "nether_particle_anim1.png", @@ -18,7 +18,7 @@ nether.register_portal( scale = 1.5 }, title = "Asteroid Portal", - book_of_portals_pagetext = [[Requiring 21 blocks of gold, and constructed in the shape of a 3 × 3 platform with walls, or like a bowl. A finished platform is 2 blocks high, and 5 blocks wide at the widest in both directions. + book_of_portals_pagetext = [[Requiring 21 blocks of ancient astro-portal blocks, and constructed in the shape of a 3 × 3 platform with walls, or like a bowl. A finished platform is 2 blocks high, and 5 blocks wide at the widest in both directions. This portal is different to the others, rather than acting akin to a doorway it appears to the eye more like a small pool of water which can be stepped into. Upon setting foot in the portal we found ourselves at a tremendous altitude.]], is_within_realm = function(pos) -- return true if pos is inside the Nether return pos.y > OTHER_WORLDS_LEVEL - 200 diff --git a/illuna_aestival/textures/illuna_astroportal_block.png b/illuna_aestival/textures/illuna_astroportal_block.png new file mode 100644 index 0000000000000000000000000000000000000000..765995edf538db520fc796ddc44b023019994bc3 GIT binary patch literal 143 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPE^3h)VWRdbW&_1E)slC}@Dj0{xx z|Np=8lpPH~Sqo1W#}JO|$pRupA}ow-iOT883I;8P5}XD+0zBd@%q#BRkeK<9Crv`x naLPg+bqnSd5^vbl9UU3|Oc34j+q&p9&