@@ -4,8 +4,10 @@ jumpdrive.simulate_jump = function(pos, player, show_marker)
4
4
5
5
local targetPos = jumpdrive .get_meta_pos (pos )
6
6
7
- if jumpdrive .check_mapgen (pos ) then
8
- return false , " Error: mapgen was active in this area, please try again later for your own safety!"
7
+ local mapgen_distance = jumpdrive .check_mapgen (pos )
8
+ if mapgen_distance then
9
+ return false , " Error: mapgen was active " .. math.floor (mapgen_distance )
10
+ .. " / 200 nodes away, please try again later for your own safety!"
9
11
end
10
12
11
13
local meta = minetest .get_meta (pos )
@@ -50,7 +52,7 @@ jumpdrive.simulate_jump = function(pos, player, show_marker)
50
52
meta :set_int (" simulation_expiry" , shape .expiry )
51
53
end
52
54
53
- local msg = nil
55
+ local msg = " "
54
56
local success = true
55
57
56
58
local blacklisted_pos_list = minetest .find_nodes_in_area (source_pos1 , source_pos2 , jumpdrive .blacklist )
@@ -60,12 +62,13 @@ jumpdrive.simulate_jump = function(pos, player, show_marker)
60
62
end
61
63
62
64
if minetest .find_node_near (targetPos , radius , " vacuum:vacuum" , true ) then
63
- msg = " Warning : Jump-target is in vacuum!"
65
+ msg = msg .. " \n Warning : Jump-target is in vacuum!"
64
66
end
65
67
66
- if minetest .find_node_near (targetPos , radius , " ignore" , true ) then
67
- return false , " Warning: Jump-target is in uncharted area"
68
- end
68
+ -- -- found to be useless/indescriptive and is superseded by "Jump-target is uncharted"
69
+ -- if minetest.find_node_near(targetPos, radius, "ignore", true) then
70
+ -- return false, "Warning: Jump-target is in uncharted area"
71
+ -- end
69
72
70
73
if jumpdrive .is_area_protected (source_pos1 , source_pos2 , playername ) then
71
74
return false , " Jump-source is protected!"
@@ -78,7 +81,15 @@ jumpdrive.simulate_jump = function(pos, player, show_marker)
78
81
local is_empty , empty_msg = jumpdrive .is_area_empty (target_pos1 , target_pos2 )
79
82
80
83
if not is_empty then
81
- msg = " Jump-target is obstructed (" .. empty_msg .. " )"
84
+ if jumpdrive .config .emerge_uncharted and empty_msg == " uncharted" then
85
+ local callback = function (_ , _ , calls_remaining , _ )
86
+ if calls_remaining == 0 then
87
+ core .chat_send_player (playername , " Charting complete!" )
88
+ end
89
+ end
90
+ core .emerge_area (target_pos1 , target_pos2 , callback )
91
+ end
92
+ msg = msg .. " \n Jump-target is " .. empty_msg
82
93
success = false
83
94
end
84
95
@@ -87,7 +98,7 @@ jumpdrive.simulate_jump = function(pos, player, show_marker)
87
98
88
99
if not preflight_result .success then
89
100
-- check failed in customization
90
- msg = " Preflight check failed!"
101
+ msg = msg .. " \n Preflight check failed!"
91
102
if preflight_result .message then
92
103
msg = preflight_result .message
93
104
end
@@ -99,7 +110,7 @@ jumpdrive.simulate_jump = function(pos, player, show_marker)
99
110
100
111
if powerstorage < power_req then
101
112
-- not enough power
102
- msg = " Not enough power: required=" .. math.floor (power_req ) .. " , actual: " .. powerstorage .. " EU"
113
+ msg = msg .. " \n Not enough power: required=" .. math.floor (power_req ) .. " , actual: " .. powerstorage .. " EU"
103
114
success = false
104
115
end
105
116
0 commit comments