george8188625 / Create-Diesel-Generators

Source code of Create Diesel Generators mod
https://www.curseforge.com/minecraft/mc-mods/create-diesel-generators
MIT License
22 stars 36 forks source link

Huge laggspikes while using distillery #89

Open seilkomet64 opened 8 months ago

seilkomet64 commented 8 months ago

Whenever the Distillation Tower finishes a Recipe it seems to call "onFluidStackChanged" method which causes a call to get the Recipe from the RecipeFinder. This causes immense lagg, especially in bigger distillation Towers (as it has to get the recipe every single tick), and should be cached.

I'm not well versed in create and forge modding but i believe the onFluidStackChanged method is called everytime the amount of fluid inside the tank changes aswell (as a callback from SmartFluidTank), which again causes the recipe to be reloaded. If possible maybe add a check if the Type of Fluid changed and only reload the recipe then.

Overall a really nice mod. I like how everything looks. I am on the newest version 1.2h btw.

george8188625 commented 8 months ago

onFluidStackChanged isn't called every tick. either way caching the current recipe is a good idea and the distillation tower system is gonna be modified and optimized