From 8122b8215071e13c96972f187024cf06fcd67e57 Mon Sep 17 00:00:00 2001 From: Dannieboy Date: Tue, 29 Sep 2020 18:02:06 +0200 Subject: [PATCH] Fixed globals, removed upper bound and raised lower bound to 5000. --- init.lua | 3 +++ portal.lua | 8 ++++---- worldgen.lua | 8 +++----- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/init.lua b/init.lua index e5451e0..611dade 100644 --- a/init.lua +++ b/init.lua @@ -1,3 +1,6 @@ +-- create global namespace +aether2 = {} + dofile(minetest.get_modpath('aether2') .. '/nodes.lua') dofile(minetest.get_modpath('aether2') .. '/tools.lua') dofile(minetest.get_modpath('aether2') .. '/crafting.lua') diff --git a/portal.lua b/portal.lua index c02822a..c1852d7 100644 --- a/portal.lua +++ b/portal.lua @@ -22,7 +22,7 @@ local S = nether.get_translator -floatlands_flavortext = "" +aether_flavortext = "" nether.register_portal("aether_portal", { frame_node_name = "nether:glowstone", @@ -40,16 +40,16 @@ nether.register_portal("aether_portal", { title = S("Floatlands Portal"), book_of_portals_pagetext = S([[Requiring 14 blocks of glowstone, and constructed like a nether portal. This portal seemed to bring us to some kind of heavenly paradise.@1]], - floatlands_flavortext), + aether_flavortext), is_within_realm = function(pos) -- return true if pos is inside the Aether -- TODO: Get these values from mod-wide constants. - return (pos.y >= aether2.lower_bound and pos.y <= aether2.upper_bound) + return (pos.y >= aether2.lower_bound) end, find_realm_anchorPos = function(surface_anchorPos, player_name) -- TODO: implement a surface algorithm that finds land - local destination_pos = {x = surface_anchorPos.x ,y = aether2.upper_bound, z = surface_anchorPos.z} + local destination_pos = {x = surface_anchorPos.x ,y = aether2.lower_bound + 100, z = surface_anchorPos.z} -- a y_factor of 0 makes the search ignore the altitude of the portals (as long as they are in the Aether) local existing_portal_location, existing_portal_orientation = nether.find_nearest_working_portal("aether_portal", destination_pos, 10, 0) diff --git a/worldgen.lua b/worldgen.lua index cda1222..8ed0874 100644 --- a/worldgen.lua +++ b/worldgen.lua @@ -1,18 +1,16 @@ -aether2.lower_bound = 250 -aether2.upper_bound = 1000 +aether2.lower_bound = 5000 aether2.seed = 555 minetest.register_on_generated(function(minp, maxp, blockseed) --120 bottom of clouds -if minp.y >= aether2.lower_bound and maxp.y <= aether2.upper_bound then +if minp.y >= aether2.lower_bound then --the () is the line in api doc --1 seed (2565) 2 octaves (2580) 3 persistance (2596) scale (2524) local perlin = PerlinNoise(aether2.seed, 3, 1, 100) --3,10,50 for crazy caves -- 3, 1, 100 for floating islands local height = snowrange_height - local air = - etest.get_content_id("air") + local air = minetest.get_content_id("air") local dirt = minetest.get_content_id("aether2:aether_dirt") local stone = minetest.get_content_id("aether2:holystone") local water = minetest.get_content_id("default:water_source")