wisp-forest / alloy-forgery

Alloy smelter mod for Fabric
MIT License
43 stars 18 forks source link

Cleanup ForgeControllerBlockEntity class #117

Closed Noaaan closed 9 months ago

Noaaan commented 11 months ago

The point of this PR is to take a small pass through the Forge Controller Block Entity, clean up the code somewhat, and try to optimize it.

As 800020h mentioned in Discord, the Forge Controller can be somewhat laggy when fueled, as displayed here with Observable: image

Generally 100 microseconds per tick is playable, however in larger servers where players build multiple Forges each, this can silently become a problem.

In the first commit I added a few null checks and reduced if statement nesting by at least one level. Still needs a pass to comment what each snippet of the code intends to do in terms of logic. From there we can try to take action on snippets that cause a bunch of lag.

Noaaan commented 9 months ago

Superseded by #119