From 8de26a0ad33f5b739f5394ed80f69d14197fddc7 Mon Sep 17 00:00:00 2001 From: KennyTV Date: Mon, 23 Nov 2020 20:49:28 +0100 Subject: [PATCH] Work around relocation of fastutil reflection call --- .../protocol1_13to1_12_2/storage/BlockConnectionStorage.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/storage/BlockConnectionStorage.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/storage/BlockConnectionStorage.java index 22eeba912..31dee69e6 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/storage/BlockConnectionStorage.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/storage/BlockConnectionStorage.java @@ -23,7 +23,9 @@ public class BlockConnectionStorage extends StoredObject { static { try { - fastUtilLongObjectHashMap = Class.forName("it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap").getConstructor(); + //noinspection StringBufferReplaceableByString - prevent relocation + String className = new StringBuilder("it").append(".unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap").toString(); + fastUtilLongObjectHashMap = Class.forName(className).getConstructor(); Via.getPlatform().getLogger().info("Using FastUtil Long2ObjectOpenHashMap for block connections"); } catch (ClassNotFoundException | NoSuchMethodException ignored) { }