From e3dde71821701c7e533a956515850f758cf2fa1b Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Thu, 11 Aug 2022 19:09:33 +0200 Subject: [PATCH] And the default return value --- .../viaversion/platform/AbstractProtocolDetectorService.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/src/main/java/com/viaversion/viaversion/platform/AbstractProtocolDetectorService.java b/common/src/main/java/com/viaversion/viaversion/platform/AbstractProtocolDetectorService.java index 40a9e1dfb..a3129c8b6 100644 --- a/common/src/main/java/com/viaversion/viaversion/platform/AbstractProtocolDetectorService.java +++ b/common/src/main/java/com/viaversion/viaversion/platform/AbstractProtocolDetectorService.java @@ -29,6 +29,10 @@ public abstract class AbstractProtocolDetectorService implements ProtocolDetecto protected final Object2IntMap detectedProtocolIds = new Object2IntOpenHashMap<>(); protected final ReadWriteLock lock = new ReentrantReadWriteLock(); + protected AbstractProtocolDetectorService() { + detectedProtocolIds.defaultReturnValue(-1); + } + @Override public int serverProtocolVersion(final String serverName) { // Step 1. Check detected