diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/blockconnections/ConnectionData.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/blockconnections/ConnectionData.java index a491b76ea..5aa77d1a4 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/blockconnections/ConnectionData.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/blockconnections/ConnectionData.java @@ -30,8 +30,8 @@ import java.util.Map.Entry; public class ConnectionData { private static final BlockChangeRecord[] A = new BlockChangeRecord[0]; public static BlockConnectionProvider blockConnectionProvider; - static IntObjectMap idToKey = CollectionUtil.createIntObjectMap(8581); - static Map keyToId = new HashMap<>(8581); + static IntObjectMap idToKey = CollectionUtil.createIntObjectMap(8582); + static Map keyToId = new HashMap<>(8582); static IntObjectMap connectionHandlerMap = CollectionUtil.createIntObjectMap(1); static IntObjectMap blockConnectionData = CollectionUtil.createIntObjectMap(1); static IntSet occludingStates = CollectionUtil.createIntSet(377); diff --git a/common/src/main/java/us/myles/ViaVersion/util/fastutil/IntMap.java b/common/src/main/java/us/myles/ViaVersion/util/fastutil/IntMap.java index 54237aaed..9498e7360 100644 --- a/common/src/main/java/us/myles/ViaVersion/util/fastutil/IntMap.java +++ b/common/src/main/java/us/myles/ViaVersion/util/fastutil/IntMap.java @@ -1,5 +1,7 @@ package us.myles.ViaVersion.util.fastutil; +import java.util.Map; + /** * Very simple wrapping interface to either be implemented by a HashMap or FastUtil's OpenHashMap. */ @@ -32,4 +34,13 @@ public interface IntMap { * @see java.util.HashMap#remove(Object) */ int remove(int key); + + /** + * Returns the underlying map for usage of not implemented methods of this class. + * + * @return original map + * @deprecated will cause wrapping if it is a FastUtil collection + */ + @Deprecated + Map getMap(); } diff --git a/common/src/main/java/us/myles/ViaVersion/util/fastutil/WrappedFUIntMap.java b/common/src/main/java/us/myles/ViaVersion/util/fastutil/WrappedFUIntMap.java index 349719378..fd10fa3a4 100644 --- a/common/src/main/java/us/myles/ViaVersion/util/fastutil/WrappedFUIntMap.java +++ b/common/src/main/java/us/myles/ViaVersion/util/fastutil/WrappedFUIntMap.java @@ -35,4 +35,9 @@ final class WrappedFUIntMap implements IntMap { public int remove(int key) { return map.remove(key); } + + @Override + public Map getMap() { + return map; + } } \ No newline at end of file diff --git a/common/src/main/java/us/myles/ViaVersion/util/fastutil/WrappedIntMap.java b/common/src/main/java/us/myles/ViaVersion/util/fastutil/WrappedIntMap.java index 54c0af8cf..483a1f9d3 100644 --- a/common/src/main/java/us/myles/ViaVersion/util/fastutil/WrappedIntMap.java +++ b/common/src/main/java/us/myles/ViaVersion/util/fastutil/WrappedIntMap.java @@ -32,6 +32,12 @@ final class WrappedIntMap implements IntMap { @Override public int remove(int key) { - return map.remove(key); + Integer removed = map.remove(key); + return removed != null ? removed : -1; + } + + @Override + public Map getMap() { + return map; } }