Avoid device duplication due to synthetic name device.
This commit is contained in:
@@ -5,6 +5,7 @@ import li.cil.oc2.api.bus.device.rpc.RPCDevice;
|
||||
import li.cil.oc2.api.bus.device.rpc.RPCMethod;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import static java.util.Collections.emptyList;
|
||||
import static java.util.Collections.singletonList;
|
||||
@@ -25,4 +26,17 @@ public final class TypeNameRPCDevice implements RPCDevice, ItemDevice {
|
||||
public List<RPCMethod> getMethods() {
|
||||
return emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
final TypeNameRPCDevice that = (TypeNameRPCDevice) o;
|
||||
return typeName.equals(that.typeName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(typeName);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user