bonemeal: tidy up split_shell call

This commit is contained in:
Starbeamrainbowlabs 2021-12-28 01:46:12 +00:00
parent f1a433b5e3
commit 75ffa81b7e
No known key found for this signature in database
GPG Key ID: 1BE5172E637709C2

@ -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