Skip to content

Commit

Permalink
added up command
Browse files Browse the repository at this point in the history
  • Loading branch information
Firigion authored and Ghoulboy78 committed Feb 14, 2021
1 parent 76e6e23 commit 483a5bb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/Documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ Left clicking again will reselect the whole box.
- `/world-edit walls <block> [sides] [replacement]` -> Creates walls on the sides specified around the selection, defalts to ony vertical walls (`xz`).
- `/world-edit outline <block> [replacement]` -> Outlines the selection with `<block>`.
- `/world-edit shape ...` -> Generates a shape centered arround the palyer. See brushes for all options and parameters.
- `/world-edit up <distance>` -> Teleports you up `<distance>` ammount of blocks. Places a block under you if there was nothing there, so you don't fall and can start building right away.

#### Brushes

Expand Down
9 changes: 9 additions & 0 deletions world-edit.sc
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ base_commands_map = [
['selection move', _() -> selection_move(1, null), false],
['selection move <amount>', _(n)->selection_move(n, null), false],
['selection move <amount> <direction>', 'selection_move',false],
['up <amount>', 'tp_up', [-1,'help_cmd_up', 'help_cmd_up_tooltip', null]],
['flood <block>', ['flood_fill', null, null], false],
['flood <block> <axis>', ['flood_fill', null], [1, 'help_cmd_flood', 'help_cmd_flood_tooltip', null]],
['flood <block> f <flag>', _(block,flags)->flood_fill(block,null,flags), false],
Expand Down Expand Up @@ -761,6 +762,8 @@ global_lang_keys = global_default_lang = {
'help_cmd_expand' -> 'l Expands sel [magn] from pos', //This is not understandable
'help_cmd_expand_tooltip' -> 'g Expands the selection [magnitude] from [pos]',
'help_cmd_move' -> 'l Moves selection to <pos>',
'help_cmd_up' -> 'l Teleport up specified ammount of block',
'help_cmd_up_tooltip' -> 'g Generate a glass block under you if there was nothing there',
'help_cmd_brush_clear' -> 'l Unregisters current item as brush',
'help_cmd_brush_list' -> 'l Lists all currently regiestered brushes and their actions',
'help_cmd_brush_info' -> 'l Gives detailed info of currently held brush',
Expand Down Expand Up @@ -1838,3 +1841,9 @@ paste(pos, flags)->(
);
add_to_history('action_paste',player)
);

tp_up(distance)-> (
p = player();
modify(p, 'pos', pp=(p~'pos'+ [0,distance,0]));
if(air(pp-[0,1,0]), set(pp-[0,1,0], 'glass'))
);

0 comments on commit 483a5bb

Please sign in to comment.