Materials update, whitespaces, Higher tier method adjustment for long computaion.
This commit is contained in:
parent
d8d2a5039a
commit
fcae1a1801
14 changed files with 42 additions and 27 deletions
|
@ -680,15 +680,14 @@ public enum Materials implements IColorModulationContainer, ISubTagContainer {
|
|||
|
||||
//Infinity
|
||||
//Others, new ones?...
|
||||
|
||||
/**
|
||||
* Materials which are renamed automatically
|
||||
*/
|
||||
//@Deprecated Duralium (Duralumin,false),
|
||||
//@Deprecated Dural (Duralumin,false),
|
||||
//@Deprecated Duralum (Duralumin,false),
|
||||
//@Deprecated Duralum (Duralumin,false),
|
||||
//@Deprecated Duraluminium (Duralumin,false),
|
||||
//@Deprecated Duraluminum (Duralumin,false),
|
||||
//@Deprecated Duraluminum (Duralumin,false),
|
||||
@Deprecated IridiumAndSodiumOxide(IridiumSodiumOxide, false),
|
||||
@Deprecated Palygorskite (FullersEarth, false),
|
||||
@Deprecated Adamantine (Adamantium, true),
|
||||
|
|
|
@ -71,7 +71,8 @@ public interface IEnergyConnected extends IColoredTileEntity, IHasWorldObjectAnd
|
|||
}
|
||||
} else if (GregTech_API.mOutputRF && tTileEntity instanceof IEnergyReceiver) {
|
||||
ForgeDirection tDirection = ForgeDirection.getOrientation(i).getOpposite();
|
||||
int rfOut = (int) (aVoltage * GregTech_API.mEUtoRF / 100);
|
||||
long rfOUT = aVoltage * GregTech_API.mEUtoRF / 100;
|
||||
int rfOut = rfOUT>Integer.MAX_VALUE ? Integer.MAX_VALUE : (int)rfOUT;
|
||||
if (((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, rfOut, true) == rfOut) {
|
||||
((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, rfOut, false);
|
||||
rUsedAmperes++;
|
||||
|
|
|
@ -259,7 +259,9 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item implements ISpeci
|
|||
Long[] tStats = getElectricStats(aStack);
|
||||
if (tStats == null || tStats[2] > aTier || !(tStats[3] == -1 || tStats[3] == -3 || (tStats[3] < 0 && aCharge == Integer.MAX_VALUE)) || aStack.stackSize != 1)
|
||||
return 0;
|
||||
//REALLY?? THIS IS THE CULPRIT THAT CHARGES ITEMS AT INSTANT!!!
|
||||
long tChargeBefore = getRealCharge(aStack), tNewCharge = aCharge == Integer.MAX_VALUE ? Long.MAX_VALUE : Math.min(Math.abs(tStats[0]), tChargeBefore + (aIgnoreTransferLimit ? (long) aCharge : Math.min(tStats[1], (long) aCharge)));
|
||||
// long tChargeBefore = getRealCharge(aStack), tNewCharge = Math.min(Math.abs(tStats[0]), tChargeBefore + (aIgnoreTransferLimit ? (long) aCharge : Math.min(tStats[1], (long) aCharge)));
|
||||
if (!aSimulate) setCharge(aStack, tNewCharge);
|
||||
return tNewCharge - tChargeBefore;
|
||||
}
|
||||
|
|
|
@ -176,7 +176,8 @@ public class GT_MetaPipeEntity_Cable extends MetaPipeEntity implements IMetaTile
|
|||
}
|
||||
} else if (GregTech_API.mOutputRF && tTileEntity instanceof IEnergyReceiver) {
|
||||
ForgeDirection tDirection = ForgeDirection.getOrientation(i).getOpposite();
|
||||
int rfOut = (int) (aVoltage * GregTech_API.mEUtoRF / 100);
|
||||
long rfOUT = aVoltage * GregTech_API.mEUtoRF / 100;
|
||||
int rfOut = rfOUT>Integer.MAX_VALUE ? Integer.MAX_VALUE : (int)rfOUT;
|
||||
if (((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, rfOut, true) == rfOut) {
|
||||
((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, rfOut, false);
|
||||
rUsedAmperes++;
|
||||
|
|
|
@ -110,12 +110,12 @@ public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_Tier
|
|||
|
||||
@Override
|
||||
public long getMinimumStoredEU() {
|
||||
return V[mTier] * 16 * mInventory.length;
|
||||
return V[mTier] * 16L * mInventory.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long maxEUStore() {
|
||||
return V[mTier] * 64 * mInventory.length;
|
||||
return V[mTier] * 64L * mInventory.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -130,7 +130,7 @@ public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_Tier
|
|||
|
||||
@Override
|
||||
public long maxAmperesIn() {
|
||||
return mChargeableCount * 2;
|
||||
return mChargeableCount * 2L;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -131,12 +131,12 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity
|
|||
|
||||
@Override
|
||||
public long maxEUOutput() {
|
||||
return getBaseMetaTileEntity().isAllowedToWork() ? V[mTier] : 0;
|
||||
return getBaseMetaTileEntity().isAllowedToWork() ? V[mTier] : 0L;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long maxEUStore() {
|
||||
return Math.max(getEUVar(), V[mTier] * 40 + getMinimumStoredEU());
|
||||
return Math.max(getEUVar(), V[mTier] * 40L + getMinimumStoredEU());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -539,7 +539,7 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
|
|||
tempEUt *= 4;//this actually controls overclocking
|
||||
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 1 tick make the machine use 2x less power
|
||||
xEUt= mMaxProgresstime==0 ? xEUt/2 : xEUt;//U know, if the time is 1 tick make the machine use 2x less power
|
||||
}
|
||||
if(xEUt>Integer.MAX_VALUE-1){
|
||||
mEUt=Integer.MAX_VALUE-1;
|
||||
|
|
|
@ -45,6 +45,8 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
|
|||
mGUIParameterA = (byte) aGUIParameterA;
|
||||
mGUIParameterB = (byte) aGUIParameterB;
|
||||
|
||||
|
||||
//TODO: CHECK
|
||||
if (aRecipe != null) {
|
||||
for (int i = 3; i < aRecipe.length; i++) {
|
||||
if (aRecipe[i] == X.CIRCUIT) {
|
||||
|
@ -73,6 +75,13 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
|
|||
case 6:
|
||||
case 7:
|
||||
case 8:
|
||||
case 9:
|
||||
case 10:
|
||||
case 11:
|
||||
case 12:
|
||||
case 13:
|
||||
case 14:
|
||||
case 15:
|
||||
aRecipe[i] = Ic2Items.reinforcedGlass;
|
||||
break;
|
||||
default:
|
||||
|
@ -110,7 +119,7 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
|
|||
aRecipe[i] = OrePrefixes.plate.get(Materials.Neutronium);
|
||||
break;
|
||||
default:
|
||||
aRecipe[i] = OrePrefixes.plate.get(Materials.TungstenSteel);
|
||||
aRecipe[i] = OrePrefixes.plate.get(Materials.Neutronium);
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
|
@ -144,7 +153,7 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
|
|||
aRecipe[i] = OrePrefixes.pipeLarge.get(Materials.Ultimate);
|
||||
break;
|
||||
default:
|
||||
aRecipe[i] = OrePrefixes.pipeMedium.get(Materials.TungstenSteel);
|
||||
aRecipe[i] = OrePrefixes.pipeMedium.get(Materials.Ultimate);
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
|
@ -178,7 +187,7 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
|
|||
aRecipe[i] = OrePrefixes.wireGt02.get(Materials.NaquadahAlloy);
|
||||
break;
|
||||
default:
|
||||
aRecipe[i] = OrePrefixes.wireGt08.get(Materials.Nichrome);
|
||||
aRecipe[i] = OrePrefixes.wireGt08.get(Materials.NaquadahAlloy);
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
|
@ -212,7 +221,7 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
|
|||
aRecipe[i] = OrePrefixes.wireGt04.get(Materials.NaquadahAlloy);
|
||||
break;
|
||||
default:
|
||||
aRecipe[i] = OrePrefixes.wireGt16.get(Materials.Nichrome);
|
||||
aRecipe[i] = OrePrefixes.wireGt16.get(Materials.NaquadahAlloy);
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
|
@ -686,5 +695,5 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_
|
|||
return !mSharedTank;
|
||||
}
|
||||
|
||||
public static enum X {PUMP, WIRE, WIRE4, HULL, PIPE, GLASS, PLATE, MOTOR, ROTOR, SENSOR, PISTON, CIRCUIT, EMITTER, CONVEYOR, ROBOT_ARM, COIL_HEATING, COIL_ELECTRIC, STICK_MAGNETIC, STICK_DISTILLATION, BETTER_CIRCUIT, FIELD_GENERATOR, COIL_HEATING_DOUBLE, STICK_ELECTROMAGNETIC;}
|
||||
public static enum X {PUMP, WIRE, WIRE4, HULL, PIPE, GLASS, PLATE, MOTOR, ROTOR, SENSOR, PISTON, CIRCUIT, EMITTER, CONVEYOR, ROBOT_ARM, COIL_HEATING, COIL_ELECTRIC, STICK_MAGNETIC, STICK_DISTILLATION, BETTER_CIRCUIT, FIELD_GENERATOR, COIL_HEATING_DOUBLE, STICK_ELECTROMAGNETIC}
|
||||
}
|
||||
|
|
|
@ -137,12 +137,12 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM
|
|||
|
||||
@Override
|
||||
public long getMinimumStoredEU() {
|
||||
return 512;
|
||||
return 512L;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long maxEUStore() {
|
||||
return 512 + V[mTier] * 50;
|
||||
return 512L + V[mTier] * 50L;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -152,7 +152,7 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM
|
|||
|
||||
@Override
|
||||
public long maxEUOutput() {
|
||||
return bOutput ? V[mTier] : 0;
|
||||
return bOutput ? V[mTier] : 0L;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -70,7 +70,7 @@ public class GT_MetaTileEntity_Hatch_Dynamo extends GT_MetaTileEntity_Hatch {
|
|||
|
||||
@Override
|
||||
public long maxEUStore() {
|
||||
return 512 + V[mTier + 1] * 2;
|
||||
return 512L + V[mTier + 1] * 2L;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -70,7 +70,7 @@ public class GT_MetaTileEntity_Hatch_Energy extends GT_MetaTileEntity_Hatch {
|
|||
|
||||
@Override
|
||||
public long maxEUStore() {
|
||||
return 512 + V[mTier] * 8;
|
||||
return 512L + V[mTier] * 8L;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package gregtech.api.metatileentity.implementations;
|
||||
|
||||
import gregtech.api.enums.GT_Values;
|
||||
import gregtech.api.interfaces.ITexture;
|
||||
import gregtech.api.metatileentity.MetaTileEntity;
|
||||
|
||||
|
@ -8,6 +9,7 @@ import static gregtech.api.enums.GT_Values.GT;
|
|||
public abstract class GT_MetaTileEntity_TieredMachineBlock extends MetaTileEntity {
|
||||
/**
|
||||
* Value between [0 - 9] to describe the Tier of this Machine.
|
||||
* PLZ [0-15] works - READ! GT_Values class.
|
||||
*/
|
||||
public final byte mTier;
|
||||
|
||||
|
@ -23,7 +25,7 @@ public abstract class GT_MetaTileEntity_TieredMachineBlock extends MetaTileEntit
|
|||
|
||||
public GT_MetaTileEntity_TieredMachineBlock(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String aDescription, ITexture... aTextures) {
|
||||
super(aID, aName, aNameRegional, aInvSlotCount);
|
||||
mTier = (byte) Math.max(0, Math.min(aTier, 9));
|
||||
mTier = (byte) Math.max(0, Math.min(aTier, 15));
|
||||
mDescription = aDescription;
|
||||
|
||||
// must always be the last call!
|
||||
|
|
|
@ -112,7 +112,7 @@ public class GT_MetaTileEntity_Transformer extends GT_MetaTileEntity_TieredMachi
|
|||
|
||||
@Override
|
||||
public long maxEUStore() {
|
||||
return 512 + V[mTier + 1] * 2;
|
||||
return 512L + V[mTier + 1] * 2L;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -127,12 +127,12 @@ public class GT_MetaTileEntity_Transformer extends GT_MetaTileEntity_TieredMachi
|
|||
|
||||
@Override
|
||||
public long maxAmperesOut() {
|
||||
return getBaseMetaTileEntity().isAllowedToWork() ? V[mTier + 1] / V[mTier] : 1;
|
||||
return getBaseMetaTileEntity().isAllowedToWork() ? (V[mTier + 1] / V[mTier] < 4 ? 4 : V[mTier + 1] / V[mTier]) : 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long maxAmperesIn() {
|
||||
return getBaseMetaTileEntity().isAllowedToWork() ? 1 : V[mTier + 1] / V[mTier];
|
||||
return getBaseMetaTileEntity().isAllowedToWork() ? 1 : (V[mTier + 1] / V[mTier] < 4 ? 4 : V[mTier + 1] / V[mTier]);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -156,7 +156,8 @@ public class GT_MetaTileEntity_Transformer extends GT_MetaTileEntity_TieredMachi
|
|||
aBaseMetaTileEntity.injectEnergyUnits((byte) 6, Math.min(tEU, maxEUInput()), 1);
|
||||
} else if (GregTech_API.mInputRF && GregTech_API.meIOLoaded && tTileEntity instanceof IPowerContainer && ((IPowerContainer) tTileEntity).getEnergyStored() > 0) {
|
||||
int storedRF = ((IPowerContainer) tTileEntity).getEnergyStored();
|
||||
int extractRF = (int) maxEUInput() * 100 / GregTech_API.mRFtoEU;
|
||||
long EXTRACTRF = maxEUInput() * 100 / GregTech_API.mRFtoEU;
|
||||
int extractRF = EXTRACTRF>Integer.MAX_VALUE ? Integer.MAX_VALUE : (int)EXTRACTRF;
|
||||
long tEU = 0;
|
||||
if (tTileEntity instanceof TileCapBank) {
|
||||
ICapBankNetwork network = ((TileCapBank) tTileEntity).getNetwork();
|
||||
|
|
|
@ -239,7 +239,7 @@ public class GT_MetaTileEntity_MagicalEnergyAbsorber extends GT_MetaTileEntity_B
|
|||
|
||||
@Override
|
||||
public long maxEUStore() {
|
||||
return Math.max(getEUVar(), V[mTier] * 16000 + getMinimumStoredEU());
|
||||
return Math.max(getEUVar(), V[mTier] * 16000L + getMinimumStoredEU());
|
||||
}
|
||||
|
||||
public ITexture[] getFront(byte aColor) {
|
||||
|
|
Loading…
Reference in a new issue