@@ -568,6 +568,7 @@ pub(super) fn register_commands(registry: &mut CommandRegistry) {
568568 ) -> CommandResult < ( ) > {
569569 let flags = ctx. args ( ) . get_flags ( "flags" ) ?;
570570 let ignore_air = flags. contains ( "ignore-air" ) ;
571+ let shift_selection = flags. contains ( "shift-selection" ) ;
571572
572573 let ( first_pos, second_pos) = ctx. get_selection ( ) ?;
573574 let start_time = Instant :: now ( ) ;
@@ -594,13 +595,26 @@ pub(super) fn register_commands(registry: &mut CommandRegistry) {
594595 paste_clipboard ( ctx. world_mut ( ) , & clipboard, paste_pos, ignore_air) ;
595596 }
596597
598+ if shift_selection {
599+ let offset_amount = direction. offset_pos ( BlockPos :: zero ( ) , count * stack_offset) ;
600+ let player = ctx. player_mut ( ) ?;
601+ player. worldedit_set_first_pos ( first_pos + offset_amount) ;
602+ player. worldedit_set_second_pos ( second_pos + offset_amount) ;
603+ }
604+
597605 ctx. worldedit_message ( & format ! (
598606 "Your selection was stacked. ({:?})" ,
599607 start_time. elapsed( )
600608 ) )
601609 }
602610
603- let stack_flag_arg = ArgumentType :: flags ( ) . add ( 'a' , "ignore-air" , "Stack without air blocks" ) ;
611+ let stack_flag_arg = ArgumentType :: flags ( )
612+ . add ( 'a' , "ignore-air" , "Stack without air blocks" )
613+ . add (
614+ 's' ,
615+ "shift-selection" ,
616+ "Shift the selection to the last stacked copy" ,
617+ ) ;
604618
605619 registry. register (
606620 CommandNode :: literal ( "/stack" )
0 commit comments