mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-11-22 07:23:00 +00:00
Tidy up debug messages
This commit is contained in:
parent
db21baa539
commit
f8a6a204f8
4 changed files with 8 additions and 12 deletions
|
@ -40,11 +40,9 @@ function worldeditadditions.raycast(player, maxdist, skip_liquid)
|
||||||
if node ~= nil then
|
if node ~= nil then
|
||||||
local node_id = minetest.get_content_id(node.name)
|
local node_id = minetest.get_content_id(node.name)
|
||||||
local is_air = worldeditadditions.is_airlike(node_id)
|
local is_air = worldeditadditions.is_airlike(node_id)
|
||||||
print("[raycast] Scanning "..worldeditadditions.vector.tostring(cur_pos)..", i: "..i..", j: "..j..", found", node.name, "is_air", is_air)
|
|
||||||
|
|
||||||
-- ignore = unloaded chunks, as far as I can tell
|
-- ignore = unloaded chunks, as far as I can tell
|
||||||
if node_id == node_id_ignore then
|
if node_id == node_id_ignore then
|
||||||
print("[raycast] found ignore, returning nil")
|
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -53,7 +51,6 @@ function worldeditadditions.raycast(player, maxdist, skip_liquid)
|
||||||
return node_pos, node_id
|
return node_pos, node_id
|
||||||
else
|
else
|
||||||
local is_liquid = worldeditadditions.is_liquidlike(node_id)
|
local is_liquid = worldeditadditions.is_liquidlike(node_id)
|
||||||
print("[raycast] is_liquid ", is_liquid)
|
|
||||||
if is_liquid == false then
|
if is_liquid == false then
|
||||||
return node_pos, node_id
|
return node_pos, node_id
|
||||||
end
|
end
|
||||||
|
|
|
@ -26,7 +26,6 @@ minetest.register_chatcommand("/farwand", {
|
||||||
func = function(name, params_text)
|
func = function(name, params_text)
|
||||||
if name == nil then return end
|
if name == nil then return end
|
||||||
local success, key, value = parse_params_farwand(params_text)
|
local success, key, value = parse_params_farwand(params_text)
|
||||||
print("[/farwand] ", success, key, value)
|
|
||||||
if success == false then
|
if success == false then
|
||||||
worldedit.player_notify(name, key)
|
worldedit.player_notify(name, key)
|
||||||
return
|
return
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
local function set_pos1(name, pos)
|
local function set_pos1(name, pos)
|
||||||
if pos ~= nil then
|
if pos ~= nil then
|
||||||
print("[set_pos1]", name, "("..pos.x..", "..pos.y..", "..pos.z..")")
|
-- print("[set_pos1]", name, "("..pos.x..", "..pos.y..", "..pos.z..")")
|
||||||
worldedit.pos1[name] = pos
|
worldedit.pos1[name] = pos
|
||||||
worldedit.mark_pos1(name)
|
worldedit.mark_pos1(name)
|
||||||
else
|
else
|
||||||
print("[set_pos1]", name, "nil")
|
-- print("[set_pos1]", name, "nil")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local function set_pos2(name, pos)
|
local function set_pos2(name, pos)
|
||||||
if pos ~= nil then
|
if pos ~= nil then
|
||||||
print("[set_pos2]", name, "("..pos.x..", "..pos.y..", "..pos.z..")")
|
-- print("[set_pos2]", name, "("..pos.x..", "..pos.y..", "..pos.z..")")
|
||||||
worldedit.pos2[name] = pos
|
worldedit.pos2[name] = pos
|
||||||
worldedit.mark_pos2(name)
|
worldedit.mark_pos2(name)
|
||||||
else
|
else
|
||||||
print("[set_pos2]", name, "nil")
|
-- print("[set_pos2]", name, "nil")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ minetest.register_tool(":worldeditadditions:farwand", {
|
||||||
|
|
||||||
on_place = function(itemstack, player, pointed_thing)
|
on_place = function(itemstack, player, pointed_thing)
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
print("[farwand] on_place", name)
|
-- print("[farwand] on_place", name)
|
||||||
-- Right click when pointing at something
|
-- Right click when pointing at something
|
||||||
-- Pointed thing: https://rubenwardy.com/minetest_modding_book/lua_api.html#pointed_thing
|
-- Pointed thing: https://rubenwardy.com/minetest_modding_book/lua_api.html#pointed_thing
|
||||||
local looking_pos, node_id = do_raycast(player)
|
local looking_pos, node_id = do_raycast(player)
|
||||||
|
@ -48,7 +48,7 @@ minetest.register_tool(":worldeditadditions:farwand", {
|
||||||
|
|
||||||
on_use = function(itemstack, player, pointed_thing)
|
on_use = function(itemstack, player, pointed_thing)
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
print("[farwand] on_use", name)
|
-- print("[farwand] on_use", name)
|
||||||
local looking_pos, node_id = do_raycast(player)
|
local looking_pos, node_id = do_raycast(player)
|
||||||
set_pos1(name, looking_pos)
|
set_pos1(name, looking_pos)
|
||||||
-- Left click when pointing at something or nothing
|
-- Left click when pointing at something or nothing
|
||||||
|
@ -57,7 +57,7 @@ minetest.register_tool(":worldeditadditions:farwand", {
|
||||||
on_secondary_use = function(itemstack, player, pointed_thing)
|
on_secondary_use = function(itemstack, player, pointed_thing)
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
-- Right click when pointing at nothing
|
-- Right click when pointing at nothing
|
||||||
print("[farwand] on_secondary_use", name)
|
-- print("[farwand] on_secondary_use", name)
|
||||||
|
|
||||||
local looking_pos, node_id = do_raycast(player)
|
local looking_pos, node_id = do_raycast(player)
|
||||||
set_pos2(name, looking_pos)
|
set_pos2(name, looking_pos)
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
-- @param name The name of the player to ensure has a settings object.
|
-- @param name The name of the player to ensure has a settings object.
|
||||||
local function settings_init(name)
|
local function settings_init(name)
|
||||||
if worldeditadditions.farwand.player_data[name] == nil then
|
if worldeditadditions.farwand.player_data[name] == nil then
|
||||||
print("[settings_init] ", worldeditadditions.farwand.player_data)
|
minetest.log("INFO", "Initialising settings for "..name)
|
||||||
worldeditadditions.farwand.player_data[name] = {
|
worldeditadditions.farwand.player_data[name] = {
|
||||||
maxdist = 1000,
|
maxdist = 1000,
|
||||||
skip_liquid = true
|
skip_liquid = true
|
||||||
|
|
Loading…
Reference in a new issue