When registering events, validate the method parameters first.

Fixes BUKKIT-3779