Merge remote-tracking branch 'refs/remotes/Blood-Asp/experimental' into Exp

This commit is contained in:
Muramasa 2016-09-16 12:06:01 +01:00
commit 491925bc59
4 changed files with 35 additions and 38 deletions

View file

@ -8,26 +8,26 @@ import java.util.*;
public class GT_HashSet<E extends GT_ItemStack> extends AbstractSet<E> { public class GT_HashSet<E extends GT_ItemStack> extends AbstractSet<E> {
private static final Object OBJECT = new Object(); private static final Object OBJECT = new Object();
private transient Map<GT_ItemStack, Object> map; private transient HashMap<GT_ItemStack, Object> map;
public GT_HashSet() { public GT_HashSet() {
map = new WeakHashMap<GT_ItemStack, Object>(); map = new HashMap<GT_ItemStack, Object>();
GregTech_API.sItemStackMappings.add(map); GregTech_API.sItemStackMappings.add(map);
} }
public GT_HashSet(Collection<? extends E> c) { 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); addAll(c);
GregTech_API.sItemStackMappings.add(map); GregTech_API.sItemStackMappings.add(map);
} }
public GT_HashSet(int initialCapacity, float loadFactor) { 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); GregTech_API.sItemStackMappings.add(map);
} }
public GT_HashSet(int initialCapacity) { public GT_HashSet(int initialCapacity) {
map = new WeakHashMap<GT_ItemStack, Object>(initialCapacity); map = new HashMap<GT_ItemStack, Object>(initialCapacity);
GregTech_API.sItemStackMappings.add(map); 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); GregTech_API.sItemStackMappings.add(map);
} }
public final Map getMap() { public HashMap getMap() {
return map; return map;
} }

View file

@ -16,6 +16,7 @@ import net.minecraftforge.fluids.FluidStack;
public class GT_RecipeAdder public class GT_RecipeAdder
implements IGT_RecipeAdder { implements IGT_RecipeAdder {
@Deprecated
public boolean addFusionReactorRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt, int aStartEU) { public boolean addFusionReactorRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt, int aStartEU) {
return false; return false;
} }
@ -25,6 +26,9 @@ public class GT_RecipeAdder
if (aInput1 == null || aInput2 == null || aOutput1 == null || aDuration < 1 || aEUt < 1 || aStartEU < 1) { if (aInput1 == null || aInput2 == null || aOutput1 == null || aDuration < 1 || aEUt < 1 || aStartEU < 1) {
return false; 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); GT_Recipe.GT_Recipe_Map.sFusionRecipes.addRecipe(null, new FluidStack[]{aInput1, aInput2}, new FluidStack[]{aOutput1}, aDuration, aEUt, aStartEU);
return true; return true;
} }

View file

@ -192,27 +192,20 @@ public class GT_ThaumcraftCompat
} }
public boolean registerThaumcraftAspectsToItem(ItemStack aExampleStack, List<TC_Aspects.TC_AspectStack> aAspects, String aOreDict) { public boolean registerThaumcraftAspectsToItem(ItemStack aExampleStack, List<TC_Aspects.TC_AspectStack> aAspects, String aOreDict) {
if (aAspects.isEmpty()) { if (aAspects.isEmpty()) return false;
return false; ThaumcraftApi.registerObjectTag(aOreDict, (AspectList)getAspectList(aAspects));
}
AspectList tAlreadyRegisteredAspects = ThaumcraftApiHelper.getObjectAspects(aExampleStack);
if ((tAlreadyRegisteredAspects == null) || (tAlreadyRegisteredAspects.size() <= 0)) {
ThaumcraftApi.registerObjectTag(aOreDict, getAspectList(aAspects));
}
return true; return true;
} }
public boolean registerThaumcraftAspectsToItem(ItemStack aStack, List<TC_Aspects.TC_AspectStack> aAspects, boolean aAdditive) { public boolean registerThaumcraftAspectsToItem(ItemStack aStack, List<TC_Aspects.TC_AspectStack> aAspects, boolean aAdditive) {
if (aAspects.isEmpty()) { if (aAspects.isEmpty()) return false;
return false;
}
if (aAdditive) { if (aAdditive) {
ThaumcraftApi.registerComplexObjectTag(aStack, getAspectList(aAspects)); ThaumcraftApi.registerComplexObjectTag(aStack, (AspectList)getAspectList(aAspects));
return true; return true;
} }
AspectList tAlreadyRegisteredAspects = ThaumcraftApiHelper.getObjectAspects(aStack); AspectList tAlreadyRegisteredAspects = ThaumcraftApiHelper.getObjectAspects(aStack);
if ((tAlreadyRegisteredAspects == null) || (tAlreadyRegisteredAspects.size() <= 0)) { if (tAlreadyRegisteredAspects == null || tAlreadyRegisteredAspects.size() <= 0) {
ThaumcraftApi.registerObjectTag(aStack, getAspectList(aAspects)); ThaumcraftApi.registerObjectTag(aStack, (AspectList)getAspectList(aAspects));
} }
return true; return true;
} }

