aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/xmod/gregtech/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/gtPlusPlus/xmod/gregtech/common')
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GMTE_AmazonPackager.java19
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMixer.java4
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java18
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_ElementalDuplicator.java19
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_AlloyBlastSmelter.java4
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java34
6 files changed, 90 insertions, 8 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GMTE_AmazonPackager.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GMTE_AmazonPackager.java
index 64ff058568..9c064c3973 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GMTE_AmazonPackager.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GMTE_AmazonPackager.java
@@ -310,14 +310,27 @@ public class GMTE_AmazonPackager extends GregtechMeta_MultiBlockBase<GMTE_Amazon
return false;
}
+ if (mUseMultiparallelMode) {
+ int extraParallelRecipes = 0;
+ for (;
+ extraParallelRecipes + parallelRecipes < aMaxParallelRecipes * MAX_BATCH_SIZE;
+ extraParallelRecipes++) {
+ if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) {
+ break;
+ }
+ }
+ batchMultiplier = 1.0f + (float) extraParallelRecipes / aMaxParallelRecipes;
+ parallelRecipes += extraParallelRecipes;
+ }
+
// -- Try not to fail after this point - inputs have already been consumed! --
// Convert speed bonus to duration multiplier
// e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration.
aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent);
float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent);
- this.mMaxProgresstime = (int) (tRecipe.mDuration * tTimeFactor);
+ this.mMaxProgresstime = (int) (tRecipe.mDuration * tTimeFactor);
this.lEUt = (long) Math.ceil(tTotalEUt);
this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
@@ -341,6 +354,10 @@ public class GMTE_AmazonPackager extends GregtechMeta_MultiBlockBase<GMTE_Amazon
this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ if (mUseMultiparallelMode) {
+ mMaxProgresstime = (int) Math.ceil(mMaxProgresstime * batchMultiplier);
+ }
+
// Collect fluid outputs
FluidStack[] tOutputFluids = new FluidStack[tRecipe.mFluidOutputs.length];
for (int h = 0; h < tRecipe.mFluidOutputs.length; h++) {
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMixer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMixer.java
index 7a6e972d22..cef60fec54 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMixer.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMixer.java
@@ -233,12 +233,10 @@ public class GregtechMetaTileEntity_IndustrialMixer
}
@Override
- public boolean onWireCutterRightClick(
- byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
isBussesSeparate = !isBussesSeparate;
GT_Utility.sendChatToPlayer(
aPlayer, StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + isBussesSeparate);
- return true;
}
@Override
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java
index 8045f703ef..6955826eab 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java
@@ -396,12 +396,26 @@ public class GregtechMetaTileEntity_IndustrialMultiMachine
return false;
}
+ if (mUseMultiparallelMode) {
+ int extraParallelRecipes = 0;
+ for (;
+ extraParallelRecipes + parallelRecipes < aMaxParallelRecipes * MAX_BATCH_SIZE;
+ extraParallelRecipes++) {
+ if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) {
+ break;
+ }
+ }
+ batchMultiplier = 1.0f + (float) extraParallelRecipes / aMaxParallelRecipes;
+ parallelRecipes += extraParallelRecipes;
+ }
+
// -- Try not to fail after this point - inputs have already been consumed! --
// Convert speed bonus to duration multiplier
// e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration.
aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent);
float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent);
+
this.mMaxProgresstime = (int) (tRecipe.mDuration * tTimeFactor);
this.lEUt = (long) Math.ceil(tTotalEUt);
@@ -426,6 +440,10 @@ public class GregtechMetaTileEntity_IndustrialMultiMachine
this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ if (mUseMultiparallelMode) {
+ mMaxProgresstime = (int) Math.ceil(mMaxProgresstime * batchMultiplier);
+ }
+
// Collect fluid outputs
FluidStack[] tOutputFluids = new FluidStack[tRecipe.mFluidOutputs.length];
for (int h = 0; h < tRecipe.mFluidOutputs.length; h++) {
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_ElementalDuplicator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_ElementalDuplicator.java
index 144aa90cdb..61a88b9a38 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_ElementalDuplicator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_ElementalDuplicator.java
@@ -445,14 +445,27 @@ public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase
return false;
}
+ if (mUseMultiparallelMode) {
+ int extraParallelRecipes = 0;
+ for (;
+ extraParallelRecipes + parallelRecipes < aMaxParallelRecipes * MAX_BATCH_SIZE;
+ extraParallelRecipes++) {
+ if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) {
+ break;
+ }
+ }
+ batchMultiplier = 1.0f + (float) extraParallelRecipes / aMaxParallelRecipes;
+ parallelRecipes += extraParallelRecipes;
+ }
+
// -- Try not to fail after this point - inputs have already been consumed! --
// Convert speed bonus to duration multiplier
// e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration.
aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent);
float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent);
- this.mMaxProgresstime = (int) (tRecipe.mDuration * tTimeFactor);
+ this.mMaxProgresstime = (int) (tRecipe.mDuration * tTimeFactor);
this.lEUt = (long) Math.ceil(tTotalEUt);
this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
@@ -475,6 +488,10 @@ public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase
this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ if (mUseMultiparallelMode) {
+ mMaxProgresstime = (int) Math.ceil(mMaxProgresstime * batchMultiplier);
+ }
+
// Collect fluid outputs
FluidStack[] tOutputFluids = new FluidStack[tRecipe.mFluidOutputs.length];
for (int h = 0; h < tRecipe.mFluidOutputs.length; h++) {
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_AlloyBlastSmelter.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_AlloyBlastSmelter.java
index bc20e09090..64f04e530d 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_AlloyBlastSmelter.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_AlloyBlastSmelter.java
@@ -296,12 +296,10 @@ public class GregtechMetaTileEntity_AlloyBlastSmelter
}
@Override
- public boolean onWireCutterRightClick(
- byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
isBussesSeparate = !isBussesSeparate;
GT_Utility.sendChatToPlayer(
aPlayer, StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + isBussesSeparate);
- return true;
}
@Override
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java
index 78b8c64ab3..e93ee44d91 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java
@@ -329,6 +329,19 @@ public class GregtechMetaTileEntity_MassFabricator
}
log("Broke at " + parallelRecipes + ".");
if (parallelRecipes > 0) {
+
+ float batchMultiplier = 1.0f;
+ if (mUseMultiparallelMode) {
+ int extraParallelRecipes = 0;
+ for (; extraParallelRecipes + parallelRecipes < aMaxParallelRecipes * 128; extraParallelRecipes++) {
+ if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) {
+ break;
+ }
+ }
+ batchMultiplier = 1.0f + (float) extraParallelRecipes / aMaxParallelRecipes;
+ parallelRecipes += extraParallelRecipes;
+ }
+
// -- Try not to fail after this point - inputs have already been
// consumed! --
@@ -337,6 +350,9 @@ public class GregtechMetaTileEntity_MassFabricator
// duration.
aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent);
float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent);
+ if (mUseMultiparallelMode) {
+ tTimeFactor *= batchMultiplier;
+ }
this.mMaxProgresstime = (int) (tRecipe.mDuration * tTimeFactor);
this.lEUt = (long) Math.ceil(tTotalEUt);
this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
@@ -480,12 +496,26 @@ public class GregtechMetaTileEntity_MassFabricator
return false;
}
+ if (mUseMultiparallelMode) {
+ int extraParallelRecipes = 0;
+ for (;
+ extraParallelRecipes + parallelRecipes < aMaxParallelRecipes * MAX_BATCH_SIZE;
+ extraParallelRecipes++) {
+ if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) {
+ break;
+ }
+ }
+ batchMultiplier = 1.0f + (float) extraParallelRecipes / aMaxParallelRecipes;
+ parallelRecipes += extraParallelRecipes;
+ }
+
// -- Try not to fail after this point - inputs have already been consumed! --
// Convert speed bonus to duration multiplier
// e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration.
aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent);
float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent);
+
this.mMaxProgresstime = (int) (tRecipe.mDuration * tTimeFactor);
this.lEUt = (long) Math.ceil(tTotalEUt);
@@ -510,6 +540,10 @@ public class GregtechMetaTileEntity_MassFabricator
this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ if (mUseMultiparallelMode) {
+ mMaxProgresstime = (int) Math.ceil(mMaxProgresstime * batchMultiplier);
+ }
+
// Collect fluid outputs
FluidStack[] tOutputFluids = new FluidStack[tRecipe.mFluidOutputs.length];
for (int h = 0; h < tRecipe.mFluidOutputs.length; h++) {