tterrag1098

Untitled

Jul 15th, 2018
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.82 KB | None | 0 0
  1. so yeah I tested pressing U on a skull
  2. and it works kinda
  3. it cycles (very slowly, I'm guessing there's a bunch of dupe recipes) and the stack size of the skull never changes
  4. so you get the wrong recipe
  5.  
  6. HenryLoenwind - Last Wednesday at 5:24 PM
  7. as I expected. the list sizes between skulls and the rest now differ
  8. tterrag - Last Wednesday at 5:24 PM
  9. it shouldn't, I've changed nothing when the focus is an input
  10. ItemStack focusStack = focus == null || focus.getMode() != Mode.OUTPUT ? null : (ItemStack) focus.getValue();
  11. HenryLoenwind - Last Wednesday at 5:24 PM
  12. I'd just reset ingredients to the full set in this case.
  13. you didn't, but JEI reduces one list but not the others
  14. our variant cycling only works if all 4 lists have exactly the same size
  15. tterrag - Last Wednesday at 5:25 PM
  16. I don't understand...this logic should be the same
  17. did this bug exist before?
  18. HenryLoenwind - Last Wednesday at 5:25 PM
  19. yes
  20. tterrag - Last Wednesday at 5:25 PM
  21. and "I'd just reset ingredients to the full set" -- how?
  22. HenryLoenwind - Last Wednesday at 5:25 PM
  23. getIngredients()
  24. tterrag - Last Wednesday at 5:26 PM
  25. if (focusStack != null) {
  26. recipeWrapper.getIngredients(ingredients, EnchantmentHelper.getEnchantments(focusStack).get(recipeWrapper.rec.getEnchantment()));
  27. } else {
  28. recipeWrapper.getIngredients(ingredients);
  29. }
  30. HenryLoenwind - Last Wednesday at 5:26 PM
  31. instead of using the filtered parameter
  32. tterrag - Last Wednesday at 5:26 PM
  33. changes nothing :/
  34. again the filtering only runs when the focus is an output
  35. HenryLoenwind - Last Wednesday at 5:26 PM
  36. yes, you need to reset when there's an input focus
  37. tterrag - Last Wednesday at 5:27 PM
  38. that's what is happening there
  39. here is the full logic:
  40.  
  41. IFocus<?> focus = recipeLayout.getFocus();
  42. ItemStack focusStack = focus == null || focus.getMode() != Mode.OUTPUT ? null : (ItemStack) focus.getValue();
  43.  
  44. if (focusStack != null) {
  45. recipeWrapper.getIngredients(ingredients, EnchantmentHelper.getEnchantments(focusStack).get(recipeWrapper.rec.getEnchantment()));
  46. } else {
  47. recipeWrapper.getIngredients(ingredients);
  48. }
  49.  
  50. guiItemStacks.set(ingredients);
  51. HenryLoenwind - Last Wednesday at 5:28 PM
  52. we rely on the fact that all 4 lists have the same size, so they cycle in sync. the moemnt one of them is smaller (because it was decimated by an input focus), the cycling mixes up stuff
  53. tterrag - Last Wednesday at 5:28 PM
  54. I get that but idk how to fix it
  55. I think JEI is messing with it further down the line...the ingredients should be unmodified from the recipewrapper at this point
  56. HenryLoenwind - Last Wednesday at 5:28 PM
  57. yeah, this looks like it should work(edited)
  58. tterrag - Last Wednesday at 5:29 PM
  59. same result though
  60. it doesn't
  61. HenryLoenwind - Last Wednesday at 5:29 PM
  62. ping mezz?
  63. tterrag - Last Wednesday at 5:30 PM
  64. @mezz halp
Advertisement
Add Comment
Please, Sign In to add comment