Thaumic JEI

Thaumic JEI

30M Downloads

checkedItemStacksEmpty check is faulty

QuImUfu opened this issue ยท 1 comments

commented

That check excludes items that do have Aspects.
Changed the code to check for them and output them.
code:

                for (ItemStack stack : registry.getIngredientRegistry().getIngredients(ItemStack.class).asList()) {
                    AspectList list = new AspectList(stack);
                    if (list.size() > 0) {
                        if (checkedItemStacksEmpty.contains(stack.getItem().getRegistryName().toString())) {
                            ThaumicJEI.LOGGER.info("THIS IS NO GOOD " + stack.serializeNBT().toString() + " has Aspects");
                        }
                        for (Aspect aspect : list.getAspects()) {
                            ItemStack clone = stack.copy();
                            clone.stackSize = list.getAmount(aspect);
                            aspectCache.put(aspect, clone);
                        }
                    } else {
                        if (!checkedItemStacksEmpty.contains(stack.getItem().getRegistryName().toString())) {
                            checkedItemStacksEmpty.add(stack.getItem().getRegistryName().toString());
                        }
                    }
                }

In vanilla Thaumcraft this outputs (in AllTheMods v4.1 it outputs thousands of lines):

[04:02:21] [Thread-11/INFO] [ThaumicJEI]: THIS IS NO GOOD {id:"thaumcraft:slab_stone",Count:1b,Damage:2s} has Aspects
[04:02:21] [Thread-11/INFO] [ThaumicJEI]: THIS IS NO GOOD {id:"thaumcraft:slab_stone",Count:1b,Damage:3s} has Aspects
[04:02:21] [Thread-11/INFO] [ThaumicJEI]: THIS IS NO GOOD {id:"thaumcraft:nugget",Count:1b,Damage:5s} has Aspects
[04:02:21] [Thread-11/INFO] [ThaumicJEI]: THIS IS NO GOOD {id:"thaumcraft:nugget",Count:1b,Damage:6s} has Aspects
[04:02:21] [Thread-11/INFO] [ThaumicJEI]: THIS IS NO GOOD {id:"thaumcraft:nugget",Count:1b,Damage:8s} has Aspects
[04:02:21] [Thread-11/INFO] [ThaumicJEI]: THIS IS NO GOOD {id:"thaumcraft:nugget",Count:1b,Damage:10s} has Aspects
[04:02:21] [Thread-11/INFO] [ThaumicJEI]: THIS IS NO GOOD {id:"thaumcraft:crystal_essence",Count:1b,tag:{Aspects:[0:{amount:1,key:"aqua"}]},Damage:0s} has Aspects
[04:02:21] [Thread-11/INFO] [ThaumicJEI]: THIS IS NO GOOD {id:"thaumcraft:crystal_essence",Count:1b,tag:{Aspects:[0:{amount:1,key:"ordo"}]},Damage:0s} has Aspects
[04:02:21] [Thread-11/INFO] [ThaumicJEI]: THIS IS NO GOOD {id:"thaumcraft:crystal_essence",Count:1b,tag:{Aspects:[0:{amount:1,key:"perditio"}]},Damage:0s} has Aspects
[04:02:21] [Thread-11/INFO] [ThaumicJEI]: THIS IS NO GOOD {id:"thaumcraft:crystal_essence",Count:1b,tag:{Aspects:[0:{amount:1,key:"vacuos"}]},Damage:0s} has Aspects
[04:02:21] [Thread-11/INFO] [ThaumicJEI]: THIS IS NO GOOD {id:"thaumcraft:crystal_essence",Count:1b,tag:{Aspects:[0:{amount:1,key:"lux"}]},Damage:0s} has Aspects
[04:02:21] [Thread-11/INFO] [ThaumicJEI]: THIS IS NO GOOD {id:"thaumcraft:crystal_essence",Count:1b,tag:{Aspects:[0:{amount:1,key:"motus"}]},Damage:0s} has Aspects
[04:02:21] [Thread-11/INFO] [ThaumicJEI]: THIS IS NO GOOD {id:"thaumcraft:crystal_essence",Count:1b,tag:{Aspects:[0:{amount:1,key:"gelum"}]},Damage:0s} has Aspects
[04:02:21] [Thread-11/INFO] [ThaumicJEI]: THIS IS NO GOOD {id:"thaumcraft:crystal_essence",Count:1b,tag:{Aspects:[0:{amount:1,key:"vitreus"}]},Damage:0s} has Aspects
[04:02:21] [Thread-11/INFO] [ThaumicJEI]: THIS IS NO GOOD {id:"thaumcraft:crystal_essence",Count:1b,tag:{Aspects:[0:{amount:1,key:"metallum"}]},Damage:0s} has Aspects
[04:02:21] [Thread-11/INFO] [ThaumicJEI]: THIS IS NO GOOD {id:"thaumcraft:crystal_essence",Count:1b,tag:{Aspects:[0:{amount:1,key:"victus"}]},Damage:0s} has Aspects
[04:02:21] [Thread-11/INFO] [ThaumicJEI]: THIS IS NO GOOD {id:"thaumcraft:crystal_essence",Count:1b,tag:{Aspects:[0:{amount:1,key:"mortuus"}]},Damage:0s} has Aspects
[04:02:21] [Thread-11/INFO] [ThaumicJEI]: THIS IS NO GOOD {id:"thaumcraft:crystal_essence",Count:1b,tag:{Aspects:[0:{amount:1,key:"potentia"}]},Damage:0s} has Aspects
[04:02:21] [Thread-11/INFO] [ThaumicJEI]: THIS IS NO GOOD {id:"thaumcraft:crystal_essence",Count:1b,tag:{Aspects:[0:{amount:1,key:"permutatio"}]},Damage:0s} has Aspects
[04:02:21] [Thread-11/INFO] [ThaumicJEI]: THIS IS NO GOOD {id:"thaumcraft:crystal_essence",Count:1b,tag:{Aspects:[0:{amount:1,key:"praecantatio"}]},Damage:0s} has Aspects
[04:02:21] [Thread-11/INFO] [ThaumicJEI]: THIS IS NO GOOD {id:"thaumcraft:crystal_essence",Count:1b,tag:{Aspects:[0:{amount:1,key:"auram"}]},Damage:0s} has Aspects
[04:02:21] [Thread-11/INFO] [ThaumicJEI]: THIS IS NO GOOD {id:"thaumcraft:crystal_essence",Count:1b,tag:{Aspects:[0:{amount:1,key:"alkimia"}]},Damage:0s} has Aspects
[04:02:21] [Thread-11/INFO] [ThaumicJEI]: THIS IS NO GOOD {id:"thaumcraft:crystal_essence",Count:1b,tag:{Aspects:[0:{amount:1,key:"vitium"}]},Damage:0s} has Aspects
[04:02:21] [Thread-11/INFO] [ThaumicJEI]: THIS IS NO GOOD {id:"thaumcraft:crystal_essence",Count:1b,tag:{Aspects:[0:{amount:1,key:"tenebrae"}]},Damage:0s} has Aspects
[04:02:21] [Thread-11/INFO] [ThaumicJEI]: THIS IS NO GOOD {id:"thaumcraft:crystal_essence",Count:1b,tag:{Aspects:[0:{amount:1,key:"alienis"}]},Damage:0s} has Aspects
[04:02:21] [Thread-11/INFO] [ThaumicJEI]: THIS IS NO GOOD {id:"thaumcraft:crystal_essence",Count:1b,tag:{Aspects:[0:{amount:1,key:"volatus"}]},Damage:0s} has Aspects
[04:02:21] [Thread-11/INFO] [ThaumicJEI]: THIS IS NO GOOD {id:"thaumcraft:crystal_essence",Count:1b,tag:{Aspects:[0:{amount:1,key:"herba"}]},Damage:0s} has Aspects
[04:02:21] [Thread-11/INFO] [ThaumicJEI]: THIS IS NO GOOD {id:"thaumcraft:crystal_essence",Count:1b,tag:{Aspects:[0:{amount:1,key:"instrumentum"}]},Damage:0s} has Aspects
[04:02:21] [Thread-11/INFO] [ThaumicJEI]: THIS IS NO GOOD {id:"thaumcraft:crystal_essence",Count:1b,tag:{Aspects:[0:{amount:1,key:"fabrico"}]},Damage:0s} has Aspects
[04:02:21] [Thread-11/INFO] [ThaumicJEI]: THIS IS NO GOOD {id:"thaumcraft:crystal_essence",Count:1b,tag:{Aspects:[0:{amount:1,key:"machina"}]},Damage:0s} has Aspects
[04:02:21] [Thread-11/INFO] [ThaumicJEI]: THIS IS NO GOOD {id:"thaumcraft:crystal_essence",Count:1b,tag:{Aspects:[0:{amount:1,key:"vinculum"}]},Damage:0s} has Aspects
[04:02:21] [Thread-11/INFO] [ThaumicJEI]: THIS IS NO GOOD {id:"thaumcraft:crystal_essence",Count:1b,tag:{Aspects:[0:{amount:1,key:"spiritus"}]},Damage:0s} has Aspects
[04:02:21] [Thread-11/INFO] [ThaumicJEI]: THIS IS NO GOOD {id:"thaumcraft:crystal_essence",Count:1b,tag:{Aspects:[0:{amount:1,key:"cognitio"}]},Damage:0s} has Aspects
[04:02:21] [Thread-11/INFO] [ThaumicJEI]: THIS IS NO GOOD {id:"thaumcraft:crystal_essence",Count:1b,tag:{Aspects:[0:{amount:1,key:"sensus"}]},Damage:0s} has Aspects
[04:02:21] [Thread-11/INFO] [ThaumicJEI]: THIS IS NO GOOD {id:"thaumcraft:crystal_essence",Count:1b,tag:{Aspects:[0:{amount:1,key:"aversio"}]},Damage:0s} has Aspects
[04:02:21] [Thread-11/INFO] [ThaumicJEI]: THIS IS NO GOOD {id:"thaumcraft:crystal_essence",Count:1b,tag:{Aspects:[0:{amount:1,key:"praemunio"}]},Damage:0s} has Aspects
[04:02:21] [Thread-11/INFO] [ThaumicJEI]: THIS IS NO GOOD {id:"thaumcraft:crystal_essence",Count:1b,tag:{Aspects:[0:{amount:1,key:"desiderium"}]},Damage:0s} has Aspects
[04:02:21] [Thread-11/INFO] [ThaumicJEI]: THIS IS NO GOOD {id:"thaumcraft:crystal_essence",Count:1b,tag:{Aspects:[0:{amount:1,key:"exanimis"}]},Damage:0s} has Aspects
[04:02:21] [Thread-11/INFO] [ThaumicJEI]: THIS IS NO GOOD {id:"thaumcraft:crystal_essence",Count:1b,tag:{Aspects:[0:{amount:1,key:"bestia"}]},Damage:0s} has Aspects
[04:02:21] [Thread-11/INFO] [ThaumicJEI]: THIS IS NO GOOD {id:"thaumcraft:crystal_essence",Count:1b,tag:{Aspects:[0:{amount:1,key:"humanus"}]},Damage:0s} has Aspects

This is the only optimization that makes your code (in some cases/big modpacks) faster than mine.

Speed Comparison (both behaving correctly (yours fixed), AllTheMods v4.1):
Your code:
384217ms 385235ms 376190ms => ~381881
My PullRequest code:
369011ms 369513ms 378088ms => ~372204
=> 9677ms improvement =~ 2,5%
I would go for My PullRequest code, but the difference is minimal.

commented

Found a mistake in my code as well, will fix it, however it might make you code perform better in comparison.