TestRandomCategory.java 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. package me.shedaniel.plugin;
  2. import me.shedaniel.api.IDisplayCategory;
  3. import me.shedaniel.gui.widget.Control;
  4. import me.shedaniel.gui.widget.REISlot;
  5. import net.minecraft.item.ItemStack;
  6. import java.util.ArrayList;
  7. import java.util.LinkedList;
  8. import java.util.List;
  9. public class TestRandomCategory implements IDisplayCategory<RandomRecipe> {
  10. private String id;
  11. private List<RandomRecipe> recipes;
  12. private ItemStack item;
  13. public TestRandomCategory(String id, ItemStack item) {
  14. this.id = id;
  15. this.item = item;
  16. }
  17. @Override
  18. public String getId() {
  19. return id;
  20. }
  21. @Override
  22. public String getDisplayName() {
  23. return id;
  24. }
  25. @Override
  26. public void addRecipe(RandomRecipe recipe) {
  27. if (this.recipes == null)
  28. this.recipes = new ArrayList<>();
  29. this.recipes.add(recipe);
  30. }
  31. @Override
  32. public void resetRecipes() {
  33. this.recipes = new ArrayList<>();
  34. }
  35. @Override
  36. public List<REISlot> setupDisplay(int number) {
  37. return new LinkedList<>();
  38. }
  39. @Override
  40. public boolean canDisplay(RandomRecipe recipe) {
  41. return false;
  42. }
  43. @Override
  44. public void drawExtras() {
  45. }
  46. @Override
  47. public void addWidget(List<Control> controls, int number) {
  48. }
  49. @Override
  50. public ItemStack getCategoryIcon() {
  51. return item;
  52. }
  53. }