1- if minetest .raycast == nil then
2- error (
3- " worldedit_brush requires at least Minetest 5.0"
4- )
5- end
1+ local S = minetest .get_translator (" worldedit_brush" )
62
73local S = minetest .get_translator (" worldedit_brush" )
84
@@ -20,7 +16,8 @@ local brush_on_use = function(itemstack, placer)
2016 local cmd = meta :get_string (" command" )
2117 if cmd == " " then
2218 worldedit .player_notify (name ,
23- S (" This brush is not bound, use //brush to bind a command to it." ))
19+ S (" This brush is not bound, use @1 to bind a command to it." ,
20+ minetest .colorize (" #00ffff" , " //brush" )))
2421 return false
2522 end
2623
@@ -78,7 +75,7 @@ minetest.register_tool(":worldedit:brush", {
7875worldedit .register_command (" brush" , {
7976 privs = {worldedit = true },
8077 params = S (" none/<cmd> [parameters]" ),
81- description = S (" Assign command to WorldEdit brush item" ),
78+ description = S (" Assign command to WorldEdit brush item or clear assignment using 'none' " ),
8279 parse = function (param )
8380 local found , _ , cmd , params = param :find (" ^([^%s]+)%s+(.+)$" )
8481 if not found then
@@ -105,21 +102,22 @@ worldedit.register_command("brush", {
105102 else
106103 local cmddef = worldedit .registered_commands [cmd ]
107104 if cmddef == nil or cmddef .require_pos ~= 1 then
108- worldedit .player_notify (name , S (" @1 cannot be used with brushes" , minetest .colorize (" #00ffff" , " //" .. cmd )))
105+ worldedit .player_notify (name , S (" @1 cannot be used with brushes" ,
106+ minetest .colorize (" #00ffff" , " //" .. cmd )))
109107 return
110108 end
111109
112110 -- Try parsing command params so we can give the user feedback
113111 local ok , err = cmddef .parse (params )
114112 if not ok then
115- err = err or " invalid usage"
116- worldedit .player_notify (name , S (" Error with brush command: @1" , err ))
113+ err = err or S ( " invalid usage" )
114+ worldedit .player_notify (name , S (" Error with command: @1" , err ))
117115 return
118116 end
119117
120118 meta :set_string (" command" , cmd )
121119 meta :set_string (" params" , params )
122- local fullcmd = " //" .. cmd .. " " .. params
120+ local fullcmd = minetest . colorize ( " #00ffff " , " //" .. cmd ) .. " " .. params
123121 meta :set_string (" description" ,
124122 minetest .registered_tools [" worldedit:brush" ].description .. " : " .. fullcmd )
125123 worldedit .player_notify (name , S (" Brush assigned to command: @1" , fullcmd ))
0 commit comments