SquidDev-CC / CCTweaks

Random additions to ComputerCraft (somewhat deprecated, use CC-Tweaked if you're on Minecraft 1.12).
MIT License
12 stars 2 forks source link

Wired Modems can be Daisy-Chained #31

Closed SquidDev closed 9 years ago

SquidDev commented 9 years ago

Wired modems can connect to full block modems (and vice versa) allowing 'subnets'. I'm guessing we don't want this behaviour - I just though I'd check. CC-Tweaks' modems cannot connect to each other so there is an inconsistency here.

I've got a fix written, just checking before I push it.

ElvishJerricco commented 9 years ago

I actually rather like that this exists. It's kinda cool. It makes sense that a modem peripheral that just provides methods works when attached via a modem. Why should it behave differently than when attached via the sides?

SquidDev commented 9 years ago

Sure. I do think it is cool, I just remember adding a partial implementation to avoid modem blocks connecting to other modem blocks. I guess I can add special handling for that.

ElvishJerricco commented 9 years ago

Yea I just don't think there's any reason to try to restrict this. Letting modems chain like this could prove interesting.

Not to mention, the Lua wrapper of the peripheral API doesn't even take non-sided modems into account.

SquidDev commented 9 years ago

I've found one minor issue with this. Because modems call detach on the neighbouring IComputerAccess, the peripheral detach event gets propagated to the parent network.

     P
C===>M
------------------------------
C Computer    > Vanilla Modem
= Cable       M Modem Block
P Peripheral

When toggling the full block modem, the computer receives detach events for the peripherals for the peripheral, the modem and the computer itself.

ElvishJerricco commented 9 years ago

I'm not understanding. Why are we preventing full block modems from connecting to each other?

SquidDev commented 9 years ago

When you have lots of modem blocks in a row (such as connected to barrels/chests) every modem will connect to the surrounding modems, meaning you would get 4 modems for every peripheral. I'm happy to remove that, it just seems a bit strange having that.

ElvishJerricco commented 9 years ago

Ah. I suppose that makes sense.

SquidDev commented 9 years ago

Neither way seems particularly perfect, but for people used to PeripheralProxies and normal CC this seems more intuitive.