mirror of
				https://github.com/Uberi/Minetest-WorldEdit.git
				synced 2025-10-31 04:45:33 +01:00 
			
		
		
		
	Fix several typos
This commit is contained in:
		| @@ -1,3 +1,6 @@ | |||||||
|  | dofile(minetest.get_modpath("worldedit_commands") .. "/cuboidapi.lua") | ||||||
|  |  | ||||||
|  |  | ||||||
| minetest.register_chatcommand("/outset", { | minetest.register_chatcommand("/outset", { | ||||||
| 	params = "<amount> [h|v]", | 	params = "<amount> [h|v]", | ||||||
| 	description = "outset the selection", | 	description = "outset the selection", | ||||||
| @@ -18,15 +21,15 @@ minetest.register_chatcommand("/outset", { | |||||||
| 		end | 		end | ||||||
| 		 | 		 | ||||||
| 		if dir == "" then | 		if dir == "" then | ||||||
| 			assert(worldedit.cuboid_volumetricexpand(name, amount)) | 			assert(worldedit.cuboid_volumetric_expand(name, amount)) | ||||||
| 		elseif dir == "h" then | 		elseif dir == "h" then | ||||||
| 			assert(worldedit.cuboid_linealexpand(name, 'x', 1, amount)) | 			assert(worldedit.cuboid_linear_expand(name, 'x', 1, amount)) | ||||||
| 			assert(worldedit.cuboid_linealexpand(name, 'x', -1, amount)) | 			assert(worldedit.cuboid_linear_expand(name, 'x', -1, amount)) | ||||||
| 			assert(worldedit.cuboid_linealexpand(name, 'z', 1, amount)) | 			assert(worldedit.cuboid_linear_expand(name, 'z', 1, amount)) | ||||||
| 			assert(worldedit.cuboid_linealexpand(name, 'z', -1, amount)) | 			assert(worldedit.cuboid_linear_expand(name, 'z', -1, amount)) | ||||||
| 		elseif dir == "v" then | 		elseif dir == "v" then | ||||||
| 			assert(worldedit.cuboid_linealexpand(name, 'y', 1, amount)) | 			assert(worldedit.cuboid_linear_expand(name, 'y', 1, amount)) | ||||||
| 			assert(worldedit.cuboid_linealexpand(name, 'y', -1, amount)) | 			assert(worldedit.cuboid_linear_expand(name, 'y', -1, amount)) | ||||||
| 		else | 		else | ||||||
| 			return false, "Unknown error" | 			return false, "Unknown error" | ||||||
| 		end | 		end | ||||||
| @@ -37,6 +40,7 @@ minetest.register_chatcommand("/outset", { | |||||||
|   } |   } | ||||||
| ) | ) | ||||||
|  |  | ||||||
|  |  | ||||||
| minetest.register_chatcommand("/inset", { | minetest.register_chatcommand("/inset", { | ||||||
| 	params = "<amount> [h|v]", | 	params = "<amount> [h|v]", | ||||||
| 	description = "inset the selection", | 	description = "inset the selection", | ||||||
| @@ -57,15 +61,15 @@ minetest.register_chatcommand("/inset", { | |||||||
| 		end | 		end | ||||||
| 		 | 		 | ||||||
| 		if dir == "" then | 		if dir == "" then | ||||||
| 			assert(worldedit.cuboid_volumetricexpand(name, -amount)) | 			assert(worldedit.cuboid_volumetric_expand(name, -amount)) | ||||||
| 		elseif dir == "h" then | 		elseif dir == "h" then | ||||||
| 			assert(worldedit.cuboid_linealexpand(name, 'x', 1, -amount)) | 			assert(worldedit.cuboid_linear_expand(name, 'x', 1, -amount)) | ||||||
| 			assert(worldedit.cuboid_linealexpand(name, 'x', -1, -amount)) | 			assert(worldedit.cuboid_linear_expand(name, 'x', -1, -amount)) | ||||||
| 			assert(worldedit.cuboid_linealexpand(name, 'z', 1, -amount)) | 			assert(worldedit.cuboid_linear_expand(name, 'z', 1, -amount)) | ||||||
| 			assert(worldedit.cuboid_linealexpand(name, 'z', -1, -amount)) | 			assert(worldedit.cuboid_linear_expand(name, 'z', -1, -amount)) | ||||||
| 		elseif dir == "v" then | 		elseif dir == "v" then | ||||||
| 			assert(worldedit.cuboid_linealexpand(name, 'y', 1, -amount)) | 			assert(worldedit.cuboid_linear_expand(name, 'y', 1, -amount)) | ||||||
| 			assert(worldedit.cuboid_linealexpand(name, 'y', -1, -amount)) | 			assert(worldedit.cuboid_linear_expand(name, 'y', -1, -amount)) | ||||||
| 		else | 		else | ||||||
| 			return false, "Unknown error" | 			return false, "Unknown error" | ||||||
| 		end | 		end | ||||||
| @@ -93,7 +97,7 @@ minetest.register_chatcommand("/shift", { | |||||||
| 		 | 		 | ||||||
| 		if pos1 == nil or pos2 == nil then | 		if pos1 == nil or pos2 == nil then | ||||||
| 			worldedit.player_notify(name,  | 			worldedit.player_notify(name,  | ||||||
| 			"Undefined region. Region must be defined beforehand.") | 				"Undefined region. Region must be defined beforehand.") | ||||||
| 			return | 			return | ||||||
| 		end | 		end | ||||||
| 		 | 		 | ||||||
| @@ -102,17 +106,17 @@ minetest.register_chatcommand("/shift", { | |||||||
| 			axis, dir = worldedit.translate_direction(name, direction) | 			axis, dir = worldedit.translate_direction(name, direction) | ||||||
| 		else | 		else | ||||||
| 			axis, dir = worldedit.player_axis(name) | 			axis, dir = worldedit.player_axis(name) | ||||||
| 			worldedit.player_notify(name, "entered player_axis") |  | ||||||
| 		end | 		end | ||||||
| 		 | 		 | ||||||
| 		assert(worldedit.cuboid_shift(name, axis, amount * dir)) | 		assert(worldedit.cuboid_shift(name, axis, amount * dir)) | ||||||
| 		worldedit.marker_update(name) | 		worldedit.marker_update(name) | ||||||
| 		 | 		 | ||||||
| 		return true, "region shifted by " .. amount .. " blocks" | 		return true, "region shifted by " .. amount .. " nodes" | ||||||
|       end, |       end, | ||||||
|   } |   } | ||||||
| ) | ) | ||||||
|  |  | ||||||
|  |  | ||||||
| minetest.register_chatcommand("/expand", { | minetest.register_chatcommand("/expand", { | ||||||
| 	params = "<amount> [reverse-amount] [up|down|left|right|front|back]", | 	params = "<amount> [reverse-amount] [up|down|left|right|front|back]", | ||||||
| 	description = "expand the selection in one or two directions at once", | 	description = "expand the selection in one or two directions at once", | ||||||
| @@ -133,7 +137,7 @@ minetest.register_chatcommand("/expand", { | |||||||
| 	 | 	 | ||||||
| 	local tmp = tonumber(arg2) | 	local tmp = tonumber(arg2) | ||||||
| 	local axis, dir | 	local axis, dir | ||||||
| 	local reverseamount = 0 | 	local reverse_amount = 0 | ||||||
| 	 | 	 | ||||||
| 	axis,dir = worldedit.player_axis(name) | 	axis,dir = worldedit.player_axis(name) | ||||||
| 	 | 	 | ||||||
| @@ -141,7 +145,7 @@ minetest.register_chatcommand("/expand", { | |||||||
| 		if tmp == nil then | 		if tmp == nil then | ||||||
| 			axis, dir = worldedit.translate_direction(name, arg2) | 			axis, dir = worldedit.translate_direction(name, arg2) | ||||||
| 		else | 		else | ||||||
| 			reverseamount = tmp | 			reverse_amount = tmp | ||||||
| 		end | 		end | ||||||
| 	end | 	end | ||||||
| 	 | 	 | ||||||
| @@ -149,8 +153,8 @@ minetest.register_chatcommand("/expand", { | |||||||
| 		axis, dir = worldedit.translate_direction(name, arg3) | 		axis, dir = worldedit.translate_direction(name, arg3) | ||||||
| 	end | 	end | ||||||
| 	 | 	 | ||||||
| 	worldedit.cuboid_linealexpand(name, axis, dir, amount) | 	worldedit.cuboid_linear_expand(name, axis, dir, amount) | ||||||
| 	worldedit.cuboid_linealexpand(name, axis, -dir, reverseamount) | 	worldedit.cuboid_linear_expand(name, axis, -dir, reverse_amount) | ||||||
| 	worldedit.marker_update(name) | 	worldedit.marker_update(name) | ||||||
|       end, |       end, | ||||||
|   } |   } | ||||||
| @@ -177,7 +181,7 @@ minetest.register_chatcommand("/contract", { | |||||||
| 	 | 	 | ||||||
| 	local tmp = tonumber(arg2) | 	local tmp = tonumber(arg2) | ||||||
| 	local axis, dir | 	local axis, dir | ||||||
| 	local reverseamount = 0 | 	local reverse_amount = 0 | ||||||
| 	 | 	 | ||||||
| 	axis,dir = worldedit.player_axis(name) | 	axis,dir = worldedit.player_axis(name) | ||||||
| 	 | 	 | ||||||
| @@ -185,7 +189,7 @@ minetest.register_chatcommand("/contract", { | |||||||
| 		if tmp == nil then | 		if tmp == nil then | ||||||
| 			axis, dir = worldedit.translate_direction(name, arg2) | 			axis, dir = worldedit.translate_direction(name, arg2) | ||||||
| 		else | 		else | ||||||
| 			reverseamount = tmp | 			reverse_amount = tmp | ||||||
| 		end | 		end | ||||||
| 	end | 	end | ||||||
| 	 | 	 | ||||||
| @@ -193,13 +197,9 @@ minetest.register_chatcommand("/contract", { | |||||||
| 		axis, dir = worldedit.translate_direction(name, arg3) | 		axis, dir = worldedit.translate_direction(name, arg3) | ||||||
| 	end | 	end | ||||||
| 	 | 	 | ||||||
| 	worldedit.cuboid_linealexpand(name, axis, dir, -amount) | 	worldedit.cuboid_linear_expand(name, axis, dir, -amount) | ||||||
| 	worldedit.cuboid_linealexpand(name, axis, -dir, -reverseamount) | 	worldedit.cuboid_linear_expand(name, axis, -dir, -reverse_amount) | ||||||
| 	worldedit.marker_update(name) | 	worldedit.marker_update(name) | ||||||
|       end, |       end, | ||||||
|   } |   } | ||||||
| ) | ) | ||||||
|  |  | ||||||
|  |  | ||||||
| dofile(minetest.get_modpath("worldedit_commands") .. "/cuboidapi.lua") |  | ||||||
|  |  | ||||||
| @@ -1,5 +1,5 @@ | |||||||
| -- Expands or contracts the cuboid in all axes by amount (positive or negative) | -- Expands or contracts the cuboid in all axes by amount (positive or negative) | ||||||
| worldedit.cuboid_volumetricexpand = function(name, amount) | worldedit.cuboid_volumetric_expand = function(name, amount) | ||||||
| 	local pos1 = worldedit.pos1[name] | 	local pos1 = worldedit.pos1[name] | ||||||
| 	local pos2 = worldedit.pos2[name] | 	local pos2 = worldedit.pos2[name] | ||||||
| 	 | 	 | ||||||
| @@ -9,14 +9,14 @@ worldedit.cuboid_volumetricexpand = function(name, amount) | |||||||
| 	 | 	 | ||||||
| 	local delta1 = vector.new() | 	local delta1 = vector.new() | ||||||
| 	local delta2 = vector.new() | 	local delta2 = vector.new() | ||||||
| 	local deltadir1 | 	local delta_dir1 | ||||||
| 	local deltadir2 | 	local delta_dir2 | ||||||
| 	 | 	 | ||||||
| 	delta1 = vector.add(delta1, amount) | 	delta1 = vector.add(delta1, amount) | ||||||
| 	delta2 = vector.add(delta2, amount) | 	delta2 = vector.add(delta2, amount) | ||||||
| 	deltadir1, deltadir2 = worldedit.get_expansion_directions(pos1, pos2) | 	delta_dir1, delta_dir2 = worldedit.get_expansion_directions(pos1, pos2) | ||||||
| 	delta1 = vector.multiply(delta1, deltadir1) | 	delta1 = vector.multiply(delta1, delta_dir1) | ||||||
| 	delta2 = vector.multiply(delta2, deltadir2) | 	delta2 = vector.multiply(delta2, delta_dir2) | ||||||
| 	worldedit.pos1[name] = vector.add(pos1, delta1) | 	worldedit.pos1[name] = vector.add(pos1, delta1) | ||||||
| 	worldedit.pos2[name] = vector.add(pos2, delta2) | 	worldedit.pos2[name] = vector.add(pos2, delta2) | ||||||
| 	 | 	 | ||||||
| @@ -25,7 +25,7 @@ end | |||||||
|  |  | ||||||
|  |  | ||||||
| -- Expands or contracts the cuboid in a single axis by amount (positive or negative) | -- Expands or contracts the cuboid in a single axis by amount (positive or negative) | ||||||
| worldedit.cuboid_linealexpand = function(name, axis, direction, amount) | worldedit.cuboid_linear_expand = function(name, axis, direction, amount) | ||||||
| 	local pos1 = worldedit.pos1[name] | 	local pos1 = worldedit.pos1[name] | ||||||
| 	local pos2 = worldedit.pos2[name] | 	local pos2 = worldedit.pos2[name] | ||||||
| 	 | 	 | ||||||
|   | |||||||
| @@ -12,6 +12,7 @@ if minetest.place_schematic then | |||||||
| 	worldedit.prob_list = {} | 	worldedit.prob_list = {} | ||||||
| end | end | ||||||
|  |  | ||||||
|  | dofile(minetest.get_modpath("worldedit_commands") .. "/cuboid.lua") | ||||||
| dofile(minetest.get_modpath("worldedit_commands") .. "/mark.lua") | dofile(minetest.get_modpath("worldedit_commands") .. "/mark.lua") | ||||||
| dofile(minetest.get_modpath("worldedit_commands") .. "/safe.lua"); safe_region = safe_region or function(callback) return callback end | dofile(minetest.get_modpath("worldedit_commands") .. "/safe.lua"); safe_region = safe_region or function(callback) return callback end | ||||||
|  |  | ||||||
| @@ -1117,6 +1118,4 @@ minetest.register_chatcommand("/clearobjects", { | |||||||
| 		local count = worldedit.clearobjects(worldedit.pos1[name], worldedit.pos2[name]) | 		local count = worldedit.clearobjects(worldedit.pos1[name], worldedit.pos2[name]) | ||||||
| 		worldedit.player_notify(name, count .. " objects cleared") | 		worldedit.player_notify(name, count .. " objects cleared") | ||||||
| 	end), | 	end), | ||||||
| }) | }) | ||||||
|  |  | ||||||
| dofile(minetest.get_modpath("worldedit_commands") .. "/cuboid.lua") |  | ||||||
		Reference in New Issue
	
	Block a user