* @return <code>true</code> if was handled.
*/
public boolean execute(final String[] params, final String remainder) {
final RPAction summon = new RPAction();
final NameBuilder nameBuilder = new NameBuilder();
Integer x = null;
Integer y = null;
for (int i = 0; i < params.length; ++i) {
final String str = params[i];
if (str != null) {
if (str.matches("[0-9].*")) {
try {
final Integer num = new Integer(str);
if (x == null) {
x = num;
} else if (y == null) {
y = num;
} else {
nameBuilder.append(str);
}
} catch (final NumberFormatException e) {
ClientSingletonRepository.getUserInterface().addEventLine(new StandardEventLine("Invalid number: " + str));
return true;
}
} else {
nameBuilder.append(str);
}
}
}
summon.put("type", "summon");
summon.put("creature", nameBuilder.toString());
if (x != null) {
if (y != null) {
summon.put("x", x);
summon.put("y", y);