docs: @Override
      public void prepare(MissionInit missionInit) {
          super.prepare(missionInit);
          // We need to see chat commands as they come in.
          // Following the example of RewardForSendingCommandImplementation.
          MissionBehaviour mb = parentBehaviour();
          ICommandHandler oldch = mb.commandHandler;
          CommandGroup newch = new CommandGroup() {
              protected boolean onExecute(String verb, String parameter, MissionInit missionInit) {
                  // See if this command gets handled by the legitimate handlers:
                  boolean handled = super.onExecute(verb, parameter, missionInit);
                  if (handled && verb.equalsIgnoreCase(ChatCommand.CHAT.value())) // Yes, so check if we need to produce a reward
                  {
                      Iterator<Map.Entry<Pattern, Float>> patternIt = patternMap.entrySet().iterator();
                      while (patternIt.hasNext()) {
                          Map.Entry<Pattern, Float> entry = patternIt.next();
                          Matcher m = entry.getKey().matcher(parameter);
                          if (m.matches()) {
                              String distribution = distributionMap.get(entry.getKey());
                              addAndShareCachedReward(RewardForSendingMatchingChatMessageImplementation.this.params.getDimension(), entry.getValue(), distribution);
                          }
                      }
                  }
                  return handled;
              }
          };
  
          newch.setOverriding((oldch != null) ? oldch.isOverriding() : true);
          if (oldch != null)
              newch.addCommandHandler(oldch);
          mb.commandHandler = newch;
      }