Source:
public boolean call(CommandSource source, String arguments, List<String> parents) throws CommandException { CommandHandler handler = (CommandHandler) MinecraftServer.getServer().getCommandManager(); final ICommandSender mcSender = source instanceof ICommandSender ? (ICommandSender) source : new MCSenderWrapper(source); final String[] args = arguments.split(" "); int i = handler.getUsernameIndex(this.command, args); int j = 0; if (testPermission(source)) { net.minecraftforge.event.CommandEvent event = new net.minecraftforge.event.CommandEvent(this.command, mcSender, args); if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) { if (event.exception != null) { com.google.common.base.Throwables.propagateIfPossible(event.exception); } return false; } if (i > -1) { @SuppressWarnings("unchecked") List<Entity> list = PlayerSelector.matchEntities(mcSender, args[i], Entity.class); String s2 = args[i]; mcSender.setCommandStat(CommandResultStats.Type.AFFECTED_ENTITIES, list.size()); for (Entity entity : list) { args[i] = entity.getUniqueID().toString(); if (handler.tryExecute(mcSender, args, this.command, arguments)) { ++j; } } args[i] = s2; } else { mcSender.setCommandStat(CommandResultStats.Type.AFFECTED_ENTITIES, 1); if (handler.tryExecute(mcSender, args, this.command, arguments)) { ++j; } } } else { source.sendMessage(Texts .builder(SpongeMod.instance.getGame().getRegistry().getTranslationById(TRANSLATION_NO_PERMISSION).get(), new Object[0]) .color(TextColors.RED) .build()); } mcSender.setCommandStat(CommandResultStats.Type.SUCCESS_COUNT, j); return j > 0; }

Target:
public boolean call(CommandSource source, String arguments, List<String> parents) throws CommandException { CommandHandler handler = (CommandHandler) MinecraftServer.getServer().getCommandManager(); final ICommandSender mcSender = source instanceof ICommandSender ? (ICommandSender) source : new WrapperICommandSender(source); final String[] args = arguments.split(" "); int usernameIndex = handler.getUsernameIndex(this.command, args); int successCount = 0; if (testPermission(source)) { net.minecraftforge.event.CommandEvent event = new net.minecraftforge.event.CommandEvent(this.command, mcSender, args); if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) { if (event.exception != null) { com.google.common.base.Throwables.propagateIfPossible(event.exception); } return false; } if (usernameIndex > -1) { @SuppressWarnings("unchecked") List<Entity> list = PlayerSelector.matchEntities(mcSender, args[usernameIndex], Entity.class); String previousNameVal = args[usernameIndex]; mcSender.setCommandStat(CommandResultStats.Type.AFFECTED_ENTITIES, list.size()); for (Entity entity : list) { args[usernameIndex] = entity.getUniqueID().toString(); if (handler.tryExecute(mcSender, args, this.command, arguments)) { ++successCount; } } args[usernameIndex] = previousNameVal; } else { mcSender.setCommandStat(CommandResultStats.Type.AFFECTED_ENTITIES, 1); if (handler.tryExecute(mcSender, args, this.command, arguments)) { ++successCount; } } } else { source.sendMessage(Texts .builder(SpongeMod.instance.getGame().getRegistry().getTranslationById(TRANSLATION_NO_PERMISSION).get(), new Object[0]) .color(TextColors.RED) .build()); } mcSender.setCommandStat(CommandResultStats.Type.SUCCESS_COUNT, successCount); return successCount > 0; }