diff --git a/connector/pom.xml b/connector/pom.xml
index 6d56fbcad..0258e9a30 100644
--- a/connector/pom.xml
+++ b/connector/pom.xml
@@ -48,6 +48,12 @@
8.1.1
compile
+
+ com.nukkitx.fastutil
+ fastutil-object-byte-maps
+ 8.3.1
+ compile
+
com.github.steveice10
opennbt
diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/block/BlockTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/block/BlockTranslator.java
index f0c474104..d38211541 100644
--- a/connector/src/main/java/org/geysermc/connector/network/translators/block/BlockTranslator.java
+++ b/connector/src/main/java/org/geysermc/connector/network/translators/block/BlockTranslator.java
@@ -35,6 +35,7 @@ import com.nukkitx.nbt.tag.ListTag;
import gnu.trove.map.TObjectIntMap;
import gnu.trove.map.hash.TObjectIntHashMap;
import it.unimi.dsi.fastutil.ints.*;
+import it.unimi.dsi.fastutil.objects.*;
import org.geysermc.connector.GeyserConnector;
import org.geysermc.connector.utils.Toolbox;
@@ -50,7 +51,7 @@ public class BlockTranslator {
private static final Int2ObjectMap BEDROCK_TO_JAVA_BLOCK_MAP = new Int2ObjectOpenHashMap<>();
private static final Map JAVA_ID_BLOCK_MAP = new HashMap<>();
private static final IntSet WATERLOGGED = new IntOpenHashSet();
- private static final Map BEDCOLORS = new HashMap<>();
+ private static final Object2ByteOpenHashMap BEDCOLORS = new Object2ByteOpenHashMap<>();
private static final Map JAVA_ID_TO_BLOCK_ENTITY_MAP = new HashMap<>();
@@ -244,7 +245,7 @@ public class BlockTranslator {
public static byte getBedColor(BlockState state) {
if (BEDCOLORS.containsKey(state)) {
- return BEDCOLORS.get(state);
+ return BEDCOLORS.getByte(state);
}
return -1;
}