aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/util
diff options
context:
space:
mode:
authorMuramasa <haydenkilloh@gmail.com>2016-08-13 08:28:24 +0100
committerMuramasa <haydenkilloh@gmail.com>2016-08-13 08:28:24 +0100
commit9ca24419fbec417937d4014ab7c21434ebd79366 (patch)
treec6a814348ac65c53ce567b5a647bb090b97e75e3 /src/main/java/gregtech/api/util
parent27f2ee906a81355c296d781c7be70faf27d9fd3a (diff)
downloadGT5-Unofficial-9ca24419fbec417937d4014ab7c21434ebd79366.tar.gz
GT5-Unofficial-9ca24419fbec417937d4014ab7c21434ebd79366.tar.bz2
GT5-Unofficial-9ca24419fbec417937d4014ab7c21434ebd79366.zip
HashMap > ConcurrentHashMap & String vars
Diffstat (limited to 'src/main/java/gregtech/api/util')
-rw-r--r--src/main/java/gregtech/api/util/GT_ModHandler.java16
-rw-r--r--src/main/java/gregtech/api/util/GT_OreDictUnificator.java5
-rw-r--r--src/main/java/gregtech/api/util/GT_Recipe.java4
-rw-r--r--src/main/java/gregtech/api/util/GT_Utility.java13
4 files changed, 19 insertions, 19 deletions
diff --git a/src/main/java/gregtech/api/util/GT_ModHandler.java b/src/main/java/gregtech/api/util/GT_ModHandler.java
index b22650df0d..00d637398d 100644
--- a/src/main/java/gregtech/api/util/GT_ModHandler.java
+++ b/src/main/java/gregtech/api/util/GT_ModHandler.java
@@ -57,12 +57,12 @@ public class GT_ModHandler {
public static Collection<String> sNativeRecipeClasses = new HashSet<String>(), sSpecialRecipeClasses = new HashSet<String>();
public static GT_HashSet<GT_ItemStack> sNonReplaceableItems = new GT_HashSet<GT_ItemStack>();
public static Object sBoxableWrapper = GT_Utility.callConstructor("gregtechmod.api.util.GT_IBoxableWrapper", 0, null, false);
- private static Map<IRecipeInput, RecipeOutput> sExtractorRecipes = new HashMap<IRecipeInput, RecipeOutput>();
- private static Map<IRecipeInput, RecipeOutput> sMaceratorRecipes = new HashMap<IRecipeInput, RecipeOutput>();
- private static Map<IRecipeInput, RecipeOutput> sCompressorRecipes = new HashMap<IRecipeInput, RecipeOutput>();
- private static Map<IRecipeInput, RecipeOutput> sOreWashingRecipes = new HashMap<IRecipeInput, RecipeOutput>();
- private static Map<IRecipeInput, RecipeOutput> sThermalCentrifugeRecipes = new HashMap<IRecipeInput, RecipeOutput>();
- private static Map<IRecipeInput, RecipeOutput> sMassfabRecipes = new HashMap<IRecipeInput, RecipeOutput>();
+ private static Map<IRecipeInput, RecipeOutput> sExtractorRecipes = new /*Concurrent*/HashMap<IRecipeInput, RecipeOutput>();
+ private static Map<IRecipeInput, RecipeOutput> sMaceratorRecipes = new /*Concurrent*/HashMap<IRecipeInput, RecipeOutput>();
+ private static Map<IRecipeInput, RecipeOutput> sCompressorRecipes = new /*Concurrent*/HashMap<IRecipeInput, RecipeOutput>();
+ private static Map<IRecipeInput, RecipeOutput> sOreWashingRecipes = new /*Concurrent*/HashMap<IRecipeInput, RecipeOutput>();
+ private static Map<IRecipeInput, RecipeOutput> sThermalCentrifugeRecipes = new /*Concurrent*/HashMap<IRecipeInput, RecipeOutput>();
+ private static Map<IRecipeInput, RecipeOutput> sMassfabRecipes = new /*Concurrent*/HashMap<IRecipeInput, RecipeOutput>();
private static boolean sBufferCraftingRecipes = true;
public static List<Integer> sSingleNonBlockDamagableRecipeList_list = new ArrayList<Integer>(100);
private static boolean sSingleNonBlockDamagableRecipeList_create = true;
@@ -921,8 +921,8 @@ public class GT_ModHandler {
if (aRecipe[idx] instanceof Boolean) {
idx++;
}
- HashMap<Character, ItemStack> tItemStackMap = new HashMap<Character, ItemStack>();
- HashMap<Character, ItemData> tItemDataMap = new HashMap<Character, ItemData>();
+ /*ConcurrentHash*/Map<Character, ItemStack> tItemStackMap = new /*ConcurrentHash*/HashMap<Character, ItemStack>();
+ /*ConcurrentHash*/Map<Character, ItemData> tItemDataMap = new /*ConcurrentHash*/HashMap<Character, ItemData>();
tItemStackMap.put(' ', null);
boolean tRemoveRecipe = true;
diff --git a/src/main/java/gregtech/api/util/GT_OreDictUnificator.java b/src/main/java/gregtech/api/util/GT_OreDictUnificator.java
index b404299fad..dddf2ec576 100644
--- a/src/main/java/gregtech/api/util/GT_OreDictUnificator.java
+++ b/src/main/java/gregtech/api/util/GT_OreDictUnificator.java
@@ -15,6 +15,7 @@ import net.minecraftforge.oredict.OreDictionary;
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.Map;
import java.util.Map.Entry;
import static gregtech.api.enums.GT_Values.*;
@@ -29,8 +30,8 @@ import static gregtech.api.enums.GT_Values.*;
* P.S. It is intended to be named "Unificator" and not "Unifier", because that sounds more awesome.
*/
public class GT_OreDictUnificator {
- private static final HashMap<String, ItemStack> sName2StackMap = new HashMap<String, ItemStack>();
- private static final HashMap<GT_ItemStack, ItemData> sItemStack2DataMap = new HashMap<GT_ItemStack, ItemData>();
+ private static final /*ConcurrentHash*/Map<String, ItemStack> sName2StackMap = new /*ConcurrentHash*/HashMap<String, ItemStack>();
+ private static final /*ConcurrentHash*/Map<GT_ItemStack, ItemData> sItemStack2DataMap = new /*ConcurrentHash*/HashMap<GT_ItemStack, ItemData>();
private static final GT_HashSet<GT_ItemStack> sNoUnificationList = new GT_HashSet<GT_ItemStack>();
public static volatile int VERSION = 509;
private static int isRegisteringOre = 0, isAddingOre = 0;
diff --git a/src/main/java/gregtech/api/util/GT_Recipe.java b/src/main/java/gregtech/api/util/GT_Recipe.java
index 222da31402..079fa29fdc 100644
--- a/src/main/java/gregtech/api/util/GT_Recipe.java
+++ b/src/main/java/gregtech/api/util/GT_Recipe.java
@@ -512,11 +512,11 @@ public class GT_Recipe {
/**
* HashMap of Recipes based on their Items
*/
- public final Map<GT_ItemStack, Collection<GT_Recipe>> mRecipeItemMap = new HashMap<GT_ItemStack, Collection<GT_Recipe>>();
+ public final Map<GT_ItemStack, Collection<GT_Recipe>> mRecipeItemMap = new /*Concurrent*/HashMap<GT_ItemStack, Collection<GT_Recipe>>();
/**
* HashMap of Recipes based on their Fluids
*/
- public final Map<Fluid, Collection<GT_Recipe>> mRecipeFluidMap = new HashMap<Fluid, Collection<GT_Recipe>>();
+ public final Map<Fluid, Collection<GT_Recipe>> mRecipeFluidMap = new /*Concurrent*/HashMap<Fluid, Collection<GT_Recipe>>();
/**
* The List of all Recipes
*/
diff --git a/src/main/java/gregtech/api/util/GT_Utility.java b/src/main/java/gregtech/api/util/GT_Utility.java
index 29c5ab2c8b..29a454bcde 100644
--- a/src/main/java/gregtech/api/util/GT_Utility.java
+++ b/src/main/java/gregtech/api/util/GT_Utility.java
@@ -20,7 +20,6 @@ import gregtech.api.objects.GT_ItemStack;
import gregtech.api.objects.ItemData;
import gregtech.api.threads.GT_Runnable_Sound;
import gregtech.common.GT_Proxy;
-import ic2.api.recipe.ICannerBottleRecipeManager;
import ic2.api.recipe.IRecipeInput;
import ic2.api.recipe.RecipeInputItemStack;
import ic2.api.recipe.RecipeInputOreDict;
@@ -83,11 +82,11 @@ public class GT_Utility {
* Forge screwed the Fluid Registry up again, so I make my own, which is also much more efficient than the stupid Stuff over there.
*/
private static final List<FluidContainerData> sFluidContainerList = new ArrayList<FluidContainerData>();
- private static final Map<GT_ItemStack, FluidContainerData> sFilledContainerToData = new HashMap<GT_ItemStack, FluidContainerData>();
- private static final Map<GT_ItemStack, Map<Fluid, FluidContainerData>> sEmptyContainerToFluidToData = new HashMap<GT_ItemStack, Map<Fluid, FluidContainerData>>();
+ private static final Map<GT_ItemStack, FluidContainerData> sFilledContainerToData = new /*Concurrent*/HashMap<GT_ItemStack, FluidContainerData>();
+ private static final Map<GT_ItemStack, Map<Fluid, FluidContainerData>> sEmptyContainerToFluidToData = new /*Concurrent*/HashMap<GT_ItemStack, Map<Fluid, FluidContainerData>>();
public static volatile int VERSION = 509;
public static boolean TE_CHECK = false, BC_CHECK = false, CHECK_ALL = true, RF_CHECK = false;
- public static Map<GT_PlayedSound, Integer> sPlayedSoundMap = new HashMap<GT_PlayedSound, Integer>();
+ public static Map<GT_PlayedSound, Integer> sPlayedSoundMap = new /*Concurrent*/HashMap<GT_PlayedSound, Integer>();
private static int sBookCount = 0;
static {
@@ -698,7 +697,7 @@ public class GT_Utility {
sFilledContainerToData.put(new GT_ItemStack(tData.filledContainer), tData);
Map<Fluid, FluidContainerData> tFluidToContainer = sEmptyContainerToFluidToData.get(new GT_ItemStack(tData.emptyContainer));
if (tFluidToContainer == null) {
- sEmptyContainerToFluidToData.put(new GT_ItemStack(tData.emptyContainer), tFluidToContainer = new HashMap<Fluid, FluidContainerData>());
+ sEmptyContainerToFluidToData.put(new GT_ItemStack(tData.emptyContainer), tFluidToContainer = new /*Concurrent*/HashMap<Fluid, FluidContainerData>());
GregTech_API.sFluidMappings.add(tFluidToContainer);
}
tFluidToContainer.put(tData.fluid.getFluid(), tData);
@@ -710,7 +709,7 @@ public class GT_Utility {
sFilledContainerToData.put(new GT_ItemStack(aData.filledContainer), aData);
Map<Fluid, FluidContainerData> tFluidToContainer = sEmptyContainerToFluidToData.get(new GT_ItemStack(aData.emptyContainer));
if (tFluidToContainer == null) {
- sEmptyContainerToFluidToData.put(new GT_ItemStack(aData.emptyContainer), tFluidToContainer = new HashMap<Fluid, FluidContainerData>());
+ sEmptyContainerToFluidToData.put(new GT_ItemStack(aData.emptyContainer), tFluidToContainer = new /*Concurrent*/HashMap<Fluid, FluidContainerData>());
GregTech_API.sFluidMappings.add(tFluidToContainer);
}
tFluidToContainer.put(aData.fluid.getFluid(), aData);
@@ -1379,7 +1378,7 @@ public class GT_Utility {
* re-maps all Keys of a Map after the Keys were weakened.
*/
public static <X, Y> Map<X, Y> reMap(Map<X, Y> aMap) {
- Map<X, Y> tMap = new HashMap<X, Y>();
+ Map<X, Y> tMap = new /*Concurrent*/HashMap<X, Y>();
tMap.putAll(aMap);
aMap.clear();
aMap.putAll(tMap);