Don't use netty collections

This commit is contained in:
creeper123123321 2019-01-15 13:37:04 -02:00
parent fa1b56a7cf
commit 1325d53950
No known key found for this signature in database
GPG Key ID: 0AC57D54786721D1

View File

@ -14,18 +14,13 @@ public class BlockConnectionStorage extends StoredObject {
private static Class<?> fastUtilLongObjectHashMap;
private static Class<?> fastUtilShortShortHashMap;
private static Class<?> nettyLongObjectHashMap;
static {
try {
fastUtilLongObjectHashMap = Class.forName("it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap");
Via.getPlatform().getLogger().info("Using FastUtil Long2ObjectOpenHashMap for block connections");
} catch (ClassNotFoundException ignored) {
try {
nettyLongObjectHashMap = Class.forName("io.netty.util.collection.LongObjectHashMap");
Via.getPlatform().getLogger().info("Using Netty LongObjectHashMap for block connections");
} catch (ClassNotFoundException ignored2) {
}
}
try {
fastUtilShortShortHashMap = Class.forName("it.unimi.dsi.fastutil.shorts.Short2ShortOpenHashMap");
@ -101,13 +96,6 @@ public class BlockConnectionStorage extends StoredObject {
e.printStackTrace();
}
}
if (nettyLongObjectHashMap != null) {
try {
return (Map<Long, T>) nettyLongObjectHashMap.getConstructor().newInstance();
} catch (IllegalAccessException | InstantiationException | InvocationTargetException | NoSuchMethodException e) {
e.printStackTrace();
}
}
return new HashMap<>();
}