Botany Pots

Botany Pots

33M Downloads

[BUG] Severe intermittent lag on client tick when run with BotanyPotsTiers

MUYUTwilighter opened this issue ยท 0 comments

commented

Minecraft Version

1.20.1

Mod Version

13.0.38

Mod Loader

Fabric

What environment are you running the mod in?

Client

Issue Description

I know it sounds like an issue of BotanyPotsTiers (abbr. BPT), but I managed to fix it with mixin on BotanyPots (abbr. BP).

Bookshelf keeps sending the ClientboundBlockEntityDataPacket for BlockEntityBotanyPot at intervals, and every time when client receive it, BlockEntityBotanyPot will always trying to execute findSoil and findCrop. These causes lag when more than 128 pots are placed in world and would exacerbate especially with pots from BPT.

This is a profiler report by Spark mod, recording only the interval lagging ticks.
https://spark.lucko.me/cp9xGcK8TG

However, these 2 methods is not always necessary to be executed, as the packet is regularly update without any modification. So I wrote a mod (not published on CurseForge nor other platform yet) to do some judgement before the load method is trying to invoke finding methods. And it seems to work fine on my modpack.

You can merge the code of my mod at your will.
https://github.com/MUYUTwilighter/BotanyPotsFix