-
Notifications
You must be signed in to change notification settings - Fork 219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redstone relay #2002
Redstone relay #2002
Conversation
I really like this feature! |
One alternative naming scheme worth considering could be Redstone extender or Redstone relay? As it extends/relays computer redstone control over peripheral network. |
Oh, "Relay" is a good one! |
203f129
to
b6e90f0
Compare
- Move redstone methods out of the IAPIEnvironment, and into a new RedstoneAccess. We similarly move the implementation from Environment into a new RedstoneState class. The interface is possibly a little redundant (interfaces with a single implementation are always a little suspect), but it's nice to keep the consumer/producer interfaces separate. - Abstract most redstone API methods into a separate shared class, that can be used by both the rs API and the new redstone relay. - Add the new redstone relay block. The docs are probably a little lacking here, but I really struggled to write anything which wasn't just "look, it's the same as the redstone API".
b6e90f0
to
997f330
Compare
I know this was already merged, but could we get a side parameter on the (For my specific use case, I'm wrapping peripherals with a driver that limits peripheral events to programs that request them. Not knowing which event corresponds to which peripheral means I have to figure it out myself through a lot of peripheral calls, or the event needs to be sent to all redstone devices, regardless of whether that peripheral changed.) |
Question is how its implemented.
I am about 90% sure its just one event for all changes. |
Looking through the code, it looks to me like it is one event per relay. Which, if the relay included its own name (and assuming I've read things correctly), would not increase the number of events. However, this would decrease the amount of Including the side of the relay that changed as well would increase the number of events received, but could then also include the previous and current redstone values, thus eliminating the need to even call My overall thoughts? Having just the relay name in the event would be a significant upgrade, but going to per-change events may be overkill. |
I would also be surprised if (in most setups) any given restone relay has more one side being used. While it would make usercode more complex, one could map which side of each relay is being used and thus not need to check all 6 sides of that relay when its redstone event is pulled. So yeah, having a second return value on redstone events for which relay queued that event would be useful. |
This adds a separate redstone peripheral, as described in #1624.
There's still a lot to do here, but felt it was worth making this public and getting some feedback here.
The peripheral is currently called "Redstone Control". I'm not wild about the name, so here's some alternatives I considered:
Not sure, feedback welcome!
I'm using @TheStraying11's proposed textures from Add a separate redstone peripheral #1624. These originally came in an on/off variety for each face. I've decided against this for now, and the block is always "on", as doing the models for this is really awkward. We could just have the whole block be on/off, rather than each face. Not sure!
The block is directional and uses relative sides ("left", "right", etc...), like the
redstone
API. We use the same direction mapping as turtles, where left/right are relative to the direction the block is facing (like turtles), rather than the player facing the block (like computers).Still to do