Team-EnderIO / EnderIO

EnderIO Rewritten for Modern Minecraft.
https://enderio.com
The Unlicense
332 stars 100 forks source link

Data-Oriented Conduits, Network-Wide Context and Energy Conduit Tiers #724

Closed Rover656 closed 2 months ago

Rover656 commented 3 months ago

Description

This is a substantial addition to the conduit API. Here's a general rundown.

This entire rundown is now out of date due to the datapack-related changes. I will write formal documentation on our website once this PR nears completion.

~~Instead of defining a ConduitType which dictates the behaviour of a conduit, a ConduitType now declares it's Network Type and it's Options.

Options are like the previous TieredConduit implementation but a bit more comprehensive - options allow you to influence the behaviours of the ticker and the network based on any arbitrary data you want to have for each instance of your conduit types.

The ConduitNetworkType is the new ConduitType (confusing, right?). This determines how ConduitNetworkContext and ConduitData is created, as well as: filter + upgrade compatibility, conduit events, ticker that will be used, menu data and capability proxies. This has been done to group all of this logic together as it's all fairly locked-in. In order for your conduit network to support a certain upgrade, the ticker must be able to handle it and so on. These may change location again, but I'm happy with them at the minute.

ConduitNetworkContext is the new kid on the block - this allows a network to have arbitrary data stored with the entire network instead of within each node. This has been used to create a network-wide energy buffer and round robin information for the energy network. This could find other utilities in future.

Using all of these new features, Energy conduits have now been reworked to support tiers and only allow energy to be pushed into them (no more extracting from blocks). This has resulted in the creation of a buffer on the conduit network to be able to hold the energy being moved through the network.~~

These changes will NOT be backported to 1.20.1

TODO

Breaking Changes

All conduit API has been broken, and due to the change to energy conduits, old 1.21 worlds will not load after this PR.

Checklist

Rover656 commented 3 months ago

I am going to defer the changes to how conduit data and context are stored until a future PR - these must be completed before releasing a 1.21 build as they will cause breaking changes.

I'll finish setup of the energy conduit tiers and energy scaling and then merge this PR - creating issues for any outstanding items as I do.

Rover656 commented 3 months ago

Oh - and one of those issues will be recipe datagen for AE2 and Mekanism, as that is pending a PR to NeoForge.

Rover656 commented 2 months ago

AE2 and Mekanism conduits will return after project restructure