RFTools

RFTools

74M Downloads

IPeripheral.equals implementation is wrong

SquidDev opened this issue ยท 1 comments

commented

ComputerCraft only uses IPeripheral.equals to determine if two peripherals are equal: it doesn't check for reference equality first.

However, all RFTools IPeripheral implementations return false and so ComputerCraft believes that an identical peripheral is different, firing events on a block update. Replacing this with a this == other would fix this.

Reproduction

  • Place down computer
  • Place down RFTools TE implementing IPeripheral
  • Run while true do print(os.pullEvent()) end on the computer
  • Trigger a block update next to the computer
  • peripheral/peripheral_detach events are fired.
commented

This needs to be reimplemented in 1.10.2 anyway