Update portal.lua

This commit is contained in:
TheLie0 2020-09-28 23:57:52 +02:00 committed by GitHub
parent 5cfe641fd4
commit 5f8a66d076
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -26,7 +26,7 @@ floatlands_flavortext = ""
nether.register_portal("aether_portal", { nether.register_portal("aether_portal", {
frame_node_name = "nether:glowstone", frame_node_name = "nether:glowstone",
wormhole_node_color = 2, -- 2 is blue wormhole_node_color = 4, -- 4 is cyan
particle_texture = { particle_texture = {
name = "nether_particle_anim1.png", name = "nether_particle_anim1.png",
animation = { animation = {
@ -44,12 +44,19 @@ 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 >= 250 and pos.y <= 1000)
end, end,
find_realm_anchorPos = function(surface_anchorPos, player_name) find_realm_anchorPos = function(surface_anchorPos, player_name)
-- This function isn't needed, since this type of portal always goes to the surface -- TODO: implement a surface algorithm that finds land
minetest.log("error" , "find_realm_anchorPos called for aether portal") local destination_pos = {x = surface_anchorPos.x ,y = 500, z = surface_anchorPos.z}
return {x=0, y=0, z=0}
-- 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)
if existing_portal_location ~= nil then
return existing_portal_location, existing_portal_orientation
else
return destination_pos
end
end, end,
}) })