Move to proper FU usage

This commit is contained in:
KennyTV 2020-06-09 08:13:52 +02:00
parent 6de1ba9f30
commit e3faa0d77d
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B
2 changed files with 7 additions and 5 deletions

View File

@ -20,6 +20,8 @@ import us.myles.ViaVersion.api.data.MappingDataLoader;
import us.myles.ViaVersion.api.data.Mappings; import us.myles.ViaVersion.api.data.Mappings;
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.data.MappingData; import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.data.MappingData;
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.data.StatisticMappings; import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.data.StatisticMappings;
import us.myles.viaversion.libs.fastutil.ints.Int2ObjectMap;
import us.myles.viaversion.libs.fastutil.ints.Int2ObjectOpenHashMap;
import us.myles.viaversion.libs.gson.JsonElement; import us.myles.viaversion.libs.gson.JsonElement;
import us.myles.viaversion.libs.gson.JsonObject; import us.myles.viaversion.libs.gson.JsonObject;
import us.myles.viaversion.libs.gson.JsonPrimitive; import us.myles.viaversion.libs.gson.JsonPrimitive;
@ -29,7 +31,7 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
public class BackwardsMappings { public class BackwardsMappings {
public static final Map<Integer, String> statisticMappings = new HashMap<>(); public static final Int2ObjectMap<String> statisticMappings = new Int2ObjectOpenHashMap<>();
public static final Map<String, String> translateMappings = new HashMap<>(); public static final Map<String, String> translateMappings = new HashMap<>();
public static BlockMappingsShortArray blockMappings; public static BlockMappingsShortArray blockMappings;
public static VBSoundMappings soundMappings; public static VBSoundMappings soundMappings;
@ -48,7 +50,7 @@ public class BackwardsMappings {
enchantmentMappings = new VBMappings(mapping1_13.getAsJsonObject("enchantments"), mapping1_12.getAsJsonObject("enchantments"), false); enchantmentMappings = new VBMappings(mapping1_13.getAsJsonObject("enchantments"), mapping1_12.getAsJsonObject("enchantments"), false);
for (Map.Entry<String, Integer> entry : StatisticMappings.statistics.entrySet()) { for (Map.Entry<String, Integer> entry : StatisticMappings.statistics.entrySet()) {
statisticMappings.put(entry.getValue(), entry.getKey()); statisticMappings.put(entry.getValue().intValue(), entry.getKey());
} }
for (Map.Entry<String, String> entry : MappingData.translateMapping.entrySet()) { for (Map.Entry<String, String> entry : MappingData.translateMapping.entrySet()) {
translateMappings.put(entry.getValue(), entry.getKey()); translateMappings.put(entry.getValue(), entry.getKey());

View File

@ -1,10 +1,10 @@
package nl.matsv.viabackwards.protocol.protocol1_12_2to1_13.data; package nl.matsv.viabackwards.protocol.protocol1_12_2to1_13.data;
import java.util.HashMap; import us.myles.viaversion.libs.fastutil.ints.Int2ObjectMap;
import java.util.Map; import us.myles.viaversion.libs.fastutil.ints.Int2ObjectOpenHashMap;
public class PaintingMapping { public class PaintingMapping {
private static final Map<Integer, String> PAINTINGS = new HashMap<>(); private static final Int2ObjectMap<String> PAINTINGS = new Int2ObjectOpenHashMap<>(26, 1F);
public static void init() { public static void init() {
add("Kebab"); add("Kebab");