MrCrayfish's Furniture Mod: Refurbished

MrCrayfish's Furniture Mod: Refurbished

22M Downloads

Significant performance impact of the Stove block

Quatryl23 opened this issue · 1 comments

commented

Describe the bug

Whenever the StoveBlockEntity ticks, it calls IProcessingBlock.processTick() which resets the processing time of the slot to 0 if no active processing is detected. The method for this is StoveBlockEntity.setProcessingTime() which calls BlockEntity.setChanged(). This method takes quite long to be executed so if you´re using the stoves in bigger quantities e.g. when building a city, even if they are not processing anything, the Stove block ticking really drops the tps. To avoid this unnecessary performance cost, I think you could add a simple if-statement in the setProcessingTime() method and only call setChanged() if the processing time really changed/ must change. This way you would avoid calling the heavy setChanged() method over and over again for inactive Stoves.

Mod Version

1.0.12

Minecraft Version

1.20.1

Modloader

Forge

commented

Thanks for the report. I'll look into this