Reliquary Reincarnations

Reliquary Reincarnations

51M Downloads

Infernal Tear only works when Item.getHasSubTypes() == true

CovertJaguar opened this issue ยท 4 comments

commented

All other items are ignored because the key doesn't match the recipe map.

Additionally, you should probably wrap the parser and catch exceptions. Some mod items aren't well behaved.

And finally... using the wildcard '*', crashes on the server because getSubItems() is client only.

commented

Thanks for logging this.

Honestly I have no idea how i am calling client only calls there without noticing that until now - I usually test every feature on dedicated server, I guess I must have only tested the actual ids and not the wildcard.

When you say that some mods misbehave, was that in the getsubitem/block code? Looking at this I will get rid of those calls altogether and just keep the wildcard in my cache and then use it wherever needed in meta comparisons. So if that was just this thing I should be able to get rid of it, also I don't think I will keep the stack I am creating currently in cache so that should get rid of another potential issue when creating stacks.

commented

It was actually some Foundry/Substratum item, dusts or small dusts. And it was throwing NPEs on getMetadata() of all things. I didn't really figure out why as I switched to specifying the exact metadata values and it had no problems with that.

commented

So previously switching to exact metadata would create ItemStack with that meta in cache and then use this to compare to items in player's inventory.
But with the change I did yesterday it now only keeps the meta value in cache and then compares that to meta of the item in player's inventory (after comparing the name of course) and there it now calls getMetadata. So you may need to switch back to using wildcard which now keeps the wildcard char in cache and then only cares about item's registry name.

I am not in favor of adding more protection in those places for items misbehaving in getMetadata because honestly then I could think of so many other calls that items can override that I would need to protect just in case some item is misbehaving in one of those places.

commented

I have just released a build that has the fix for this on CF.