mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-08-20 05:24:20 +02:00
bonemeal: tidy up split_shell call
This commit is contained in:
parent
f1a433b5e3
commit
75ffa81b7e
@ -1,4 +1,5 @@
|
||||
local we_c = worldeditadditions_commands
|
||||
local wea = worldeditadditions
|
||||
|
||||
-- ██████ ██████ ███ ██ ███████ ███ ███ ███████ █████ ██
|
||||
-- ██ ██ ██ ██ ████ ██ ██ ████ ████ ██ ██ ██ ██
|
||||
@ -15,14 +16,14 @@ worldedit.register_command("bonemeal", {
|
||||
params_text = "1"
|
||||
end
|
||||
|
||||
local parts = worldeditadditions.split_shell(params_text, "%s+", false)
|
||||
local parts = wea.split_shell(params_text)
|
||||
|
||||
local strength = 1
|
||||
local chance = 1
|
||||
local node_names = {} -- An empty table means all nodes
|
||||
|
||||
if #parts >= 1 then
|
||||
strength = tonumber(table.remove(parts, 1))
|
||||
strength = tonumber(wea.trim(table.remove(parts, 1)))
|
||||
if not strength then
|
||||
return false, "Invalid strength value (value must be an integer)"
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user