Allow mods to register duplicate command aliases
Closes
import org.spongepowered.api.plugin.PluginContainer;
import org.spongepowered.api.command.InvocationCommandException;
import org.spongepowered.api.text.Text;
+import org.spongepowered.common.SpongeImpl;
import org.spongepowered.common.command.MinecraftCommandWrapper;
/**
@@ -53,4 +54,10 @@ protected boolean throwEvent(ICommandSender sender, String[] args) throws Invoca
}
return super.throwEvent(sender, args);
}
+
+ @Override
+ public boolean suppressDuplicateAlias(String alias) {
+ SpongeImpl.getLogger().warn("The mod {} has registered multiple commands for the alias '{}'. This is probably indicative of a bug.", this.getOwner().getId(), alias);
+ return true;
+ }
}
