From ab5599e8f305163757fae22626969e1a7cd2bfa6 Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 2 Aug 2018 09:07:01 +1000 Subject: [PATCH] Pre size legacy hash tables --- .../org/bukkit/craftbukkit/util/CraftLegacy.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftLegacy.java b/src/main/java/org/bukkit/craftbukkit/util/CraftLegacy.java index 781fd65b18..3a92ac942f 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftLegacy.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftLegacy.java @@ -42,12 +42,12 @@ public class CraftLegacy { private static final Map SPAWN_EGGS = new HashMap<>(); private static final Set whitelistedStates = new HashSet<>(Arrays.asList("explode", "check_decay", "decayable")); - private static final Map materialToItem = new HashMap<>(); - private static final Map itemToMaterial = new HashMap<>(); - private static final Map materialToData = new HashMap<>(); - private static final Map dataToMaterial = new HashMap<>(); - private static final Map materialToBlock = new HashMap<>(); - private static final Map blockToMaterial = new HashMap<>(); + private static final Map materialToItem = new HashMap<>(16384); + private static final Map itemToMaterial = new HashMap<>(1024); + private static final Map materialToData = new HashMap<>(4096); + private static final Map dataToMaterial = new HashMap<>(4096); + private static final Map materialToBlock = new HashMap<>(4096); + private static final Map blockToMaterial = new HashMap<>(1024); public static Material toLegacy(Material material) { if (material == null || material.isLegacy()) { @@ -400,4 +400,8 @@ public class CraftLegacy { } } } + + public static void main(String[] args) { + System.err.println(""); + } }