DevOnTheRocks / RockyTweaks

A Minecraft Forge mod that adds additional functionality to other mods.
GNU General Public License v3.0
5 stars 2 forks source link

Lessen performance hit from CT's getIItemStack #32

Closed democat3457 closed 2 years ago

democat3457 commented 2 years ago

Uses internal MC calls rather than CraftTweakerMC.getIItemStack.

Due to a recent change in CraftTweaker's IItemStack internals, getIItemStack always creates a new copy of the ItemStack. This can result in hefty performance hits in large modpacks, where the total time taken can take upwards of 40 seconds just to figure out if anvil recipes are blacklisted.

democat3457 commented 2 years ago

By the way, although this way works, a new CraftTweaker version was just released that provides a CrT-only way of doing this (CraftTweakerMC.getIItemStackForMatching) rather than using vanilla Ingredient.apply. I was meaning to update it but FG3 is a pain in the butt to setup, and I wasn't able to update it.

Mohron commented 2 years ago

Now available on CurseForge as a beta version.