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:
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.
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](https://github.com/wisp-forest/alloy-forgery/assets/4163353/4e0e4909-fa26-4832-b89f-84f229715688)
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.