NuclearCraft

NuclearCraft

31M Downloads

Generate valid machine input lists on game load rather than on tile instantiation

Sir-Will opened this issue ยท 10 comments

commented

NuclearCraft-2.13--1.12.2

commented

RecipeHelper.validFluids is a slow method but is only called when the tile entity is first created and never again - are you sure this is actually causing a performance hit?

commented

Well it's 3% more the most tile ents and this seems a lot for one method.

commented

Is 3% really a lot though? It's a big method because it has to set up the filters on the machine's tanks by going through all the recipes. It's only ran a single time though, so I can't see how that would cause any performance hits other than on world load. I guess a I could set up a set of static filters to speed it up a little more.

commented

Does it run it every time a new one is placed or every time it gets loaded?

commented

Either on placement or on world load, yeh.

commented

I guess it's fine then.

commented

I think so, but since you did bring it up, I think I could improve the performance a bit by doing one big set of recipe checks on game load instead of when each of the TEs load :)

commented

If it's all the same that would be great, I thought it would be different depending on the settings of the tile.

commented

Each machine of the same type will share the same list of valid fluids, so once the list is generated for each machine type on load no more would have to be generated.

commented

Sorted for the next version :)