CatServer
CatServer copied to clipboard
[1.16.5] NoSuchElementException when looping over Bukkit.recipeIterator()
Using Bukkit's recipe iterator, it throws the following error when simply looping over the iterator:
[20:23:09] [Server thread/ERROR]: Error occurred while enabling AngelChest v9.4.0 (Is it up to date?)
java.util.NoSuchElementException: null
at java.util.HashMap$HashIterator.nextNode(HashMap.java:1471) ~[?:1.8.0_333]
at java.util.HashMap$ValueIterator.next(HashMap.java:1498) ~[?:1.8.0_333]
at org.bukkit.craftbukkit.v1_16_R3.inventory.RecipeIterator.next(RecipeIterator.java:31) ~[forge:?]
at org.bukkit.craftbukkit.v1_16_R3.inventory.RecipeIterator.next(RecipeIterator.java:12) ~[forge:?]
at de.jeff_media.angelchest.jC.<init>(lt:360) ~[?:?] <-- See below java code
...
To reproduce (the marked line is the line that throws the above error):
Iterator<Recipe> iterator = Bukkit.recipeIterator();
while(iterator.hasNext()) { // <-- This is the marked line from the above stacktrace
// Do something...
This probably only happens when using blocks / items added by forge mods.
Suggested fix: Make the RecipeIterator only return recipes that contain blocks / items recognizable by Bukkit's Material class.
Thanks for your submission, we will fix it asap
这个修复了么?