mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-12-24 22:52:24 +01:00
Remove a whole bunch of stray debug print statements
This commit is contained in:
parent
0212950d87
commit
0b0595a1d3
@ -66,7 +66,7 @@ function worldeditadditions.forest(pos1, pos2, density_multiplier, sapling_weigh
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
if not did_grow then
|
if not did_grow then
|
||||||
print("[//forest] Failed to grow sapling, detected node id", new_id_at_pos, "name", new_name_at_pos, "was originally", minetest.get_name_from_content_id(node_id))
|
-- print("[//forest] Failed to grow sapling, detected node id", new_id_at_pos, "name", new_name_at_pos, "was originally", minetest.get_name_from_content_id(node_id))
|
||||||
-- We can't set it to air here because then when we save back we would overwrite all the newly grown trees
|
-- We can't set it to air here because then when we save back we would overwrite all the newly grown trees
|
||||||
stats.failures = stats.failures + 1
|
stats.failures = stats.failures + 1
|
||||||
end
|
end
|
||||||
|
@ -14,7 +14,6 @@ function worldeditadditions.line(pos1, pos2, thickness, node_name)
|
|||||||
pos2 = vector.new(pos2)
|
pos2 = vector.new(pos2)
|
||||||
|
|
||||||
local node_id_replace = minetest.get_content_id(node_name)
|
local node_id_replace = minetest.get_content_id(node_name)
|
||||||
print("thickness", thickness, "node_name", node_name, "node_id_replace", node_id_replace)
|
|
||||||
|
|
||||||
-- Fetch the nodes in the specified area
|
-- Fetch the nodes in the specified area
|
||||||
local manip, area = worldedit.manip_helpers.init(pos1, pos2)
|
local manip, area = worldedit.manip_helpers.init(pos1, pos2)
|
||||||
@ -37,7 +36,6 @@ function worldeditadditions.line(pos1, pos2, thickness, node_name)
|
|||||||
local distance = vector.length(vector.subtract(here, closest_on_line))
|
local distance = vector.length(vector.subtract(here, closest_on_line))
|
||||||
|
|
||||||
if distance < thickness then
|
if distance < thickness then
|
||||||
print("[line] vector", closest_on_line.x, closest_on_line.y, closest_on_line.z, "length", distance)
|
|
||||||
data[area:index(x, y, z)] = node_id_replace
|
data[area:index(x, y, z)] = node_id_replace
|
||||||
counts.replaced = counts.replaced + 1
|
counts.replaced = counts.replaced + 1
|
||||||
end
|
end
|
||||||
|
@ -16,14 +16,12 @@ function worldeditadditions.noise.apply_2d(heightmap, noise, heightmap_size, pos
|
|||||||
|
|
||||||
local region_height = pos2.y - pos1.y
|
local region_height = pos2.y - pos1.y
|
||||||
|
|
||||||
print("NOISE\n")
|
-- print("NOISE\n")
|
||||||
worldeditadditions.format.array_2d(noise, heightmap_size.x)
|
-- worldeditadditions.format.array_2d(noise, heightmap_size.x)
|
||||||
|
|
||||||
|
|
||||||
local height = tonumber(apply_mode)
|
local height = tonumber(apply_mode)
|
||||||
|
|
||||||
print("HEIGHT", height)
|
|
||||||
|
|
||||||
for z = heightmap_size.z - 1, 0, -1 do
|
for z = heightmap_size.z - 1, 0, -1 do
|
||||||
for x = heightmap_size.x - 1, 0, -1 do
|
for x = heightmap_size.x - 1, 0, -1 do
|
||||||
local i = (z * heightmap_size.x) + x
|
local i = (z * heightmap_size.x) + x
|
||||||
@ -35,15 +33,12 @@ function worldeditadditions.noise.apply_2d(heightmap, noise, heightmap_size, pos
|
|||||||
elseif height then
|
elseif height then
|
||||||
-- Rescale from 0 - 1 to -1 - +1
|
-- Rescale from 0 - 1 to -1 - +1
|
||||||
local rescaled = (noise[i] * 2) - 1
|
local rescaled = (noise[i] * 2) - 1
|
||||||
-- print("DEBUG x", x, "z", z, "rescaled 1", rescaled)
|
|
||||||
-- Rescale to match the height specified
|
-- Rescale to match the height specified
|
||||||
rescaled = rescaled * height
|
rescaled = rescaled * height
|
||||||
-- print("DEBUG x", x, "z", z, "rescaled 2", rescaled)
|
|
||||||
rescaled = math.floor(wea.clamp(
|
rescaled = math.floor(wea.clamp(
|
||||||
heightmap[i] + rescaled,
|
heightmap[i] + rescaled,
|
||||||
0, region_height
|
0, region_height
|
||||||
))
|
))
|
||||||
-- print("DEBUG x", x, "z", z, "before", heightmap[i], "after", rescaled)
|
|
||||||
heightmap[i] = rescaled
|
heightmap[i] = rescaled
|
||||||
else
|
else
|
||||||
return false, "Error: Unknown apply mode '"..apply_mode.."'"
|
return false, "Error: Unknown apply mode '"..apply_mode.."'"
|
||||||
|
@ -13,8 +13,6 @@ local wea = worldeditadditions
|
|||||||
function worldeditadditions.noise.make_2d(size, start_pos, params)
|
function worldeditadditions.noise.make_2d(size, start_pos, params)
|
||||||
local result = {}
|
local result = {}
|
||||||
|
|
||||||
print("size x", size.x, "z", size.z, "start_pos x", start_pos.x, "z", start_pos.z)
|
|
||||||
|
|
||||||
for i, layer in ipairs(params) do
|
for i, layer in ipairs(params) do
|
||||||
local generator
|
local generator
|
||||||
if layer.algorithm == "perlin" then
|
if layer.algorithm == "perlin" then
|
||||||
@ -33,7 +31,6 @@ function worldeditadditions.noise.make_2d(size, start_pos, params)
|
|||||||
local noise_y = (y + 100000+start_pos.z+layer.offset.z) * layer.scale.z
|
local noise_y = (y + 100000+start_pos.z+layer.offset.z) * layer.scale.z
|
||||||
local noise_value = generator:noise(noise_x, noise_y, 0)
|
local noise_value = generator:noise(noise_x, noise_y, 0)
|
||||||
|
|
||||||
-- print("DEBUG NOISE x", noise_x, "y", noise_y, "value", noise_value)
|
|
||||||
if type(result[i]) ~= "number" then result[i] = 0 end
|
if type(result[i]) ~= "number" then result[i] = 0 end
|
||||||
result[i] = result[i] + (noise_value ^ layer.exponent) * layer.multiply + layer.add
|
result[i] = result[i] + (noise_value ^ layer.exponent) * layer.multiply + layer.add
|
||||||
end
|
end
|
||||||
|
@ -17,9 +17,9 @@ function worldeditadditions.noise.run2d(pos1, pos2, noise_params)
|
|||||||
-- pos2 will always have the highest co-ordinates now
|
-- pos2 will always have the highest co-ordinates now
|
||||||
|
|
||||||
-- Fill in the default params
|
-- Fill in the default params
|
||||||
print("DEBUG noise_params_custom ", wea.format.map(noise_params))
|
-- print("DEBUG noise_params_custom ", wea.format.map(noise_params))
|
||||||
noise_params = worldeditadditions.noise.params_apply_default(noise_params)
|
noise_params = worldeditadditions.noise.params_apply_default(noise_params)
|
||||||
print("DEBUG noise_params[1] ", wea.format.map(noise_params[1]))
|
-- print("DEBUG noise_params[1] ", wea.format.map(noise_params[1]))
|
||||||
|
|
||||||
-- Fetch the nodes in the specified area
|
-- Fetch the nodes in the specified area
|
||||||
local manip, area = worldedit.manip_helpers.init(pos1, pos2)
|
local manip, area = worldedit.manip_helpers.init(pos1, pos2)
|
||||||
@ -46,7 +46,6 @@ function worldeditadditions.noise.run2d(pos1, pos2, noise_params)
|
|||||||
pos1, pos2,
|
pos1, pos2,
|
||||||
noise_params[1].apply
|
noise_params[1].apply
|
||||||
)
|
)
|
||||||
print("RETURNED apply_2d success", success, "message", message)
|
|
||||||
if not success then return success, message end
|
if not success then return success, message end
|
||||||
|
|
||||||
|
|
||||||
|
@ -25,7 +25,6 @@ function worldeditadditions.scale_down(pos1, pos2, scale, anchor)
|
|||||||
z = math.floor(1 / scale.z)
|
z = math.floor(1 / scale.z)
|
||||||
}
|
}
|
||||||
local size = vector.subtract(pos2, pos1)
|
local size = vector.subtract(pos2, pos1)
|
||||||
print("[DEBUG] scale_down", worldeditadditions.vector.tostring(scale_down), "size", size)
|
|
||||||
|
|
||||||
if size.x < scale_down.x or size.y < scale_down.y or size.z < scale.z then
|
if size.x < scale_down.x or size.y < scale_down.y or size.z < scale.z then
|
||||||
return false, "Error: Area isn't big enough to apply scale down by "..worldeditadditions.vector.tostring(scale).."."
|
return false, "Error: Area isn't big enough to apply scale down by "..worldeditadditions.vector.tostring(scale).."."
|
||||||
|
@ -13,7 +13,6 @@ function worldeditadditions.parse.map(params_text, keywords)
|
|||||||
local last_key = nil
|
local last_key = nil
|
||||||
local mode = "KEY"
|
local mode = "KEY"
|
||||||
for i, part in ipairs(parts) do
|
for i, part in ipairs(parts) do
|
||||||
print("PARSE_MAP | i", i, "MODE", mode, "PART", part)
|
|
||||||
if mode == "VALUE" then
|
if mode == "VALUE" then
|
||||||
-- Try converting to a number to see if it works
|
-- Try converting to a number to see if it works
|
||||||
local part_converted = tonumber(part)
|
local part_converted = tonumber(part)
|
||||||
@ -27,7 +26,6 @@ function worldeditadditions.parse.map(params_text, keywords)
|
|||||||
last_key = part
|
last_key = part
|
||||||
-- Keyword support
|
-- Keyword support
|
||||||
if wea.table.contains(keywords, last_key) then
|
if wea.table.contains(keywords, last_key) then
|
||||||
print("IS KEYWORD")
|
|
||||||
result[last_key] = true
|
result[last_key] = true
|
||||||
else
|
else
|
||||||
mode = "VALUE"
|
mode = "VALUE"
|
||||||
|
@ -28,7 +28,6 @@ minetest.register_chatcommand("/saplingaliases", {
|
|||||||
local results = worldeditadditions.registered_nodes_by_group("sapling")
|
local results = worldeditadditions.registered_nodes_by_group("sapling")
|
||||||
table.insert(msg, "Sapling-like nodes:\n")
|
table.insert(msg, "Sapling-like nodes:\n")
|
||||||
local str = table.concat(results, "\n")
|
local str = table.concat(results, "\n")
|
||||||
print(str)
|
|
||||||
table.insert(msg, str)
|
table.insert(msg, str)
|
||||||
else
|
else
|
||||||
table.insert(msg, "Unknown mode '")
|
table.insert(msg, "Unknown mode '")
|
||||||
|
@ -45,7 +45,7 @@ minetest.register_chatcommand("/multi", {
|
|||||||
if not success then return success, commands end
|
if not success then return success, commands end
|
||||||
|
|
||||||
for i, command in ipairs(commands) do
|
for i, command in ipairs(commands) do
|
||||||
print("[DEBUG] i", i, "command: '"..command.."'")
|
-- print("[DEBUG] i", i, "command: '"..command.."'")
|
||||||
local start_time = worldeditadditions.get_ms_time()
|
local start_time = worldeditadditions.get_ms_time()
|
||||||
|
|
||||||
local found, _, command_name, args = command:find("^([^%s]+)%s(.+)$")
|
local found, _, command_name, args = command:find("^([^%s]+)%s(.+)$")
|
||||||
@ -53,7 +53,7 @@ minetest.register_chatcommand("/multi", {
|
|||||||
-- Things start at 1, not 0 in Lua :-(
|
-- Things start at 1, not 0 in Lua :-(
|
||||||
command_name = worldeditadditions.trim(command_name):sub(2) -- Strip the leading /
|
command_name = worldeditadditions.trim(command_name):sub(2) -- Strip the leading /
|
||||||
if not args then args = "" end
|
if not args then args = "" end
|
||||||
print("command_name", command_name)
|
-- print("command_name", command_name)
|
||||||
|
|
||||||
worldedit.player_notify(name, "#"..i..": "..command)
|
worldedit.player_notify(name, "#"..i..": "..command)
|
||||||
|
|
||||||
|
@ -18,9 +18,6 @@ worldedit.register_command("noise2d", {
|
|||||||
})
|
})
|
||||||
if not success then return success, map end
|
if not success then return success, map end
|
||||||
|
|
||||||
print("DEBUG noise_params raw ", wea.format.map(map))
|
|
||||||
|
|
||||||
|
|
||||||
if map.scale then
|
if map.scale then
|
||||||
map.scale = tonumber(map.scale)
|
map.scale = tonumber(map.scale)
|
||||||
map.scale = wea.Vector3.new(map.scale, map.scale, map.scale)
|
map.scale = wea.Vector3.new(map.scale, map.scale, map.scale)
|
||||||
|
@ -102,7 +102,7 @@ worldedit.register_command("scale", {
|
|||||||
return volume * factor
|
return volume * factor
|
||||||
end,
|
end,
|
||||||
func = function(name, scale, anchor)
|
func = function(name, scale, anchor)
|
||||||
print("initial scale: "..worldeditadditions.vector.tostring(scale)..", anchor: "..worldeditadditions.vector.tostring(anchor))
|
-- print("initial scale: "..worldeditadditions.vector.tostring(scale)..", anchor: "..worldeditadditions.vector.tostring(anchor))
|
||||||
|
|
||||||
|
|
||||||
local start_time = worldeditadditions.get_ms_time()
|
local start_time = worldeditadditions.get_ms_time()
|
||||||
|
Loading…
Reference in New Issue
Block a user