Fix it again

This commit is contained in:
Muramasa 2016-09-16 12:17:19 +01:00
commit 312141cd10
3 changed files with 27 additions and 30 deletions

View file

@ -8,26 +8,26 @@ import java.util.*;
public class GT_HashSet<E extends GT_ItemStack> extends AbstractSet<E> {
private static final Object OBJECT = new Object();
private transient Map<GT_ItemStack, Object> map;
private transient HashMap<GT_ItemStack, Object> map;
public GT_HashSet() {
map = new WeakHashMap<GT_ItemStack, Object>();
map = new HashMap<GT_ItemStack, Object>();
GregTech_API.sItemStackMappings.add(map);
}
public GT_HashSet(Collection<? extends E> c) {
map = new WeakHashMap<GT_ItemStack, Object>(Math.max((int) (c.size() / .75f) + 1, 16));
map = new HashMap<GT_ItemStack, Object>(Math.max((int) (c.size() / .75f) + 1, 16));
addAll(c);
GregTech_API.sItemStackMappings.add(map);
}
public GT_HashSet(int initialCapacity, float loadFactor) {
map = new WeakHashMap<GT_ItemStack, Object>(initialCapacity, loadFactor);
map = new HashMap<GT_ItemStack, Object>(initialCapacity, loadFactor);
GregTech_API.sItemStackMappings.add(map);
}
public GT_HashSet(int initialCapacity) {
map = new WeakHashMap<GT_ItemStack, Object>(initialCapacity);
map = new HashMap<GT_ItemStack, Object>(initialCapacity);
GregTech_API.sItemStackMappings.add(map);
}
@ -36,7 +36,7 @@ public class GT_HashSet<E extends GT_ItemStack> extends AbstractSet<E> {
GregTech_API.sItemStackMappings.add(map);
}
public final Map getMap() {
public HashMap getMap() {
return map;
}

View file

@ -16,6 +16,7 @@ import net.minecraftforge.fluids.FluidStack;
public class GT_RecipeAdder
implements IGT_RecipeAdder {
@Deprecated
public boolean addFusionReactorRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt, int aStartEU) {
return false;
}
@ -25,6 +26,9 @@ public class GT_RecipeAdder
if (aInput1 == null || aInput2 == null || aOutput1 == null || aDuration < 1 || aEUt < 1 || aStartEU < 1) {
return false;
}
if ((aOutput1 != null) && ((aDuration = GregTech_API.sRecipeFile.get("fusion", aOutput1.getFluid().getName(), aDuration)) <= 0)) {
return false;
}
GT_Recipe.GT_Recipe_Map.sFusionRecipes.addRecipe(null, new FluidStack[]{aInput1, aInput2}, new FluidStack[]{aOutput1}, aDuration, aEUt, aStartEU);
return true;
}

View file

@ -191,31 +191,24 @@ public class GT_ThaumcraftCompat
return ThaumcraftApi.addInfusionCraftingRecipe(aResearch, GT_Utility.copy(new Object[]{aOutput}), aInstability, getAspectList(aAspects), aMainInput, aSideInputs);
}
public boolean registerThaumcraftAspectsToItem(ItemStack aExampleStack, List<TC_Aspects.TC_AspectStack> aAspects, String aOreDict) {
if (aAspects.isEmpty()) {
return false;
}
AspectList tAlreadyRegisteredAspects = ThaumcraftApiHelper.getObjectAspects(aExampleStack);
if ((tAlreadyRegisteredAspects == null) || (tAlreadyRegisteredAspects.size() <= 0)) {
ThaumcraftApi.registerObjectTag(aOreDict, getAspectList(aAspects));
}
return true;
}
public boolean registerThaumcraftAspectsToItem(ItemStack aExampleStack, List<TC_Aspects.TC_AspectStack> aAspects, String aOreDict) {
if (aAspects.isEmpty()) return false;
ThaumcraftApi.registerObjectTag(aOreDict, (AspectList)getAspectList(aAspects));
return true;
}
public boolean registerThaumcraftAspectsToItem(ItemStack aStack, List<TC_Aspects.TC_AspectStack> aAspects, boolean aAdditive) {
if (aAspects.isEmpty()) {
return false;
}
if (aAdditive) {
ThaumcraftApi.registerComplexObjectTag(aStack, getAspectList(aAspects));
return true;
}
AspectList tAlreadyRegisteredAspects = ThaumcraftApiHelper.getObjectAspects(aStack);
if ((tAlreadyRegisteredAspects == null) || (tAlreadyRegisteredAspects.size() <= 0)) {
ThaumcraftApi.registerObjectTag(aStack, getAspectList(aAspects));
}
return true;
}
public boolean registerThaumcraftAspectsToItem(ItemStack aStack, List<TC_Aspects.TC_AspectStack> aAspects, boolean aAdditive) {
if (aAspects.isEmpty()) return false;
if (aAdditive) {
ThaumcraftApi.registerComplexObjectTag(aStack, (AspectList)getAspectList(aAspects));
return true;
}
AspectList tAlreadyRegisteredAspects = ThaumcraftApiHelper.getObjectAspects(aStack);
if (tAlreadyRegisteredAspects == null || tAlreadyRegisteredAspects.size() <= 0) {
ThaumcraftApi.registerObjectTag(aStack, (AspectList)getAspectList(aAspects));
}
return true;
}
public boolean registerPortholeBlacklistedBlock(Block aBlock) {
ThaumcraftApi.portableHoleBlackList.add(aBlock);