Buggy code:
public class ShapedFireworkCommand { @ Command ( aliases = { "shapedfirework" , "shapedfireworks" } , desc = "Make<seq2seq4repair_space>a<seq2seq4repair_space>shaped<seq2seq4repair_space>firework" ) public static void shapedfirework ( final CommandContext args , CommandSender sender ) throws Exception { Player player = ( ( Player ) ( sender ) ) ; List < String > commands = new ArrayList < > ( ) ; List < Block > doneBlocks = new ArrayList < > ( ) ; Selection s = ShapedFireworks . getWorldEdit ( ) . getSelection ( ( ( Player ) ( sender ) ) ) ; try { for ( BlockVector blockVector : s . getRegionSelector ( ) . getRegion ( ) ) { Block block = player . getWorld ( ) . getBlockAt ( blockVector . getBlockX ( ) , blockVector . getBlockY ( ) , blockVector . getBlockZ ( ) ) ; if ( block . getType ( ) . equals ( WOOL ) ) { Wool wool = new Wool ( block . getType ( ) , block . getData ( ) ) ; DyeColor dyeColor = wool . getColor ( ) ; FireworkWoolColor fireworkColor = FireworkWoolColor . getFireworkColor ( dyeColor ) ; commands . add ( ( ( ( ( ( ( ( ( ( ( "//summon<seq2seq4repair_space>FireworksRocketEntity<seq2seq4repair_space>" + ( block . getX ( ) ) ) + "<seq2seq4repair_space>" ) + ( block . getY ( ) ) ) + "<seq2seq4repair_space>" ) + ( block . getZ ( ) ) ) + "<seq2seq4repair_space>{LifeTime:0,FireworksItem:{id:401,Count:1,tag:{Fireworks:{Explosions:[{Type:0,Flicker:0,Trail:0,Colors:[" ) + ( fireworkColor . fireworkColor ) ) + "],FadeColors:[" ) + ( fireworkColor . fireworkColor ) ) + "]}]}}}}" ) ) ; List < Block > barrierBlocks = new ArrayList < > ( ) ; barrierBlocks . add ( player . getWorld ( ) . getBlockAt ( block . getX ( ) , ( ( block . getY ( ) ) + 1 ) , block . getZ ( ) ) ) ; barrierBlocks . add ( player . getWorld ( ) . getBlockAt ( block . getX ( ) , ( ( block . getY ( ) ) - 1 ) , block . getZ ( ) ) ) ; barrierBlocks . add ( player . getWorld ( ) . getBlockAt ( block . getX ( ) , block . getY ( ) , ( ( block . getZ ( ) ) - 1 ) ) ) ; barrierBlocks . add ( player . getWorld ( ) . getBlockAt ( ( ( block . getX ( ) ) + 1 ) , block . getY ( ) , block . getZ ( ) ) ) ; barrierBlocks . add ( player . getWorld ( ) . getBlockAt ( block . getX ( ) , block . getY ( ) , ( ( block . getZ ( ) ) + 1 ) ) ) ; barrierBlocks . add ( player . getWorld ( ) . getBlockAt ( ( ( block . getX ( ) ) - 1 ) , block . getY ( ) , block . getZ ( ) ) ) ; for ( Block barrierBlock : barrierBlocks ) { boolean intercepts = false ; for ( Block doneBlock : doneBlocks ) { if ( barrierBlock . getLocation ( ) . equals ( doneBlock . getLocation ( ) ) ) { intercepts = true ; break ; } } if ( ( barrierBlock . getType ( ) . equals ( AIR ) ) && ( ! intercepts ) ) { barrierBlock . setType ( BARRIER ) ; } } block . setType ( AIR ) ; doneBlocks . add ( block ) ; } } } catch ( NullPointerException e ) { sender . sendMessage ( ( ( ChatColor . RED ) + "Your<seq2seq4repair_space>WorldEdit<seq2seq4repair_space>selection<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>empty." ) ) ; } try { int x = player . getLocation ( ) . getBlockX ( ) ; int y = ( player . getLocation ( ) . getBlockY ( ) ) + 1 ; int z = player . getLocation ( ) . getBlockZ ( ) ; for ( String string : commands ) { Block block = player . getWorld ( ) . getBlockAt ( x , y , z ) ; block . setType ( COMMAND ) ; Block redstone = player . getWorld ( ) . getBlockAt ( x , ( y + 1 ) , z ) ; <START_BUG> redstone . setType ( REDSTONE ) ; <END_BUG> CommandBlock commandBlock = ( ( CommandBlock ) ( block . getState ( ) ) ) ; commandBlock . setCommand ( string ) ; commandBlock . update ( ) ; x = x + 1 ; if ( x >= ( ( player . getLocation ( ) . getBlockX ( ) ) + 11 ) ) { x = player . getLocation ( ) . getBlockX ( ) ; z = z + 1 ; } } } catch ( Exception ignored ) { } } }

Fix:
redstone . setType ( REDSTONE_WIRE ) ;