View file

@ -50,21 +50,21 @@ public class GT_Item_Machines
int i = 0; int i = 0;
for (String tDescription : tTileEntity.getDescription()) { for (String tDescription : tTileEntity.getDescription()) {
if (GT_Utility.isStringValid(tDescription)) { if (GT_Utility.isStringValid(tDescription)) {
aList.add(GT_LanguageManager.addStringLocalization("TileEntity_DESCRIPTION_" + tDamage + "_Index_" + i++, tDescription )); aList.add(GT_LanguageManager.addStringLocalization("TileEntity_DESCRIPTION_" + tDamage + "_Index_" + i++, tDescription, !GregTech_API.sPostloadFinished ));
} }
} }
} }
if (tTileEntity.getEUCapacity() > 0L) { if (tTileEntity.getEUCapacity() > 0L) {
if (tTileEntity.getInputVoltage() > 0L) { if (tTileEntity.getInputVoltage() > 0L) {
aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_IN", "Voltage IN: " ) + EnumChatFormatting.GREEN + tTileEntity.getInputVoltage() + " (" + GT_Values.VN[GT_Utility.getTier(tTileEntity.getInputVoltage())] + ")" + EnumChatFormatting.GRAY); aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_IN", "Voltage IN: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.GREEN + tTileEntity.getInputVoltage() + " (" + GT_Values.VN[GT_Utility.getTier(tTileEntity.getInputVoltage())] + ")" + EnumChatFormatting.GRAY);
} }
if (tTileEntity.getOutputVoltage() > 0L) { if (tTileEntity.getOutputVoltage() > 0L) {
aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_OUT", "Voltage OUT: " ) + EnumChatFormatting.GREEN + tTileEntity.getOutputVoltage() + " (" + GT_Values.VN[GT_Utility.getTier(tTileEntity.getOutputVoltage())] + ")" + EnumChatFormatting.GRAY); aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_OUT", "Voltage OUT: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.GREEN + tTileEntity.getOutputVoltage() + " (" + GT_Values.VN[GT_Utility.getTier(tTileEntity.getOutputVoltage())] + ")" + EnumChatFormatting.GRAY);
} }
if (tTileEntity.getOutputAmperage() > 1L) { if (tTileEntity.getOutputAmperage() > 1L) {
aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_AMOUNT", "Amperage: " ) + EnumChatFormatting.YELLOW + tTileEntity.getOutputAmperage() + EnumChatFormatting.GRAY); aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_AMOUNT", "Amperage: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.YELLOW + tTileEntity.getOutputAmperage() + EnumChatFormatting.GRAY);
} }
aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_STORE", "Capacity: " ) + EnumChatFormatting.BLUE + tTileEntity.getEUCapacity() + EnumChatFormatting.GRAY); aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_STORE", "Capacity: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.BLUE + tTileEntity.getEUCapacity() + EnumChatFormatting.GRAY);
} }
} }
} }
@ -72,14 +72,14 @@ public class GT_Item_Machines
NBTTagCompound aNBT = aStack.getTagCompound(); NBTTagCompound aNBT = aStack.getTagCompound();
if (aNBT != null) { if (aNBT != null) {
if (aNBT.getBoolean("mMuffler")) { if (aNBT.getBoolean("mMuffler")) {
aList.add(GT_LanguageManager.addStringLocalization("GT_TileEntity_MUFFLER", "has Muffler Upgrade" )); aList.add(GT_LanguageManager.addStringLocalization("GT_TileEntity_MUFFLER", "has Muffler Upgrade", !GregTech_API.sPostloadFinished ));
} }
if (aNBT.getBoolean("mSteamConverter")) { if (aNBT.getBoolean("mSteamConverter")) {
aList.add(GT_LanguageManager.addStringLocalization("GT_TileEntity_STEAMCONVERTER", "has Steam Upgrade" )); aList.add(GT_LanguageManager.addStringLocalization("GT_TileEntity_STEAMCONVERTER", "has Steam Upgrade", !GregTech_API.sPostloadFinished ));
} }
int tAmount = 0; int tAmount = 0;
if ((tAmount = aNBT.getByte("mSteamTanks")) > 0) { if ((tAmount = aNBT.getByte("mSteamTanks")) > 0) {
aList.add(tAmount + " " + GT_LanguageManager.addStringLocalization("GT_TileEntity_STEAMTANKS", "Steam Tank Upgrades" )); aList.add(tAmount + " " + GT_LanguageManager.addStringLocalization("GT_TileEntity_STEAMTANKS", "Steam Tank Upgrades", !GregTech_API.sPostloadFinished ));
} }
} }
} catch (Throwable e) { } catch (Throwable e) {