ICommandManager.java 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. package me.kcm.command;
  2. import net.minecraft.command.ICommand;
  3. import net.minecraft.command.ICommandSender;
  4. public interface ICommandManager
  5. {
  6. /** Called to check, if a command sender should be allowed to use a normal command
  7. *
  8. * @param cs the sender of the command
  9. * @param perm the name of the permission, for commands this is their name
  10. * @return true to allow the command, false to call {@link ICommandManager#printMissingPermission(ICommandSender, ICommand)}
  11. */
  12. public boolean hasPermission(ICommandSender cs, String perm);
  13. /** This method is called, if there is no vanilla command available for the
  14. * given name
  15. *
  16. * @param cs the sender of the command
  17. * @param command the command
  18. * @param args arguments of the command, splitted at spaces
  19. * @return true on success, false to call {@link ICommandManager#printMissingCommand(ICommandSender, String)}
  20. */
  21. public boolean executeCustomCommand(ICommandSender cs, String command, String[] args);
  22. /** Called, if there is no normal or custom command available
  23. *
  24. * @param cs the sender of the command
  25. * @param command the command
  26. */
  27. public void printMissingCommand(ICommandSender cs, String command);
  28. /** Called if there is a normal command available but {@link ICommandManager#hasPermission(ICommandSender, String)}
  29. * returned false
  30. *
  31. * @param cs the sender of the command
  32. * @param command the command
  33. */
  34. public void printMissingPermission(ICommandSender cs, ICommand command);
  35. /** Called if a command is registered from a registered domain.
  36. *
  37. * @param command the command
  38. * @param domain a registered command domain
  39. */
  40. public void onRegisterCommand(ICommand command, String domain);
  41. }