This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
immibis's profile picture

Peripheral changes in 1.6 - questions

Started by immibis, 30 March 2014 - 06:41 AM
immibis #1
Posted 30 March 2014 - 08:41 AM
In CC 1.6 IPeripheral now has a new method:

	/**
	  * TODO: Document me
	  */
	public boolean equals(IPeripheral other);

Obviously, the documentation isn't helpful. What is it used for and how is it expected to be implemented?

I would expect that it's the same as Object.equals, but if that's the case, then there's no need for it to be in IPeripheral. The fact that it's in IPeripheral suggests it needs special behaviour, not just

@Override
public boolean equals(IPeripheral other) {
	return other == this;
}


Also, are we now required to use IPeripheralProvider for peripherals that can only connect on one side all peripherals?
Edited on 30 March 2014 - 07:50 AM
Engineer #2
Posted 21 April 2014 - 11:55 AM
Yes, we do have to implement our own peripherals with IPeripheralHandler, this is confirmed over in the beta-bug section where I though Dan plainly forgot it. Turns out it's intentional for some reason.