PluginDisabler.java 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * Roughly Enough Items by Danielshe.
  3. * Licensed under the MIT License.
  4. */
  5. package me.shedaniel.rei.api;
  6. import net.minecraft.util.Identifier;
  7. public interface PluginDisabler {
  8. /**
  9. * Disables multiple functions from a plugin
  10. *
  11. * @param plugin the identifier of the plugin
  12. * @param functions the array of functions to be disabled
  13. */
  14. default void disablePluginFunctions(Identifier plugin, PluginFunction... functions) {
  15. for(PluginFunction function : functions)
  16. disablePluginFunction(plugin, function);
  17. }
  18. /**
  19. * Enables multiple functions from a plugin
  20. *
  21. * @param plugin the identifier of the plugin
  22. * @param functions the array of functions to be enabled
  23. */
  24. default void enablePluginFunctions(Identifier plugin, PluginFunction... functions) {
  25. for(PluginFunction function : functions)
  26. enablePluginFunction(plugin, function);
  27. }
  28. /**
  29. * Disables a function from a plugin
  30. *
  31. * @param plugin the identifier of the plugin
  32. * @param function the function to be disabled
  33. */
  34. void disablePluginFunction(Identifier plugin, PluginFunction function);
  35. /**
  36. * Enables a function from a plugin
  37. *
  38. * @param plugin the identifier of the plugin
  39. * @param function the function to be enabled
  40. */
  41. void enablePluginFunction(Identifier plugin, PluginFunction function);
  42. /**
  43. * Checks if a plugin function has been disabled
  44. *
  45. * @param plugin the identifier of the plugin
  46. * @param function the function to check
  47. * @return whether if it has been disabled
  48. */
  49. boolean isFunctionEnabled(Identifier plugin, PluginFunction function);
  50. }