diff --git a/src/main/java/li/cil/oc2/common/bus/device/rpc/TypeNameRPCDevice.java b/src/main/java/li/cil/oc2/common/bus/device/rpc/TypeNameRPCDevice.java index d8baa7c1..35f9aa96 100644 --- a/src/main/java/li/cil/oc2/common/bus/device/rpc/TypeNameRPCDevice.java +++ b/src/main/java/li/cil/oc2/common/bus/device/rpc/TypeNameRPCDevice.java @@ -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 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); + } }