Smart Output causing tps lag when liquids are left in its tank
alyip98 opened this issue ยท 4 comments
I believe that the problem is due to SORecipeChecker rebuilding a list of recipes from all registered casting recipes every tick. I'm not sure if this is addressed in the rw version, but if not, could you cache the recipes?
From tinker-IO/src/main/java/tinker_io/tileentity/TileEntitySmartOutput.java:
private void updateRecipe() {
ItemStack cast = inventory.getStackInSlot(ContainerSmartOutput.PATTERN);
FluidStack fluidStack = tank.getFluid();
if(currentMode == MODE_BASIN) {
currentRecipe = SmartOutputRecipeHandler.findBasinCastingRecipe(cast, fluidStack);
} else if(currentMode == MODE_CAST) {
currentRecipe = SmartOutputRecipeHandler.findTableCastingRecipe(cast, fluidStack);
}
}
I suggest storing currentRecipe locally and only calling findBasinCastingRecipe when the fluid type has changed
The code you found is in the RW version. And findBasinCastingRecipe()
will be called only if private boolean isChanged()
return true.