aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi
diff options
context:
space:
mode:
authorMartin Robertz <dream-master@gmx.net>2021-11-27 20:49:49 +0100
committerGitHub <noreply@github.com>2021-11-27 20:49:49 +0100
commit225764a6f34a2259009c27cc09bb1f39b5ba143e (patch)
treec409e20a16084d6340ebce6701e6330b5389a288 /src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi
parent3c21a8ffe1880801fb08670c33d73cb3f99af4d0 (diff)
parent7abed4ed651076f7c8a1338c0dc1dbca4c42247f (diff)
downloadGT5-Unofficial-225764a6f34a2259009c27cc09bb1f39b5ba143e.tar.gz
GT5-Unofficial-225764a6f34a2259009c27cc09bb1f39b5ba143e.tar.bz2
GT5-Unofficial-225764a6f34a2259009c27cc09bb1f39b5ba143e.zip
Merge pull request #45 from bombcar/master
fix catalyst durability bar
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi')
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java37
1 files changed, 13 insertions, 24 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java
index 4a2747a3db..bcf76964d2 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java
@@ -105,7 +105,7 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase {
tt.addMachineType(getMachineType())
.addInfo("Controller Block for the Chemical Plant")
.addInfo("Heavy Industry, now right at your doorstep!")
- .addInfo("Please read to user manual for more information on construction & usage")
+ .addInfo("Please read the user manual for more information on construction and usage")
.addSeparator()
.addController("Bottom Center")
.addStructureHint("Catalyst Housing", 1)
@@ -444,8 +444,7 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase {
private int getCasingTextureID() {
// Check the Tier Client Side
int aTier = mSolidCasingTier;
- int aCasingID = getCasingTextureIdForTier(aTier);
- return aCasingID;
+ return getCasingTextureIdForTier(aTier);
}
public boolean addToMachineList(IGregTechTileEntity aTileEntity) {
@@ -583,15 +582,12 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase {
//GT_Recipe tRecipe = findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs);
GT_Recipe tRecipe = findRecipe(mLastRecipe, gregtech.api.enums.GT_Values.V[tTier], getSolidCasingTier(), aItemInputs, aFluidInputs);
-
-
-
if (tRecipe == null) {
log("BAD RETURN - 1");
return false;
}
- // checks if it has a catalyst with enough durability
+ // checks if it has a catalyst
ItemStack tCatalystRecipe = findCatalyst(aItemInputs);
boolean aDoesRecipeNeedCatalyst = false;
for (ItemStack aInputItem : tRecipe.mInputs) {
@@ -606,7 +602,7 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase {
return false;
}
if (mCatalystBuses.size() != 1) {
- log("does not have correct number of catalyst hatchs. (Required 1, found "+mCatalystBuses.size()+")");
+ log("does not have correct number of catalyst hatches. (Required 1, found "+mCatalystBuses.size()+")");
return false;
}
}
@@ -627,16 +623,16 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase {
return false;
}
- // checks if it has enough catalyst durabilety
+ // checks if it has enough catalyst durability
ArrayList<ItemStack>tCatalysts = null;
- int tMaxParrallelCatalyst = aMaxParallelRecipes;
+ int tMaxParallelCatalyst = aMaxParallelRecipes;
if (tCatalystRecipe != null) {
tCatalysts = new ArrayList<ItemStack>();
- tMaxParrallelCatalyst = getCatalysts(aItemInputs, tCatalystRecipe, aMaxParallelRecipes, tCatalysts);
- log("Can process "+tMaxParrallelCatalyst+" recipes. If less than "+aMaxParallelRecipes+", catalyst does not have enough durability.");
+ tMaxParallelCatalyst = getCatalysts(aItemInputs, tCatalystRecipe, aMaxParallelRecipes, tCatalysts);
+ log("Can process "+tMaxParallelCatalyst+" recipes. If less than "+aMaxParallelRecipes+", catalyst does not have enough durability.");
}
- if (tMaxParrallelCatalyst == 0) {
+ if (tMaxParallelCatalyst == 0) {
log("found not enough catalysts");
return false;
}
@@ -650,13 +646,13 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase {
int parallelRecipes = 0;
log("parallelRecipes: "+parallelRecipes);
- log("aMaxParallelRecipes: "+tMaxParrallelCatalyst);
+ log("aMaxParallelRecipes: "+tMaxParallelCatalyst);
log("tTotalEUt: "+tTotalEUt);
log("tVoltage: "+tVoltage);
log("tEnergy: "+tEnergy);
log("tRecipeEUt: "+tRecipeEUt);
// Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits
- for (; parallelRecipes < tMaxParrallelCatalyst && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) {
+ for (; parallelRecipes < tMaxParallelCatalyst && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) {
if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) {
log("Broke at "+parallelRecipes+".");
break;
@@ -928,14 +924,14 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase {
}
private int getCatalysts(ItemStack[] aItemInputs, ItemStack aRecipeCatalyst, int aMaxParrallel, ArrayList<ItemStack> aOutPut) {
- int allowedParrallel = 0;
+ int allowedParallel = 0;
for (final ItemStack aInput : aItemInputs) {
if (aRecipeCatalyst.isItemEqual(aInput)) {
int aDurabilityRemaining = getMaxCatalystDurability() - getDamage(aInput);
return Math.min(aMaxParrallel, aDurabilityRemaining);
}
}
- return allowedParrallel;
+ return allowedParallel;
}
private ItemStack findCatalyst(ItemStack[] aItemInputs) {
@@ -971,9 +967,6 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase {
log("not consuming catalyst");
}
}
-
-
-
}
private int getDamage(ItemStack aStack) {
@@ -984,8 +977,6 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase {
ItemGenericChemBase.setCatalystDamage(aStack, aAmount);
}
-
-
@SideOnly(Side.CLIENT)
private final int getCasingTierOnClientSide() {
@@ -1018,7 +1009,6 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase {
t.printStackTrace();
return 0;
}
-
}
/*
@@ -1036,5 +1026,4 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase {
}
return tItems;
}
-
}