Closed ruyanve closed 9 years ago
I believe this is a bug with KoreSample not RecipeResearch directly.
I guess @ScottKillen should take a look then...
@Funwayguy The problem is this: You are trying to get a texture for a subblock that does not exist. There is no sane answer that getIcon can give in this case.
This used to be a problem with NEI and other mods, but ChickenBones used exception handling to recover from cases like this...and indeed that is precisely the purpose of exception handling. You can easily catch the IndexOutOfBoundsException and recover in a way that makes sense for your purposes.
You will have this problem with other mods as well if you assume that your requests are always valid.
I hope this is helpful.
BTW, very cool mod idea. :+1:
@ScottKillen I will likely add the try-catch statement but the sane answer is to use a modulus call on the sub-block meta number to wrap the ID around into acceptable range. Here's an example for the textbook in this mod: https://github.com/Funwayguy/RecipeResearch/blob/master/src/main/java/reciperesearch/items/ItemRecipeTextbook.java#L110 It may not be an accurate representation of the block/item with the given damage value but it's better than letting Minecraft crash when somebody does something unexpected.
PS: You could alternatively use 'MathHelper.clamp_int' instead which is what vanilla Minecraft uses in some cases
Handling for this should be covered in 1.0.17 now
Awesome, thank you! I will do intensive testing over the next couple of days and report back. This will be an essential part of "Viribus Unitis", I've read and understood your modpack permissions and will act accordingly.
I broke it! Testing a strange mix of mods I get this: http://pastebin.com/FSNMJeBh