diff options
author | Vanessa Dannenberg <vanessa.e.dannenberg@gmail.com> | 2018-11-08 19:27:31 -0500 |
---|---|---|
committer | Vanessa Dannenberg <vanessa.e.dannenberg@gmail.com> | 2018-11-08 19:27:31 -0500 |
commit | d41791b735df980912250d4dca7b3e140eecbf28 (patch) | |
tree | 0d67460542587457fc76e0bae76830d8c6409025 /worldedit_commands | |
parent | 680f259468f9a47c0bc8ea5890ea37c5758a8c30 (diff) | |
download | dreambuilder_modpack-d41791b735df980912250d4dca7b3e140eecbf28.tar dreambuilder_modpack-d41791b735df980912250d4dca7b3e140eecbf28.tar.gz dreambuilder_modpack-d41791b735df980912250d4dca7b3e140eecbf28.tar.bz2 dreambuilder_modpack-d41791b735df980912250d4dca7b3e140eecbf28.tar.xz dreambuilder_modpack-d41791b735df980912250d4dca7b3e140eecbf28.zip |
update basic_materials, biome_lib, plantlife modpack,
coloredwood, homedecor, technic, currency, framedglass,
gloopblocks, led_marquee, mesecons, moretrees, nixie_tubes,
pipeworks, plasticbox, prefab_redo, castles, signs_lib,
roads, worldedit
Added license declaration for the modpack itself
Diffstat (limited to 'worldedit_commands')
-rw-r--r-- | worldedit_commands/init.lua | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/worldedit_commands/init.lua b/worldedit_commands/init.lua index 3640e0d..131c49b 100644 --- a/worldedit_commands/init.lua +++ b/worldedit_commands/init.lua @@ -425,15 +425,22 @@ minetest.register_chatcommand("/param2", { })
minetest.register_chatcommand("/mix", {
- params = "<node1> ...",
+ params = "<node1> [<weighting1>] [<node2> [<weighting2>]] ...",
description = "Fill the current WorldEdit region with a random mix of <node1>, ...",
privs = {worldedit=true},
func = safe_region(function(name, param)
local nodes = {}
for nodename in param:gmatch("[^%s]+") do
- local node = get_node(name, nodename)
- if not node then return end
- nodes[#nodes + 1] = node
+ if tonumber(nodename) ~= nil and #nodes > 0 then
+ local last_node = nodes[#nodes]
+ for i = 1, tonumber(nodename) do
+ nodes[#nodes + 1] = last_node
+ end
+ else
+ local node = get_node(name, nodename)
+ if not node then return end
+ nodes[#nodes + 1] = node
+ end
end
local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name]
|