EnderIO icon indicating copy to clipboard operation
EnderIO copied to clipboard

Add api for bundled/colored redstone conduits

Open payonel opened this issue 5 years ago • 9 comments

Issue Description:

In short, this is a request for an interface/api to utilize EnderIO redstone conduit color-based channels

We look forward to improving OpenComputers integration with EnderIO, specifically with EnderIO's redstone channels. Currently in 1.12 we support getting and setting redstone signal strength on the redstone conduit, treating it as a vanilla redstone resource. I believe that currently there is not way for us to add this integration.

Affected Versions

EnderIO-1.12.2-5.0.44.jar

payonel avatar Jun 04 '19 21:06 payonel

So currently we have the following code (commented out since cc integration was remove a while ago), but if I understand correctly it should provide the sort of information you need?

https://github.com/SleepyTrousers/EnderIO/blob/310a5e216bf799d8e8a1822ba80d0e3c33230d6d/enderio-conduits/src/main/java/crazypants/enderio/conduits/conduit/redstone/InsulatedRedstoneConduit.java#L460

https://github.com/SleepyTrousers/EnderIO/tree/master/enderio-conduits/src/main/java/crazypants/enderio/conduits/integration/computercraft

If so, I can look into externalising an api like this.

EpicSquid avatar Jun 04 '19 22:06 EpicSquid

that looks like part of it - specifically the getter Map<DyeColor, Signal>. Also, I'm happy to implement and interface, and/or a capability; I am happy to put most of the integration (i.e. cross mod code) on the OC side (yep, enderio gets special treatment :+1: )

I suspect there will be 16 dye/color redstone values? I'll refer to these as the bundled redstone power levels

Here are some example concepts I want to implement

  1. redstone conduits should know that some OC blocks can receive/read bundled redstone levels.
  2. some OC blocks should be able to set (emit) the bundled set of redstone values to redstone conduits

payonel avatar Jun 05 '19 06:06 payonel

I'll have a look to put parts of the old code back in place so any API adapter code can hook into the conduits. It won't be a full fledged API (or API usage), but just enough for an API adapter!

HenryLoenwind avatar Jun 05 '19 06:06 HenryLoenwind

This would be awesome. The last time I wanted to use bundled redstone, I had to use OC to talk to TIS3D to talk to charset bundled wires because all of the other OC compat I wanted to use was disabled or not yet reimplemented.

codewarrior0 avatar Jun 06 '19 22:06 codewarrior0

I had a quick look at the 1.7.10 code to see what we did in the past. I found a more generic way to read other block's bundled signals, but I didn't find how other blocks could read the conduits' bundled signals. I'm probably blind---anyone here with at least one eye? ;)

HenryLoenwind avatar Jun 07 '19 11:06 HenryLoenwind

but I didn't find how other blocks could read the conduits' bundled signals

wasn't there an API provided by either computercraft or project red!? Those are at least the most known mod to me that brought in colorchannels that were interacting properly

mindforger avatar Jun 07 '19 11:06 mindforger

well.. 8eb67c67551a18d39311eff4f553ca7dd1520567 says it "cleans up" redstone conduits but it makes the ISignalProvider API entirely unused despite still being defined. ISignalProvider definitely seems like the wrong shape because it doesn't use/understand BundledSignal. how much could the above commit be just straight up reverted to restore this behavior?

habnabit avatar Apr 02 '20 23:04 habnabit

Instead of trying to overhaul conduits entirely to re-implement this, would it be reasonable to add a new filter for "bundled redstone" that can be used on the input or output of a given redstone connector to remove the color selection, remove strong/weak option, and just provide the bundled signal in/out?

SashaGelert avatar Jun 13 '20 14:06 SashaGelert

Heya, what's the sitrep on this one? Would love to have this!

VeraxonHD avatar Jan 21 '24 22:01 VeraxonHD