AdvancedPeripherals icon indicating copy to clipboard operation
AdvancedPeripherals copied to clipboard

Generic peripherals

Open SquidDev opened this issue 10 months ago • 3 comments

PLEASE READ THE GUIDELINES BEFORE MAKING A CONTRIBUTION

Please check if the PR fulfills these requirements

  • [ ] The commit message are well described: Not really, no!
  • [x] All changes have fully been tested.

What kind of change does this PR introduce? (Bug fix, feature, ...)

Bug fix.

What is the current behavior? (You can also link to an open issue here)

AdvancedPeripherals integrations override CC:T's generic peripherals. For instance, Create's fluid tanks no longer have a method to push/pull fluids.

What is the new behavior (if this is a feature change)?

This migrates the vanilla and create peripherals to use the generic peripheral system.

A screenshot of a computer's UI, with Lua code calling getInfo on a Create fluid tank.

Does this PR introduce a breaking change? (What changes might users need to make in their scripts due to this PR?)

No breaking change change.

Other information:

The Powah integration probably should be updated too, these two just seemed the easiest to demonstrate the change with.

SquidDev avatar Apr 04 '24 21:04 SquidDev

I see that you bumped CC Are there any changes you needed from CC which only exist in the newer version and not for 1.19.2?

SirEndii avatar Apr 04 '24 23:04 SirEndii

So we depend on https://github.com/cc-tweaked/CC-Tweaked/commit/fe826f5c9c8098219001c87a8422994263b61ee3 (introduced in 1.109.1, but I picked the latest round number) in order to use instance methods in GenericPeripheral. But you could switch all the methods to be static, and drop that requirement.

SquidDev avatar Apr 05 '24 06:04 SquidDev

Concerning (c)

Probably, I should again consider going something like this, because I am so tired of fighting peripheral is not attached issues :)

SirEdvin avatar Apr 05 '24 08:04 SirEdvin

So we depend on cc-tweaked/CC-Tweaked@fe826f5 (introduced in 1.109.1, but I picked the latest round number) in order to use instance methods in GenericPeripheral. But you could switch all the methods to be static, and drop that requirement.

I see. So this is not back portable to 1.19.2

SirEndii avatar Apr 07 '24 14:04 SirEndii

So it should be if you make all the methods static, but otherwise I'm afraid not, no.

SquidDev avatar Apr 07 '24 14:04 SquidDev

Thank you!

SquidDev avatar Apr 10 '24 10:04 SquidDev

Thank you!

No, thank you for the PR! This was a long needed change/fix

SirEndii avatar Apr 10 '24 11:04 SirEndii