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

OpenPeripheral support #26

Closed SquidDev closed 9 years ago

SquidDev commented 9 years ago

Open peripheral support for #17

OpenPeripheral comes with the @Env parameter. This takes a variables that gives the name of the argument. For instance ComputerCraftEnv adds access to the computer, context, etc...

It might be possible add additional processing via ASM to allow us to get AdapterPeripheral to implement INetworkedPeripheral. However, as a peripheral can be attached to multiple networks, we probably want to have a custom implementation of INetworkAccess that proxies to multiple networks. This obviously gives limited capbilities - we can't track disconect events - though we could also add a custom interface INetworkedAdapter that provides similar capabilities to INetworkedPeripheral through something like this.

We also need to use ASM injection so the peripheral proxy implements INetworkedPeripheral.

SquidDev commented 9 years ago

Sadly it looks like an INetworkedAdapter will not be possible, though it doesn't matter too much as you can still use @Env(IPeripheralEnvironments.ARG_NETWORK) INetworkedAccess.