Use generics on manager to understand impl types

Slight risk of API breakage but risk is minimal enough that I'm not bumping versions.

0.5.0 Migration guide suggested (Platform)CommandManager, which will set the generics for you.
Only if you stored the ref as the Abstract CommandManager would you now run into generic issues.

Also, cleaned up the sendMessage API's to not need Object now since we know the Generic type.

This is technically an API break, but considering Locales was only released last night and
the likelyhood someone overrode that method, is unlikey.

If you did, just fix the method signature! Sorry <3
This commit is contained in:
Aikar
2017-07-18 21:43:32 -04:00
parent 495e33e47e
commit 418bbd6fd9
6 changed files with 13 additions and 26 deletions
@@ -40,7 +40,7 @@ import java.util.List;
import java.util.Map;
@SuppressWarnings("WeakerAccess")
public class SpongeCommandManager extends CommandManager {
public class SpongeCommandManager extends CommandManager<CommandSource, SpongeMessageFormatter> {
protected final PluginContainer plugin;
protected Map<String, SpongeRootCommand> registeredCommands = new HashMap<>();