ConfigManager.java 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * Copyright (c) 2018, 2019, 2020 shedaniel
  3. * Licensed under the MIT License (the "License").
  4. */
  5. package me.shedaniel.rei.api;
  6. import me.shedaniel.rei.RoughlyEnoughItemsCore;
  7. import net.minecraft.client.MinecraftClient;
  8. import net.minecraft.client.gui.screen.Screen;
  9. import java.util.List;
  10. public interface ConfigManager {
  11. static ConfigManager getInstance() {
  12. return RoughlyEnoughItemsCore.getConfigManager();
  13. }
  14. @Deprecated
  15. List<EntryStack> getFavorites();
  16. /**
  17. * Saves the config.
  18. */
  19. void saveConfig();
  20. /**
  21. * Gets if craftable only filter is enabled
  22. *
  23. * @return whether craftable only filter is enabled
  24. */
  25. boolean isCraftableOnlyEnabled();
  26. /**
  27. * Toggles the craftable only filter
  28. */
  29. void toggleCraftableOnly();
  30. /**
  31. * Opens the config screen
  32. *
  33. * @param parent the screen shown before
  34. */
  35. default void openConfigScreen(Screen parent) {
  36. MinecraftClient.getInstance().openScreen(getConfigScreen(parent));
  37. }
  38. /**
  39. * Gets the config screen
  40. *
  41. * @param parent the screen shown before
  42. * @return the config screen
  43. */
  44. Screen getConfigScreen(Screen parent);
  45. }