mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-11-22 07:23:00 +00:00
Remove a whole bunch of stray debug print statements
This commit is contained in:
parent
0212950d87
commit
0b0595a1d3
11 changed files with 8 additions and 26 deletions
|
@ -66,7 +66,7 @@ function worldeditadditions.forest(pos1, pos2, density_multiplier, sapling_weigh
|
|||
end
|
||||
end
|
||||
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
|
||||
stats.failures = stats.failures + 1
|
||||
end
|
||||
|
|
|
@ -14,7 +14,6 @@ function worldeditadditions.line(pos1, pos2, thickness, node_name)
|
|||
pos2 = vector.new(pos2)
|
||||
|
||||
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
|
||||
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))
|
||||
|
||||
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
|
||||
counts.replaced = counts.replaced + 1
|
||||
end
|
||||
|
|
|
@ -16,14 +16,12 @@ function worldeditadditions.noise.apply_2d(heightmap, noise, heightmap_size, pos
|
|||
|
||||
local region_height = pos2.y - pos1.y
|
||||
|
||||
print("NOISE\n")
|
||||
worldeditadditions.format.array_2d(noise, heightmap_size.x)
|
||||
-- print("NOISE\n")
|
||||
-- worldeditadditions.format.array_2d(noise, heightmap_size.x)
|
||||
|
||||
|
||||
local height = tonumber(apply_mode)
|
||||
|
||||
print("HEIGHT", height)
|
||||
|
||||
for z = heightmap_size.z - 1, 0, -1 do
|
||||
for x = heightmap_size.x - 1, 0, -1 do
|
||||
local i = (z * heightmap_size.x) + x
|
||||
|
@ -35,15 +33,12 @@ function worldeditadditions.noise.apply_2d(heightmap, noise, heightmap_size, pos
|
|||
elseif height then
|
||||
-- Rescale from 0 - 1 to -1 - +1
|
||||
local rescaled = (noise[i] * 2) - 1
|
||||
-- print("DEBUG x", x, "z", z, "rescaled 1", rescaled)
|
||||
-- Rescale to match the height specified
|
||||
rescaled = rescaled * height
|
||||
-- print("DEBUG x", x, "z", z, "rescaled 2", rescaled)
|
||||
rescaled = math.floor(wea.clamp(
|
||||
heightmap[i] + rescaled,
|
||||
0, region_height
|
||||
))
|
||||
-- print("DEBUG x", x, "z", z, "before", heightmap[i], "after", rescaled)
|
||||
heightmap[i] = rescaled
|
||||
else
|
||||
return false, "Error: Unknown apply mode '"..apply_mode.."'"
|
||||
|
|
|
@ -13,8 +13,6 @@ local wea = worldeditadditions
|
|||
function worldeditadditions.noise.make_2d(size, start_pos, params)
|
||||
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
|
||||
local generator
|
||||
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_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
|
||||
result[i] = result[i] + (noise_value ^ layer.exponent) * layer.multiply + layer.add
|
||||
end
|
||||
|
|
|
@ -17,9 +17,9 @@ function worldeditadditions.noise.run2d(pos1, pos2, noise_params)
|
|||
-- pos2 will always have the highest co-ordinates now
|
||||
|
||||
-- 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)
|
||||
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
|
||||
local manip, area = worldedit.manip_helpers.init(pos1, pos2)
|
||||
|
@ -46,7 +46,6 @@ function worldeditadditions.noise.run2d(pos1, pos2, noise_params)
|
|||
pos1, pos2,
|
||||
noise_params[1].apply
|
||||
)
|
||||
print("RETURNED apply_2d success", success, "message", message)
|
||||
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)
|
||||
}
|
||||
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
|
||||
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 mode = "KEY"
|
||||
for i, part in ipairs(parts) do
|
||||
print("PARSE_MAP | i", i, "MODE", mode, "PART", part)
|
||||
if mode == "VALUE" then
|
||||
-- Try converting to a number to see if it works
|
||||
local part_converted = tonumber(part)
|
||||
|
@ -27,7 +26,6 @@ function worldeditadditions.parse.map(params_text, keywords)
|
|||
last_key = part
|
||||
-- Keyword support
|
||||
if wea.table.contains(keywords, last_key) then
|
||||
print("IS KEYWORD")
|
||||
result[last_key] = true
|
||||
else
|
||||
mode = "VALUE"
|
||||
|
|
|
@ -28,7 +28,6 @@ minetest.register_chatcommand("/saplingaliases", {
|
|||
local results = worldeditadditions.registered_nodes_by_group("sapling")
|
||||
table.insert(msg, "Sapling-like nodes:\n")
|
||||
local str = table.concat(results, "\n")
|
||||
print(str)
|
||||
table.insert(msg, str)
|
||||
else
|
||||
table.insert(msg, "Unknown mode '")
|
||||
|
|
|
@ -45,7 +45,7 @@ minetest.register_chatcommand("/multi", {
|
|||
if not success then return success, commands end
|
||||
|
||||
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 found, _, command_name, args = command:find("^([^%s]+)%s(.+)$")
|
||||
|
@ -53,7 +53,7 @@ minetest.register_chatcommand("/multi", {
|
|||
-- Things start at 1, not 0 in Lua :-(
|
||||
command_name = worldeditadditions.trim(command_name):sub(2) -- Strip the leading /
|
||||
if not args then args = "" end
|
||||
print("command_name", command_name)
|
||||
-- print("command_name", command_name)
|
||||
|
||||
worldedit.player_notify(name, "#"..i..": "..command)
|
||||
|
||||
|
|
|
@ -18,9 +18,6 @@ worldedit.register_command("noise2d", {
|
|||
})
|
||||
if not success then return success, map end
|
||||
|
||||
print("DEBUG noise_params raw ", wea.format.map(map))
|
||||
|
||||
|
||||
if map.scale then
|
||||
map.scale = tonumber(map.scale)
|
||||
map.scale = wea.Vector3.new(map.scale, map.scale, map.scale)
|
||||
|
|
|
@ -102,7 +102,7 @@ worldedit.register_command("scale", {
|
|||
return volume * factor
|
||||
end,
|
||||
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()
|
||||
|
|
Loading…
Reference in a new issue