From 9847f73d980c9a8c9cdacf95283e6d896406a8b7 Mon Sep 17 00:00:00 2001 From: Technus Date: Thu, 8 Sep 2016 23:31:15 +0200 Subject: [PATCH] Work on tiers --- .../GT_MetaTileEntity_BasicMachine.java | 4 ++-- .../GT_MetaTileEntity_MultiBlockBase.java | 4 ++-- .../basic/GT_MetaTileEntity_Boxinator.java | 2 +- .../basic/GT_MetaTileEntity_Massfabricator.java | 4 ++-- .../basic/GT_MetaTileEntity_MonsterRepellent.java | 2 +- .../basic/GT_MetaTileEntity_PotionBrewer.java | 15 ++++++++------- .../GT_MetaTileEntity_DistillationTower.java | 2 +- .../GT_MetaTileEntity_ElectricBlastFurnace.java | 2 +- .../GT_MetaTileEntity_ImplosionCompressor.java | 2 +- .../multi/GT_MetaTileEntity_OilCracker.java | 2 +- 10 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java index 60d491a4..6a2928a2 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java @@ -542,9 +542,9 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B while (tempEUt <= V[mTier -1] * (long)mAmperage) { tempEUt *= 4;//this actually controls overclocking - xEUt *= 4;//this is effect of everclocking + //xEUt *= 4;//this is effect of everclocking mMaxProgresstime /= 2;//this is effect of overclocking - xEUt = mMaxProgresstime==0 ? xEUt/2 : xEUt;//U know, if the time is less than 1 tick make the machine use 2x less power + xEUt = mMaxProgresstime==0 ? (long)(xEUt/1.1D) : xEUt*4;//U know, if the time is less than 1 tick make the machine use 2x less power } if(xEUt>Integer.MAX_VALUE-1){ mEUt = Integer.MAX_VALUE-1; diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java index 630044d4..21be2afa 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java @@ -541,9 +541,9 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { while (tempEUt <= V[mTier -1] * mAmperage) { tempEUt *= 4;//this actually controls overclocking - xEUt *= 4;//this is effect of everclocking + //xEUt *= 4;//this is effect of everclocking mMaxProgresstime /= 2;//this is effect of overclocking - xEUt = mMaxProgresstime==0 ? xEUt/2 : xEUt;//U know, if the time is less than 1 tick make the machine use 2x less power + xEUt = mMaxProgresstime==0 ? (long)(xEUt/1.1D) : xEUt*4;//U know, if the time is less than 1 tick make the machine use less power } if(xEUt>Integer.MAX_VALUE-1){ mEUt = Integer.MAX_VALUE-1; diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java index 1540db50..f0417ee2 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java @@ -31,7 +31,7 @@ public class GT_MetaTileEntity_Boxinator } public int checkRecipe() { - int tCheck = super.checkRecipe(true); + int tCheck = super.checkRecipe(); if (tCheck != DID_NOT_FIND_RECIPE) { return tCheck; } diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Massfabricator.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Massfabricator.java index de3ec5d4..efb25cb1 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Massfabricator.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Massfabricator.java @@ -85,14 +85,14 @@ public class GT_MetaTileEntity_Massfabricator //Long EUt calculation long xEUt=GT_Values.V[1] * (long)Math.pow(2,mTier+2); - long tempEUt = GT_Values.V[mTier]; + long tempEUt = GT_Values.V[1]; mMaxProgresstime = sDurationMultiplier; while (tempEUt <= V[mTier -1]) { tempEUt *= 4;//this actually controls overclocking mMaxProgresstime /= 2;//this is effect of overclocking - xEUt = mMaxProgresstime==0 ? (int)(xEUt/1.1F) : xEUt;//U know, if the time is less than 1 tick make the machine use less power + xEUt = mMaxProgresstime==0 ? (long)(xEUt/1.1D) : xEUt;//U know, if the time is less than 1 tick make the machine use less power } if(xEUt>Integer.MAX_VALUE-1){ mEUt = Integer.MAX_VALUE-1; diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MonsterRepellent.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MonsterRepellent.java index f98f8af1..b32ef071 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MonsterRepellent.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_MonsterRepellent.java @@ -40,7 +40,7 @@ public class GT_MetaTileEntity_MonsterRepellent extends GT_MetaTileEntity_Tiered if ((aTimer % 600 == 0) && !GT_SpawnEventHandler.mobReps.contains(tCoords)) { GT_SpawnEventHandler.mobReps.add(tCoords); } - if (aBaseMetaTileEntity.isUniversalEnergyStored(getMinimumStoredEU()) && aBaseMetaTileEntity.decreaseStoredEnergyUnits(1 << (this.mTier * 2), false)) { + if (aBaseMetaTileEntity.isUniversalEnergyStored(getMinimumStoredEU()) && aBaseMetaTileEntity.decreaseStoredEnergyUnits(1L << (this.mTier * 2), false)) { mRange = 16 + (48 * mTier); } else { mRange = 4 + (12 * mTier); diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_PotionBrewer.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_PotionBrewer.java index 1a919a5e..56371be1 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_PotionBrewer.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_PotionBrewer.java @@ -35,10 +35,16 @@ public class GT_MetaTileEntity_PotionBrewer } public int checkRecipe() { - int tCheck = super.checkRecipe(true); - if (tCheck != 0) { + int tCheck = super.checkRecipe(); + if (tCheck != DID_NOT_FIND_RECIPE) { return tCheck; } + + calculateOverclockedNess(4,128); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + FluidStack aFluid = getFillableStack(); if ((getDrainableStack() == null) && (aFluid != null) && (getInputAt(0) != null)) { String tInputName = aFluid.getFluid().getName(); @@ -106,11 +112,6 @@ public class GT_MetaTileEntity_PotionBrewer } private final int setOutput(String aFluidName) { - calculateOverclockedNess(4,128); - //In case recipe is too OP for that machine - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) - return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; - this.mOutputFluid = FluidRegistry.getFluidStack(aFluidName, 750); if (this.mOutputFluid == null) { this.mOutputFluid = FluidRegistry.getFluidStack("potion.mundane", getFillableStack().amount); diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java index e077bf7b..654e9df0 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java @@ -103,7 +103,7 @@ public class GT_MetaTileEntity_DistillationTower if (tRecipe.isRecipeInputEqual(true, tFluids, new ItemStack[]{})) { this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; - calculateOverclockedNessMulti(mEUt, mMaxProgresstime, 1, tVoltage); + calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, tVoltage); //In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return false; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java index cde9613d..1b6b2d1b 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java @@ -108,7 +108,7 @@ public class GT_MetaTileEntity_ElectricBlastFurnace if ((tRecipe != null) && (this.mHeatingCapacity >= tRecipe.mSpecialValue) && (tRecipe.isRecipeInputEqual(true, tFluids, tInputs))) { this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; - calculateOverclockedNessMulti(mEUt, mMaxProgresstime, 1, tVoltage); + calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, tVoltage); //In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return false; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java index 0084820e..4ee64d7b 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java @@ -88,7 +88,7 @@ public class GT_MetaTileEntity_ImplosionCompressor this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; //OC THAT EXPLOSIVE SHIT!!! - calculateOverclockedNessMulti(mEUt, tRecipe.mDuration, 1, getMaxInputVoltage()); + calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, getMaxInputVoltage()); //In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return false; diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilCracker.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilCracker.java index 79f4cc30..aaede0c0 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilCracker.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilCracker.java @@ -83,7 +83,7 @@ public class GT_MetaTileEntity_OilCracker extends GT_MetaTileEntity_MultiBlockBa this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; - calculateOverclockedNessMulti(mEUt, tRecipe.mDuration, 1, getMaxInputVoltage()); + calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, getMaxInputVoltage()); //In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return false;