Tinker I/O

Tinker I/O

13M Downloads

Smart Output causing tps lag when liquids are left in its tank

alyip98 opened this issue ยท 4 comments

commented

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?

commented

Could provide the version of Tinker I/O ? Thanks!

commented

tinker_io-1.12.2-release 2.6.1, playing Enigmatica 2 Expert

commented

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