aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/gregtech/GT_Mod.java10
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java2
-rw-r--r--src/main/java/gregtech/api/util/GT_ModHandler.java161
-rw-r--r--src/main/java/gregtech/api/util/GT_RecipeRegistrator.java73
-rw-r--r--src/main/java/gregtech/api/util/GT_Utility.java138
-rw-r--r--src/main/java/gregtech/common/blocks/GT_Block_Ores.java7
-rw-r--r--src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java62
-rw-r--r--src/main/java/gregtech/common/blocks/GT_Block_Ores_UB1.java4
-rw-r--r--src/main/java/gregtech/common/blocks/GT_Block_Ores_UB2.java4
-rw-r--r--src/main/java/gregtech/common/blocks/GT_Block_Ores_UB3.java6
-rw-r--r--src/main/java/gregtech/common/blocks/GT_TileEntity_Ores.java2
-rw-r--r--src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java6
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java7
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java14
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DieselEngine.java1
-rw-r--r--src/main/java/gregtech/common/tools/GT_Tool_File.java2
-rw-r--r--src/main/java/gregtech/common/tools/GT_Tool_Plunger.java2
-rw-r--r--src/main/java/gregtech/common/tools/GT_Tool_SoftHammer.java2
-rw-r--r--src/main/java/gregtech/loaders/oreprocessing/ProcessingIngot1.java1
-rw-r--r--src/main/java/gregtech/loaders/oreprocessing/ProcessingOre.java32
-rw-r--r--src/main/java/gregtech/loaders/postload/GT_CraftingRecipeLoader.java8
-rw-r--r--src/main/java/gregtech/loaders/postload/GT_Worldgenloader.java20
22 files changed, 231 insertions, 333 deletions
diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java
index bca9719839..353ed3424a 100644
--- a/src/main/java/gregtech/GT_Mod.java
+++ b/src/main/java/gregtech/GT_Mod.java
@@ -78,15 +78,15 @@ public class GT_Mod implements IGT_Mod {
public GT_Mod() {
try {
- Class.forName("ic2.core.IC2").getField("enableOreDictCircuit").set(null, Boolean.valueOf(true));
+ Class.forName("ic2.core.IC2").getField("enableOreDictCircuit").set(null, Boolean.FALSE);
} catch (Throwable e) {
}
try {
- Class.forName("ic2.core.IC2").getField("enableCraftingBucket").set(null, Boolean.valueOf(false));
+ Class.forName("ic2.core.IC2").getField("enableCraftingBucket").set(null, Boolean.FALSE);
} catch (Throwable e) {
}
try {
- Class.forName("ic2.core.IC2").getField("enableEnergyInStorageBlockItems").set(null, Boolean.valueOf(false));
+ Class.forName("ic2.core.IC2").getField("enableEnergyInStorageBlockItems").set(null, Boolean.FALSE);
} catch (Throwable e) {
}
GT_Values.GT = this;
@@ -100,6 +100,7 @@ public class GT_Mod implements IGT_Mod {
@Mod.EventHandler
public void onPreLoad(FMLPreInitializationEvent aEvent) {
+ Locale.setDefault(Locale.ENGLISH);
if (GregTech_API.sPreloadStarted) {
return;
}
@@ -450,7 +451,7 @@ public class GT_Mod implements IGT_Mod {
GT_Log.out.println("GT_Mod: List of Lists of Tool Recipes: "+GT_ModHandler.sSingleNonBlockDamagableRecipeList_list.toString());
GT_Log.out.println("GT_Mod: Vanilla Recipe List -> Outputs null or stackSize <=0: " + GT_ModHandler.sVanillaRecipeList_warntOutput.toString());
GT_Log.out.println("GT_Mod: Single Non Block Damagable Recipe List -> Outputs null or stackSize <=0: " + GT_ModHandler.sSingleNonBlockDamagableRecipeList_warntOutput.toString());
- GT_Log.out.println("GT_Mod: sRodMaterialList cycles: " + GT_RecipeRegistrator.sRodMaterialList_cycles);
+ //GT_Log.out.println("GT_Mod: sRodMaterialList cycles: " + GT_RecipeRegistrator.sRodMaterialList_cycles);
if (GT_Values.D1) {
IRecipe tRecipe;
for (Iterator i$ = GT_ModHandler.sSingleNonBlockDamagableRecipeList.iterator(); i$.hasNext(); GT_Log.out.println("=> " + tRecipe.getRecipeOutput().getDisplayName())) {
@@ -683,7 +684,6 @@ public class GT_Mod implements IGT_Mod {
}
achievements = new GT_Achievements();
- Map.Entry<IRecipeInput, RecipeOutput> tRecipe;
GT_Log.out.println("GT_Mod: Loading finished, deallocating temporary Init Variables.");
GregTech_API.sBeforeGTPreload = null;
GregTech_API.sAfterGTPreload = null;
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java
index 0a3ee8d5ce..e08ae2fb1a 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaPipeEntity_Item.java
@@ -210,7 +210,7 @@ public class GT_MetaPipeEntity_Item extends MetaPipeEntity implements IMetaTileE
tPipeList.add(tTileEntity);
while (!temp && !isInventoryEmpty() && tTileEntity.sendItemStack(aBaseMetaTileEntity))
for (IMetaTileEntityItemPipe tPipe : tPipeList)
- if (!tPipe.incrementTransferCounter(1)) temp = true;
+ if (!tPipe.incrementTransferCounter(1)) temp = false;
}
}
}
diff --git a/src/main/java/gregtech/api/util/GT_ModHandler.java b/src/main/java/gregtech/api/util/GT_ModHandler.java
index 30b996a57b..4822c0bef5 100644
--- a/src/main/java/gregtech/api/util/GT_ModHandler.java
+++ b/src/main/java/gregtech/api/util/GT_ModHandler.java
@@ -1228,12 +1228,11 @@ public class GT_ModHandler {
sAllRecipeList.clear();
sAllRecipeList.addAll(tList);
}
- int sAllRecipeList_sS=sAllRecipeList.size();
- for (int i = 0, j = sAllRecipeList_sS; i < j; i++) {
+ for (int i = 0, j = sAllRecipeList.size(); i < j; i++) {
IRecipe tRecipe = sAllRecipeList.get(i);
if (tRecipe.matches(aCrafting, aWorld)) {
if (i > 10) {
- sAllRecipeList.remove(i); sAllRecipeList_sS=sAllRecipeList.size();
+ sAllRecipeList.remove(i);
sAllRecipeList.add(i - 10, tRecipe);
}
return tRecipe.getCraftingResult(aCrafting);
@@ -1293,23 +1292,25 @@ public class GT_ModHandler {
}, 3, 3);
for (int i = 0; i < 9 && i < aRecipe.length; i++) aCrafting.setInventorySlotContents(i, aRecipe[i]);
ArrayList<IRecipe> tList = (ArrayList<IRecipe>) CraftingManager.getInstance().getRecipeList();
- int tList_sS=tList.size();
- try {
- for (int i = 0; i < tList_sS; i++) {
- temp = false;
+ for (int i = 0; i < tList.size(); i++) {
+ temp = false;
+ try {
temp = tList.get(i).matches(aCrafting, DW);
- if (temp) {
- ItemStack tOutput = aUncopiedStack ? tList.get(i).getRecipeOutput() : tList.get(i).getCraftingResult(aCrafting);
- if (tOutput == null || tOutput.stackSize <= 0) {
- // Seriously, who would ever do that shit?
- if (!GregTech_API.sPostloadFinished)
- throw new GT_ItsNotMyFaultException("Seems another Mod added a Crafting Recipe with null Output. Tell the Developer of said Mod to fix that.");
- } else {
- if (aUncopiedStack) return tOutput;
- return GT_Utility.copy(tOutput);
- }
+ } catch (Throwable e) {
+ e.printStackTrace(GT_Log.err);
+ }
+ if (temp) {
+ ItemStack tOutput = aUncopiedStack ? tList.get(i).getRecipeOutput() : tList.get(i).getCraftingResult(aCrafting);
+ if (tOutput == null || tOutput.stackSize <= 0) {
+ // Seriously, who would ever do that shit?
+ if (!GregTech_API.sPostloadFinished)
+ throw new GT_ItsNotMyFaultException("Seems another Mod added a Crafting Recipe with null Output. Tell the Developer of said Mod to fix that.");
+ } else {
+ if (aUncopiedStack) return tOutput;
+ return GT_Utility.copy(tOutput);
}
- }} catch (Throwable e) {e.printStackTrace(GT_Log.err);}
+ }
+ }
return null;
}
@@ -1319,69 +1320,47 @@ public class GT_ModHandler {
* This also removes old Recipes from the List.
*/
public static ArrayList<ItemStack> getVanillyToolRecipeOutputs(ItemStack... aRecipe) {
- ArrayList<ItemStack> rList = new ArrayList<ItemStack>();
- if (aRecipe == null) {return rList;}
- if (!GregTech_API.sPostloadStarted || GregTech_API.sPostloadFinished) {
- sSingleNonBlockDamagableRecipeList.clear();sSingleNonBlockDamagableRecipeList_create = true;sSingleNonBlockDamagableRecipeList_validsShapes1.clear();}
- if (sSingleNonBlockDamagableRecipeList_create/*sSingleNonBlockDamagableRecipeList.isEmpty()*/) {
+ if (!GregTech_API.sPostloadStarted || GregTech_API.sPostloadFinished)
+ sSingleNonBlockDamagableRecipeList.clear();
+ if (sSingleNonBlockDamagableRecipeList.isEmpty()) {
for (IRecipe tRecipe : (ArrayList<IRecipe>) CraftingManager.getInstance().getRecipeList()) {
ItemStack tStack = tRecipe.getRecipeOutput();
if (GT_Utility.isStackValid(tStack) && tStack.getMaxStackSize() == 1 && tStack.getMaxDamage() > 0 && !(tStack.getItem() instanceof ItemBlock) && !(tStack.getItem() instanceof IReactorComponent) && !isElectricItem(tStack) && !GT_Utility.isStackInList(tStack, sNonReplaceableItems)) {
- //if (!(tRecipe instanceof ShapelessRecipes) || tRecipe instanceof ShapelessOreRecipe) {
- if (tRecipe instanceof ShapedOreRecipe) {
- boolean temp = true;
- for (Object tObject : ((ShapedOreRecipe) tRecipe).getInput()) {
- if (tObject != null) {
- if (tObject instanceof ItemStack && (((ItemStack) tObject).getItem() == null || ((ItemStack) tObject).getMaxStackSize() < 2 || ((ItemStack) tObject).getMaxDamage() > 0 || ((ItemStack) tObject).getItem() instanceof ItemBlock)) {
- temp = false;
- break;
+ if (!(tRecipe instanceof ShapelessRecipes || tRecipe instanceof ShapelessOreRecipe)) {
+ if (tRecipe instanceof ShapedOreRecipe) {
+ boolean temp = true;
+ for (Object tObject : ((ShapedOreRecipe) tRecipe).getInput())
+ if (tObject != null) {
+ if (tObject instanceof ItemStack && (((ItemStack) tObject).getItem() == null || ((ItemStack) tObject).getMaxStackSize() < 2 || ((ItemStack) tObject).getMaxDamage() > 0 || ((ItemStack) tObject).getItem() instanceof ItemBlock)) {
+ temp = false;
+ break;
+ }
+ if (tObject instanceof List && ((List) tObject).isEmpty()) {
+ temp = false;
+ break;
+ }
}
- if (tObject instanceof List && ((List) tObject).isEmpty()) {
+ if (temp) sSingleNonBlockDamagableRecipeList.add(tRecipe);
+ } else if (tRecipe instanceof ShapedRecipes) {
+ boolean temp = true;
+ for (ItemStack tObject : ((ShapedRecipes) tRecipe).recipeItems) {
+ if (tObject != null && (tObject.getItem() == null || tObject.getMaxStackSize() < 2 || tObject.getMaxDamage() > 0 || tObject.getItem() instanceof ItemBlock)) {
temp = false;
break;
}
- }}
- if (temp) {sSingleNonBlockDamagableRecipeList.add(tRecipe);}
- } else if (tRecipe instanceof ShapedRecipes) {
- boolean temp = true;
- for (ItemStack tObject : ((ShapedRecipes) tRecipe).recipeItems) {
- if (tObject != null && (tObject.getItem() == null || tObject.getMaxStackSize() < 2 || tObject.getMaxDamage() > 0 || tObject.getItem() instanceof ItemBlock)) {
- temp = false;
- break;
}
+ if (temp) sSingleNonBlockDamagableRecipeList.add(tRecipe);
+ } else {
+ sSingleNonBlockDamagableRecipeList.add(tRecipe);
}
- if (temp) {sSingleNonBlockDamagableRecipeList.add(tRecipe);}
- } else {
- sSingleNonBlockDamagableRecipeList.add(tRecipe);
}
- //}
}
}
GT_Log.out.println("GT_Mod: Created a List of Tool Recipes containing " + sSingleNonBlockDamagableRecipeList.size() + " Recipes for recycling." + (sSingleNonBlockDamagableRecipeList.size() > 1024 ? " Scanning all these Recipes is the reason for the startup Lag you receive right now." : E));
- int aList_move = sSingleNonBlockDamagableRecipeList.size();
- sSingleNonBlockDamagableRecipeList_list.add(aList_move);
- sSingleNonBlockDamagableRecipeList_create = false;
- sSingleNonBlockDamagableRecipeList_validsShapes1_update = true;
- InventoryCrafting aCrafting = new InventoryCrafting(new Container() {
- @Override
- public boolean canInteractWith(EntityPlayer var1) {return false;}}, 3, 3);
- for (int i = 0; i < aList_move; i++) {
- for (int j = 0; j < sShapes1.length; j++) {
- ItemStack[] sRecipe = sShapes1[j];
- for (int l = 0; l < 9 && l < sRecipe.length; l++) {aCrafting.setInventorySlotContents(l, sRecipe[l]);}
- IRecipe vRecipe = sSingleNonBlockDamagableRecipeList.get(i);
- if (vRecipe.matches(aCrafting, DW)) {
- if (!(sSingleNonBlockDamagableRecipeList_validsShapes1.contains(j))) {sSingleNonBlockDamagableRecipeList_validsShapes1.add(j);}
- sSingleNonBlockDamagableRecipeList_verified.add(vRecipe);
- }
- }
- }
-
}
- /*ArrayList<ItemStack> */
- if (sSingleNonBlockDamagableRecipeList_verified.size() != 0) {rList = getRecipeOutputs(sSingleNonBlockDamagableRecipeList_verified, true, aRecipe);}
- if (!GregTech_API.sPostloadStarted || GregTech_API.sPostloadFinished) {
- sSingleNonBlockDamagableRecipeList.clear();sSingleNonBlockDamagableRecipeList_create = true;sSingleNonBlockDamagableRecipeList_validsShapes1.clear();}
+ ArrayList<ItemStack> rList = getRecipeOutputs(sSingleNonBlockDamagableRecipeList, true, aRecipe);
+ if (!GregTech_API.sPostloadStarted || GregTech_API.sPostloadFinished)
+ sSingleNonBlockDamagableRecipeList.clear();
return rList;
}
@@ -1399,7 +1378,7 @@ public class GT_ModHandler {
*/
public static ArrayList<ItemStack> getRecipeOutputs(List<IRecipe> aList, boolean aDeleteFromList, ItemStack... aRecipe) {
ArrayList<ItemStack> rList = new ArrayList<ItemStack>();
- if (aRecipe == null || aList.size() == 0) {return rList;}
+ if (aRecipe == null) return rList;
boolean temp = false;
for (byte i = 0; i < aRecipe.length; i++) {
if (aRecipe[i] != null) {
@@ -1407,51 +1386,33 @@ public class GT_ModHandler {
break;
}
}
- if (!temp) {return rList;}
+ if (!temp) return rList;
InventoryCrafting aCrafting = new InventoryCrafting(new Container() {
@Override
public boolean canInteractWith(EntityPlayer var1) {
return false;
}
}, 3, 3);
- for (int i = 0; i < 9 && i < aRecipe.length; i++) {aCrafting.setInventorySlotContents(i, aRecipe[i]);}
- int aList_sS=aList.size();
- ArrayList<Integer> tempaList_list = new ArrayList<Integer>();
- if(!aDeleteFromList) {
- for (int i = 0; i < aList_sS; i++) {
- IRecipe tempALg0 = aList.get(i);
- if (tempALg0.matches(aCrafting, DW)) {
- ItemStack tOutput = tempALg0.getCraftingResult(aCrafting);
- if (tOutput == null || tOutput.stackSize <= 0) {
- if (!(sVanillaRecipeList_warntOutput.contains(i))) {sVanillaRecipeList_warntOutput.add(i);}
- } else {
- rList.add(GT_Utility.copy(tOutput));
- if (aDeleteFromList) {tempaList_list.add(i);}
- }
- }
+ for (int i = 0; i < 9 && i < aRecipe.length; i++) aCrafting.setInventorySlotContents(i, aRecipe[i]);
+ for (int i = 0; i < aList.size(); i++) {
+ temp = false;
+ try {
+ temp = aList.get(i).matches(aCrafting, DW);
+ } catch (Throwable e) {
+ e.printStackTrace(GT_Log.err);
}
- } else {
- for (int i = 0; i < aList_sS; i++) {
- IRecipe tempALg0 = aList.get(i);
- ItemStack tOutput = tempALg0.getCraftingResult(aCrafting);
+ if (temp) {
+ ItemStack tOutput = aList.get(i).getCraftingResult(aCrafting);
if (tOutput == null || tOutput.stackSize <= 0) {
- if (!(sSingleNonBlockDamagableRecipeList_warntOutput.contains(i))) {sSingleNonBlockDamagableRecipeList_warntOutput.add(i);}
+ // Seriously, who would ever do that shit?
+ if (!GregTech_API.sPostloadFinished)
+ throw new GT_ItsNotMyFaultException("Seems another Mod added a Crafting Recipe with null Output. Tell the Developer of said Mod to fix that.");
} else {
rList.add(GT_Utility.copy(tOutput));
- if (aDeleteFromList) {tempaList_list.add(i);}
+ if (aDeleteFromList) aList.remove(i--);
}
}
}
- //boolean tempaList_list_b = tempaList_list.size() != 0 ? true : false;
- if (aDeleteFromList && tempaList_list.size() != 0) {
- List<IRecipe> tempaList_2 = new ArrayList<IRecipe>();
- for (int i = 0; i < aList_sS; i++) {
- int k = 0, l = 0;
- if (tempaList_list.get(k) == i) {k++;continue;}
- tempaList_2.add(aList.get(l));l++;
- }
- aList = tempaList_2;
- }
return rList;
}
diff --git a/src/main/java/gregtech/api/util/GT_RecipeRegistrator.java b/src/main/java/gregtech/api/util/GT_RecipeRegistrator.java
index 27d3aed199..bbac9cd25f 100644
--- a/src/main/java/gregtech/api/util/GT_RecipeRegistrator.java
+++ b/src/main/java/gregtech/api/util/GT_RecipeRegistrator.java
@@ -121,8 +121,6 @@ public class GT_RecipeRegistrator {
{"Scythe", s_H + s_P + s_I, s_P + s_F + s_R, " " + " " + s_R}
};
public static volatile int VERSION = 509;
- public static int sRodMaterialList_cycles = 0;
- private static int i_count = 0;
public static void registerMaterialRecycling(ItemStack aStack, Materials aMaterial, long aMaterialAmount, MaterialStack aByproduct) {
if (GT_Utility.isStackInvalid(aStack)) return;
@@ -153,8 +151,8 @@ public class GT_RecipeRegistrator {
ItemData tData = GT_OreDictUnificator.getItemData(aStack);
boolean tHide = (aMaterial != Materials.Iron)&&(GT_Mod.gregtechproxy.mHideRecyclingRecipes);
if(tHide && tData!=null&&tData.hasValidPrefixData()&&tData.mPrefix==OrePrefixes.ingot){
- tHide=false;
- }
+ tHide=false;
+ }
RA.addFluidSmelterRecipe(GT_Utility.copyAmount(1, aStack), aByproduct == null ? null : aByproduct.mMaterial.contains(SubTag.NO_SMELTING) || !aByproduct.mMaterial.contains(SubTag.METAL) ? aByproduct.mMaterial.contains(SubTag.FLAMMABLE) ? GT_OreDictUnificator.getDust(Materials.Ash, aByproduct.mAmount / 2) : aByproduct.mMaterial.contains(SubTag.UNBURNABLE) ? GT_OreDictUnificator.getDustOrIngot(aByproduct.mMaterial.mSmeltInto, aByproduct.mAmount) : null : GT_OreDictUnificator.getIngotOrDust(aByproduct.mMaterial.mSmeltInto, aByproduct.mAmount), aMaterial.mSmeltInto.getMolten((L * aMaterialAmount) / (M * aStack.stackSize)), 10000, (int) Math.max(1, (24 * aMaterialAmount) / M), Math.max(8, (int) Math.sqrt(2 * aMaterial.mSmeltInto.mStandardMoltenFluid.getTemperature())), tHide);
}
@@ -191,8 +189,8 @@ public class GT_RecipeRegistrator {
for (MaterialStack tMaterial : aData.getAllMaterialStacks()) {
if (tMaterial.mMaterial == Materials.Iron||tMaterial.mMaterial == Materials.Copper ||
- tMaterial.mMaterial == Materials.WroughtIron||tMaterial.mMaterial == Materials.AnnealedCopper) tIron = true;
-
+ tMaterial.mMaterial == Materials.WroughtIron||tMaterial.mMaterial == Materials.AnnealedCopper) tIron = true;
+
if (tMaterial.mMaterial.contains(SubTag.UNBURNABLE)) {
tMaterial.mMaterial = tMaterial.mMaterial.mSmeltInto.mArcSmeltInto;
continue;
@@ -230,7 +228,7 @@ public class GT_RecipeRegistrator {
long tAmount = 0;
for (MaterialStack tMaterial : aData.getAllMaterialStacks())
tAmount += tMaterial.mAmount * tMaterial.mMaterial.getMass();
-
+
boolean tHide = !tIron && GT_Mod.gregtechproxy.mHideRecyclingRecipes;
RA.addArcFurnaceRecipe(aStack, new ItemStack[]{GT_OreDictUnificator.getIngotOrDust(aData.mMaterial), GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(0)), GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(1)), GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(2))}, null, (int) Math.max(16, tAmount / M), 96, tHide);
}
@@ -274,7 +272,7 @@ public class GT_RecipeRegistrator {
* You give this Function a Material and it will scan almost everything for adding recycling Recipes
*
* @param aMat a Material, for example an Ingot or a Gem.
- * @param aPlate the Dust you usually get from macerating aMat
+ * @param aOutput the Dust you usually get from macerating aMat
* @param aRecipeReplacing allows to replace the Recipe with a Plate variant
*/
public static synchronized void registerUsagesForMaterials(ItemStack aMat, String aPlate, boolean aRecipeReplacing) {
@@ -282,11 +280,8 @@ public class GT_RecipeRegistrator {
aMat = GT_Utility.copy(aMat);
ItemStack tStack;
ItemData aItemData = GT_OreDictUnificator.getItemData(aMat);
- boolean aItemData_b_0 = aItemData != null ? true : false;
- if (!aItemData_b_0 || aItemData.mPrefix != OrePrefixes.ingot) {aPlate = null;}
+ if (aItemData == null || aItemData.mPrefix != OrePrefixes.ingot) aPlate = null;
if (aPlate != null && GT_OreDictUnificator.getFirstOre(aPlate, 1) == null) aPlate = null;
- boolean aItemData_b_1 = aItemData.hasValidPrefixMaterialData() ? true : false;
- boolean aPlate_b_0 = aPlate != null ? true : false;
sMt1.func_150996_a(aMat.getItem());
sMt1.stackSize = 1;
@@ -301,13 +296,12 @@ public class GT_RecipeRegistrator {
for (ItemStack tMat : tRecipe) {
if (tMat == sMt1) tAmount1++;
}
- if (aItemData_b_0 && aItemData_b_1)
+ if (aItemData != null && aItemData.hasValidPrefixMaterialData())
for (ItemStack tCrafted : GT_ModHandler.getRecipeOutputs(tRecipe)) {
GT_OreDictUnificator.addItemData(tCrafted, new ItemData(aItemData.mMaterial.mMaterial, aItemData.mMaterial.mAmount * tAmount1));
}
}
- GT_ModHandler.getVanillyToolRecipeOutputs(sShapes1[0]);
for (Materials tMaterial : sRodMaterialList) {
ItemStack tMt2 = GT_OreDictUnificator.get(OrePrefixes.stick, tMaterial, 1);
if (tMt2 != null) {
@@ -315,48 +309,37 @@ public class GT_RecipeRegistrator {
sMt2.stackSize = 1;
Items.feather.setDamage(sMt2, Items.feather.getDamage(tMt2));
- if (GT_ModHandler.sSingleNonBlockDamagableRecipeList.size() == 0 || GT_ModHandler.sSingleNonBlockDamagableRecipeList_validsShapes1.size() == 0 || GT_ModHandler.sSingleNonBlockDamagableRecipeList_verified.size() == 0) { sRodMaterialList_cycles++;continue;}
- int sShapes1_len = GT_ModHandler.sSingleNonBlockDamagableRecipeList_validsShapes1.size();
- for (int i = 0; i < sShapes1_len; i++) {
- int i2 = GT_ModHandler.sSingleNonBlockDamagableRecipeList_validsShapes1.get(i);
- ItemStack[] tRecipe = sShapes1[i2];
- if (tRecipe == null) continue;
+ for (int i = 0; i < sShapes1.length; i++) {
+ ItemStack[] tRecipe = sShapes1[i];
int tAmount1 = 0, tAmount2 = 0;
for (ItemStack tMat : tRecipe) {
if (tMat == sMt1) tAmount1++;
if (tMat == sMt2) tAmount2++;
}
- List<ItemStack> tempTest = GT_ModHandler.getVanillyToolRecipeOutputs(tRecipe);
- if (GT_ModHandler.sSingleNonBlockDamagableRecipeList_validsShapes1_update && GT_ModHandler.sSingleNonBlockDamagableRecipeList_validsShapes1.size() != 0) {sShapes1_len = GT_ModHandler.sSingleNonBlockDamagableRecipeList_validsShapes1.size();GT_ModHandler.sSingleNonBlockDamagableRecipeList_validsShapes1_update = false;}
- int tempTest_size_sS = tempTest.size();
- if (tempTest_size_sS > 0) {
- for (ItemStack tCrafted : tempTest/*GT_ModHandler.getVanillyToolRecipeOutputs(tRecipe)*/) {
- if (aItemData_b_0 && aItemData_b_1) {
- GT_OreDictUnificator.addItemData(tCrafted, new ItemData(aItemData.mMaterial.mMaterial, aItemData.mMaterial.mAmount * tAmount1, new MaterialStack(tMaterial, OrePrefixes.stick.mMaterialAmount * tAmount2)));
- }
-
- if (aRecipeReplacing && aPlate_b_0 && sShapesA[i2] != null && sShapesA[i2].length > 1) {
- //assert aItemData != null;//dead dev code or decomp JAD?
- if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.recipereplacements, new StringBuilder().append(aItemData.mMaterial.mMaterial).append('.').append(sShapesA[i2][0]).toString(), true)) {
- if (null != (tStack = GT_ModHandler.removeRecipe(tRecipe))) {
- switch (sShapesA[i].length) {
- case 2:
- GT_ModHandler.addCraftingRecipe(tStack, GT_ModHandler.RecipeBits.BUFFERED, new Object[]{sShapesA[i2][1], s_P.charAt(0), aPlate, s_R.charAt(0), OrePrefixes.stick.get(tMaterial), s_I.charAt(0), aItemData});
- break;
- case 3:
- GT_ModHandler.addCraftingRecipe(tStack, GT_ModHandler.RecipeBits.BUFFERED, new Object[]{sShapesA[i2][1], sShapesA[i2][2], s_P.charAt(0), aPlate, s_R.charAt(0), OrePrefixes.stick.get(tMaterial), s_I.charAt(0), aItemData});
- break;
- default:
- GT_ModHandler.addCraftingRecipe(tStack, GT_ModHandler.RecipeBits.BUFFERED, new Object[]{sShapesA[i2][1], sShapesA[i2][2], sShapesA[i2][3], s_P.charAt(0), aPlate, s_R.charAt(0), OrePrefixes.stick.get(tMaterial), s_I.charAt(0), aItemData});
- break;
- }
+ for (ItemStack tCrafted : GT_ModHandler.getVanillyToolRecipeOutputs(tRecipe)) {
+ if (aItemData != null && aItemData.hasValidPrefixMaterialData())
+ GT_OreDictUnificator.addItemData(tCrafted, new ItemData(aItemData.mMaterial.mMaterial, aItemData.mMaterial.mAmount * tAmount1, new MaterialStack(tMaterial, OrePrefixes.stick.mMaterialAmount * tAmount2)));
+
+ if (aRecipeReplacing && aPlate != null && sShapesA[i] != null && sShapesA[i].length > 1) {
+ assert aItemData != null;
+ if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.recipereplacements, aItemData.mMaterial.mMaterial + "." + sShapesA[i][0], true)) {
+ if (null != (tStack = GT_ModHandler.removeRecipe(tRecipe))) {
+ switch (sShapesA[i].length) {
+ case 2:
+ GT_ModHandler.addCraftingRecipe(tStack, GT_ModHandler.RecipeBits.BUFFERED, new Object[]{sShapesA[i][1], s_P.charAt(0), aPlate, s_R.charAt(0), OrePrefixes.stick.get(tMaterial), s_I.charAt(0), aItemData});
+ break;
+ case 3:
+ GT_ModHandler.addCraftingRecipe(tStack, GT_ModHandler.RecipeBits.BUFFERED, new Object[]{sShapesA[i][1], sShapesA[i][2], s_P.charAt(0), aPlate, s_R.charAt(0), OrePrefixes.stick.get(tMaterial), s_I.charAt(0), aItemData});
+ break;
+ default:
+ GT_ModHandler.addCraftingRecipe(tStack, GT_ModHandler.RecipeBits.BUFFERED, new Object[]{sShapesA[i][1], sShapesA[i][2], sShapesA[i][3], s_P.charAt(0), aPlate, s_R.charAt(0), OrePrefixes.stick.get(tMaterial), s_I.charAt(0), aItemData});
+ break;
}
}
}
}
}
- sRodMaterialList_cycles++;
}
}
}
diff --git a/src/main/java/gregtech/api/util/GT_Utility.java b/src/main/java/gregtech/api/util/GT_Utility.java
index cfd0b4b880..40f50824e7 100644
--- a/src/main/java/gregtech/api/util/GT_Utility.java
+++ b/src/main/java/gregtech/api/util/GT_Utility.java
@@ -869,10 +869,12 @@ public class GT_Utility {
return false;
}
}
+ ItemStack[] tStack = GT_OreDictUnificator.getStackArray(true, aOutput);
+ if(tStack==null||(tStack.length>0&&GT_Utility.areStacksEqual(aInput, tStack[0])))return false;
if (tOreName != null) {
- aRecipeList.put(new RecipeInputOreDict(tOreName.toString(), aInput.stackSize), new RecipeOutput(aNBT, GT_OreDictUnificator.getStackArray(true, aOutput)));
+ aRecipeList.put(new RecipeInputOreDict(tOreName.toString(), aInput.stackSize), new RecipeOutput(aNBT, tStack));
} else {
- aRecipeList.put(new RecipeInputItemStack(copy(aInput), aInput.stackSize), new RecipeOutput(aNBT, GT_OreDictUnificator.getStackArray(true, aOutput)));
+ aRecipeList.put(new RecipeInputItemStack(copy(aInput), aInput.stackSize), new RecipeOutput(aNBT, tStack));
}
return true;
}
@@ -929,7 +931,7 @@ public class GT_Utility {
}
public static boolean doSoundAtClient(String aSoundName, int aTimeUntilNextSound, float aSoundStrength, double aX, double aY, double aZ) {
- return doSoundAtClient(aSoundName, aTimeUntilNextSound, aSoundStrength, 0.9F + new Random().nextFloat() * 0.2F, aX, aY, aZ);
+ return doSoundAtClient(aSoundName, aTimeUntilNextSound, aSoundStrength, 1.01818028F, aX, aY, aZ);
}
public static boolean doSoundAtClient(String aSoundName, int aTimeUntilNextSound, float aSoundStrength, float aSoundModulation, double aX, double aY, double aZ) {
@@ -1053,35 +1055,15 @@ public class GT_Utility {
}
public static boolean isOpaqueBlock(World aWorld, int aX, int aY, int aZ) {
- boolean result;
- try {
- result=aWorld.getBlock(aX, aY, aZ).isOpaqueCube();
- } catch (Throwable e) {
- result=true;
- }
- return result;
-
+ return aWorld.getBlock(aX, aY, aZ).isOpaqueCube();
}
public static boolean isBlockAir(World aWorld, int aX, int aY, int aZ) {
- boolean result;
- try {
- result=aWorld.getBlock(aX, aY, aZ).isAir(aWorld, aX, aY, aZ);
- } catch (Throwable e) {
- result=false;
- }
- return result;
- }
+ return aWorld.getBlock(aX, aY, aZ).isAir(aWorld, aX, aY, aZ);
+ }
public static boolean hasBlockHitBox(World aWorld, int aX, int aY, int aZ) {
- boolean result;
- try {
- result=aWorld.getBlock(aX, aY, aZ).getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ) != null;
- } catch (Throwable e) {
- result=false;
- }
- return result;
-
+ return aWorld.getBlock(aX, aY, aZ).getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ) != null;
}
public static void setCoordsOnFire(World aWorld, int aX, int aY, int aZ, boolean aReplaceCenter) {
@@ -1123,7 +1105,6 @@ public class GT_Utility {
* Converts a Number to a String
*/
public static String parseNumberToString(int aNumber) {
- String tString = E;
boolean temp = true, negative = false;
if (aNumber < 0) {
@@ -1131,15 +1112,18 @@ public class GT_Utility {
negative = true;
}
+ StringBuilder tStringB = new StringBuilder();
for (int i = 1000000000; i > 0; i /= 10) {
int tDigit = (aNumber / i) % 10;
if (temp && tDigit != 0) temp = false;
if (!temp) {
- tString += tDigit;
- if (i != 1) for (int j = i; j > 0; j /= 1000) if (j == 1) tString += ",";
+ tStringB.append(tDigit);
+ if (i != 1) for (int j = i; j > 0; j /= 1000) if (j == 1) tStringB.append(",");
}
}
+ String tString = tStringB.toString();
+
if (tString.equals(E)) tString = "0";
return negative ? "-" + tString : tString;
@@ -1438,7 +1422,7 @@ public class GT_Utility {
Collections.sort(tEntrySet, new Comparator<Map.Entry<X, Y>>() {
@Override
public int compare(Entry<X, Y> aValue1, Entry<X, Y> aValue2) {
- return -aValue1.getValue().compareTo(aValue2.getValue());
+ return aValue2.getValue().compareTo(aValue1.getValue());//FB: RV - RV_NEGATING_RESULT_OF_COMPARETO
}
});
LinkedHashMap<X, Y> rMap = new LinkedHashMap<X, Y>();
@@ -1483,23 +1467,25 @@ public class GT_Utility {
if (aEntity instanceof EntityPlayerMP) {
EntityPlayerMP aPlayer = (EntityPlayerMP) aEntity;
- aPlayer.dimension = aDimension;
- aPlayer.playerNetServerHandler.sendPacket(new S07PacketRespawn(aPlayer.dimension, aPlayer.worldObj.difficultySetting, aPlayer.worldObj.getWorldInfo().getTerrainType(), aPlayer.theItemInWorldManager.getGameType()));
- tOriginalWorld.removePlayerEntityDangerously(aPlayer);
- aPlayer.isDead = false;
- aPlayer.setWorld(tTargetWorld);
- MinecraftServer.getServer().getConfigurationManager().func_72375_a(aPlayer, tOriginalWorld);
- aPlayer.playerNetServerHandler.setPlayerLocation(aX + 0.5, aY + 0.5, aZ + 0.5, aPlayer.rotationYaw, aPlayer.rotationPitch);
- aPlayer.theItemInWorldManager.setWorld(tTargetWorld);
- MinecraftServer.getServer().getConfigurationManager().updateTimeAndWeatherForPlayer(aPlayer, tTargetWorld);
- MinecraftServer.getServer().getConfigurationManager().syncPlayerInventory(aPlayer);
- Iterator tIterator = aPlayer.getA