McJtyMods / XNet

Advanced item/liquid/energy/... networking
MIT License
91 stars 49 forks source link

Refactoring after update, new connector GUI features, #551 fix, optimisation patch #570

Closed Dertiende closed 2 months ago

Dertiende commented 3 months ago

Refactoring after update

New connector GUI features + #551 fix

Optimisation "ticking" code for all channel types

Description Before After Channels
1 Combining simulation and real insertion methods Doing work twice, simulate then real Unified method based on pipez one. Still safe but faster Item channel Fluid channel
2 Cache connector position Request position every tick for every connector Stored as new field in cached connectors All channels
3 Skip processing of full inventories if there are many extractors Trying to insert to full inventory for every extractor in cycle If we have more than 2 extractors, we memorize the full inventory and skip it for the next one. We perform this operation when processing the first and middle extractor Item channel
4 Cache rate for energy channel Check limit rate every tick for every connector Stored as new field in cached connectors Energy channel
5 Check required energy Iterate over all extractors Stop the iteration if we have obtained enough energy to fill all consumers Energy channel