Merge pull request #1 from TheLie0/TheLie0-globals

The lie0 globals
This commit is contained in:
TheLie0 2020-09-29 14:51:36 +02:00 committed by GitHub
commit 5604456a25
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 8 deletions

View file

@ -44,12 +44,12 @@ This portal seemed to bring us to some kind of heavenly paradise.@1]],
is_within_realm = function(pos) -- return true if pos is inside the Aether is_within_realm = function(pos) -- return true if pos is inside the Aether
-- TODO: Get these values from mod-wide constants. -- TODO: Get these values from mod-wide constants.
return (pos.y >= 250 and pos.y <= 1000) return (pos.y >= aether2.lower_bound and pos.y <= aether2.upper_bound)
end, end,
find_realm_anchorPos = function(surface_anchorPos, player_name) find_realm_anchorPos = function(surface_anchorPos, player_name)
-- TODO: implement a surface algorithm that finds land -- TODO: implement a surface algorithm that finds land
local destination_pos = {x = surface_anchorPos.x ,y = 500, z = surface_anchorPos.z} local destination_pos = {x = surface_anchorPos.x ,y = aether2.upper_bound, 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) -- 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) local existing_portal_location, existing_portal_orientation = nether.find_nearest_working_portal("aether_portal", destination_pos, 10, 0)

View file

@ -1,17 +1,18 @@
local minbiomey = 250 aether2.lower_bound = 250
local maxbiomey = 1000 aether2.upper_bound = 1000
local seed = 555 aether2.seed = 555
minetest.register_on_generated(function(minp, maxp, blockseed) minetest.register_on_generated(function(minp, maxp, blockseed)
--120 bottom of clouds --120 bottom of clouds
if minp.y >= minbiomey and maxp.y <= maxbiomey then if minp.y >= aether2.lower_bound and maxp.y <= aether2.upper_bound then
--the () is the line in api doc --the () is the line in api doc
--1 seed (2565) 2 octaves (2580) 3 persistance (2596) scale (2524) --1 seed (2565) 2 octaves (2580) 3 persistance (2596) scale (2524)
local perlin = PerlinNoise(seed, 3, 1, 100) --3,10,50 for crazy caves -- 3, 1, 100 for floating islands 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 height = snowrange_height
local air = minetest.get_content_id("air") local air =
etest.get_content_id("air")
local dirt = minetest.get_content_id("aether2:aether_dirt") local dirt = minetest.get_content_id("aether2:aether_dirt")
local stone = minetest.get_content_id("aether2:holystone") local stone = minetest.get_content_id("aether2:holystone")
local water = minetest.get_content_id("default:water_source") local water = minetest.get_content_id("default:water_source")