Tidy up debug messages

This commit is contained in:
Starbeamrainbowlabs 2020-06-15 13:04:42 +01:00
parent db21baa539
commit f8a6a204f8
Signed by: sbrl
GPG key ID: 1BE5172E637709C2
4 changed files with 8 additions and 12 deletions

View file

@ -40,11 +40,9 @@ function worldeditadditions.raycast(player, maxdist, skip_liquid)
if node ~= nil then
local node_id = minetest.get_content_id(node.name)
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
if node_id == node_id_ignore then
print("[raycast] found ignore, returning nil")
return nil
end
@ -53,7 +51,6 @@ function worldeditadditions.raycast(player, maxdist, skip_liquid)
return node_pos, node_id
else
local is_liquid = worldeditadditions.is_liquidlike(node_id)
print("[raycast] is_liquid ", is_liquid)
if is_liquid == false then
return node_pos, node_id
end

View file

@ -26,7 +26,6 @@ minetest.register_chatcommand("/farwand", {
func = function(name, params_text)
if name == nil then return end
local success, key, value = parse_params_farwand(params_text)
print("[/farwand] ", success, key, value)
if success == false then
worldedit.player_notify(name, key)
return

View file

@ -1,19 +1,19 @@
local function set_pos1(name, pos)
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.mark_pos1(name)
else
print("[set_pos1]", name, "nil")
-- print("[set_pos1]", name, "nil")
end
end
local function set_pos2(name, pos)
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.mark_pos2(name)
else
print("[set_pos2]", name, "nil")
-- print("[set_pos2]", name, "nil")
end
end
@ -39,7 +39,7 @@ minetest.register_tool(":worldeditadditions:farwand", {
on_place = function(itemstack, player, pointed_thing)
local name = player:get_player_name()
print("[farwand] on_place", name)
-- print("[farwand] on_place", name)
-- Right click when pointing at something
-- Pointed thing: https://rubenwardy.com/minetest_modding_book/lua_api.html#pointed_thing
local looking_pos, node_id = do_raycast(player)
@ -48,7 +48,7 @@ minetest.register_tool(":worldeditadditions:farwand", {
on_use = function(itemstack, player, pointed_thing)
local name = player:get_player_name()
print("[farwand] on_use", name)
-- print("[farwand] on_use", name)
local looking_pos, node_id = do_raycast(player)
set_pos1(name, looking_pos)
-- 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)
local name = player:get_player_name()
-- 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)
set_pos2(name, looking_pos)

View file

@ -2,7 +2,7 @@
-- @param name The name of the player to ensure has a settings object.
local function settings_init(name)
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] = {
maxdist = 1000,
skip_liquid = true