ConfigManager.java 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * Roughly Enough Items by Danielshe.
  3. * Licensed under the MIT License.
  4. */
  5. package me.shedaniel.rei.api;
  6. import me.shedaniel.rei.client.ConfigObject;
  7. import net.minecraft.client.gui.screen.Screen;
  8. import java.io.IOException;
  9. public interface ConfigManager {
  10. /**
  11. * Saves the config.
  12. *
  13. * @throws IOException when error
  14. */
  15. void saveConfig() throws IOException;
  16. /**
  17. * Loads the config from the json file, creates the file if not found.
  18. *
  19. * @throws IOException when error
  20. */
  21. void loadConfig() throws IOException;
  22. /**
  23. * Gets the config instance
  24. *
  25. * @return the config instance
  26. */
  27. ConfigObject getConfig();
  28. /**
  29. * Gets if craftable only filter is enabled
  30. *
  31. * @return whether craftable only filter is enabled
  32. */
  33. boolean isCraftableOnlyEnabled();
  34. /**
  35. * Toggles the craftable only filter
  36. */
  37. void toggleCraftableOnly();
  38. /**
  39. * Opens the config screen
  40. *
  41. * @param parent the screen shown before
  42. */
  43. void openConfigScreen(Screen parent);
  44. /**
  45. * Gets the config screen
  46. *
  47. * @param parent the screen shown before
  48. * @return the config screen
  49. */
  50. Screen getConfigScreen(Screen parent);
  51. }