mirror of
https://github.com/minetest-mods/nether.git
synced 2024-12-28 20:00:30 +01:00
Update .luacheckrc and fix warnings
Changes to reduce formatting warnings will be committed separately
This commit is contained in:
parent
1d19546345
commit
d0ce9dd633
@ -10,10 +10,15 @@ read_globals = {
|
|||||||
"default",
|
"default",
|
||||||
"DIR_DELIM",
|
"DIR_DELIM",
|
||||||
"dump",
|
"dump",
|
||||||
|
"dungeon_loot",
|
||||||
"intllib",
|
"intllib",
|
||||||
"ItemStack",
|
"ItemStack",
|
||||||
|
"loot",
|
||||||
|
"math.hypot",
|
||||||
|
"mesecon",
|
||||||
"minetest",
|
"minetest",
|
||||||
"nodeupdate",
|
"nodeupdate",
|
||||||
|
"PcgRandom",
|
||||||
"PseudoRandom",
|
"PseudoRandom",
|
||||||
"stairs",
|
"stairs",
|
||||||
"stairsplus",
|
"stairsplus",
|
||||||
|
@ -295,7 +295,7 @@ nether.PortalShape_Circular = {
|
|||||||
get_p1_and_p2_from_anchorPos = function(self, anchorPos, orientation)
|
get_p1_and_p2_from_anchorPos = function(self, anchorPos, orientation)
|
||||||
assert(orientation, "no orientation passed")
|
assert(orientation, "no orientation passed")
|
||||||
assert(self ~= nil and self.name == nether.PortalShape_Circular.name, "Must pass self as first argument, or use shape:func() instead of shape.func()")
|
assert(self ~= nil and self.name == nether.PortalShape_Circular.name, "Must pass self as first argument, or use shape:func() instead of shape.func()")
|
||||||
local p1 = anchorPos -- PortalShape_Traditional puts the anchorPos at p1 for backwards&forwards compatibility
|
local p1
|
||||||
local p2
|
local p2
|
||||||
|
|
||||||
if orientation == 0 then
|
if orientation == 0 then
|
||||||
@ -1528,9 +1528,9 @@ end
|
|||||||
function register_frame_node(frame_node_name)
|
function register_frame_node(frame_node_name)
|
||||||
|
|
||||||
-- copy the existing node definition
|
-- copy the existing node definition
|
||||||
local node = minetest.registered_nodes[frame_node_name]
|
local node_def = minetest.registered_nodes[frame_node_name]
|
||||||
local extended_node_def = {}
|
local extended_node_def = {}
|
||||||
for key, value in pairs(node) do extended_node_def[key] = value end
|
for key, value in pairs(node_def) do extended_node_def[key] = value end
|
||||||
|
|
||||||
extended_node_def.replaced_by_portalapi = {} -- allows chaining or restoration of original functions, if necessary
|
extended_node_def.replaced_by_portalapi = {} -- allows chaining or restoration of original functions, if necessary
|
||||||
|
|
||||||
@ -1916,7 +1916,7 @@ function nether.find_surface_target_y(target_x, target_z, portal_name)
|
|||||||
|
|
||||||
-- try to spawn on surface first
|
-- try to spawn on surface first
|
||||||
if minetest.get_spawn_level ~= nil then -- older versions of Minetest don't have this
|
if minetest.get_spawn_level ~= nil then -- older versions of Minetest don't have this
|
||||||
surface_level = minetest.get_spawn_level(target_x, target_z)
|
local surface_level = minetest.get_spawn_level(target_x, target_z)
|
||||||
if surface_level ~= nil then -- test this since get_spawn_level() can return nil over water or steep/high terrain
|
if surface_level ~= nil then -- test this since get_spawn_level() can return nil over water or steep/high terrain
|
||||||
|
|
||||||
-- get_spawn_level() tends to err on the side of caution and spawns the player a
|
-- get_spawn_level() tends to err on the side of caution and spawns the player a
|
||||||
@ -1978,7 +1978,7 @@ function nether.find_nearest_working_portal(portal_name, anchorPos, distance_lim
|
|||||||
|
|
||||||
-- the mod_storage list of portals is unreliable - e.g. it won't know if inactive portals have been
|
-- the mod_storage list of portals is unreliable - e.g. it won't know if inactive portals have been
|
||||||
-- destroyed, so check the portal is still there
|
-- destroyed, so check the portal is still there
|
||||||
local portalFound, portalActive = is_portal_at_anchorPos(portal_definition, portal_info.anchorPos, portal_info.orientation, true)
|
local portalFound, portalIsActive = is_portal_at_anchorPos(portal_definition, portal_info.anchorPos, portal_info.orientation, true)
|
||||||
|
|
||||||
if portalFound then
|
if portalFound then
|
||||||
return portal_info.anchorPos, portal_info.orientation
|
return portal_info.anchorPos, portal_info.orientation
|
||||||
|
@ -44,7 +44,7 @@ local SURFACE_TRAVEL_DISTANCE = 26
|
|||||||
--=================================================--
|
--=================================================--
|
||||||
-- Portal to the Floatlands, playable code example --
|
-- Portal to the Floatlands, playable code example --
|
||||||
--==================================================--
|
--==================================================--
|
||||||
local FLOATLANDS_ENABLED = false
|
local FLOATLANDS_ENABLED
|
||||||
local FLOATLAND_LEVEL = 1280
|
local FLOATLAND_LEVEL = 1280
|
||||||
|
|
||||||
if minetest.settings:get_bool("nether_enable_portal_example_floatlands", ENABLE_PORTAL_EXAMPLE_FLOATLANDS) or ENABLE_PORTAL_EXAMPLE_FLOATLANDS then
|
if minetest.settings:get_bool("nether_enable_portal_example_floatlands", ENABLE_PORTAL_EXAMPLE_FLOATLANDS) or ENABLE_PORTAL_EXAMPLE_FLOATLANDS then
|
||||||
@ -155,7 +155,7 @@ if minetest.settings:get_bool("nether_enable_portal_example_surfacetravel", ENAB
|
|||||||
|
|
||||||
find_realm_anchorPos = function(surface_anchorPos)
|
find_realm_anchorPos = function(surface_anchorPos)
|
||||||
-- This function isn't needed, since this type of portal always goes to the surface
|
-- This function isn't needed, since this type of portal always goes to the surface
|
||||||
minecraft.log("error" , "find_realm_anchorPos called for surface portal")
|
minetest.log("error" , "find_realm_anchorPos called for surface portal")
|
||||||
return {x=0, y=0, z=0}
|
return {x=0, y=0, z=0}
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user