mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2024-10-31 23:26:19 +00:00
5409d441b5
This registers IPeripheral as a capability. As a result, all (Minecraft facing) functionality operates using LazyOptional<_>s instead. Peripheral providers should now return a LazyOptional<IPeripheral> too. Hopefully this will allow custom peripherals to mark themselves as invalid (say, because a dependency has changed). While peripheral providers are somewhat redundant, they still have their usages. If a peripheral is applied to a large number of blocks (for instance, all inventories) then using capabilities does incur some memory overhead. We also make the following changes based on the above: - Remove the default implementation for IWiredElement, migrating the definition to a common "Capabilities" class. - Remove IPeripheralTile - we'll exclusively use capabilities now. Absurdly this is the most complex change, as all TEs needed to be migrated too. I'm not 100% sure of the correctness of this changes so far - I've tested it pretty well, but blocks with more complex peripheral logic (wired/wireless modems and turtles) are still a little messy. - Remove the "command block" peripheral provider, attaching a capability instead. |
||
---|---|---|
.. | ||
checkstyle | ||
idea | ||
license |