Added a method for calculating total version ID
This commit is contained in:
parent
a6046ddfad
commit
5d8bcb0af3
2 changed files with 12 additions and 4 deletions
|
@ -61,7 +61,7 @@ import java.util.regex.Pattern;
|
|||
@Mod(modid = "gregtech", name = "GregTech", version = "MC1710", useMetadata = false, dependencies = "required-after:IC2; after:Forestry; after:PFAAGeologica; after:Thaumcraft; after:Railcraft; after:appliedenergistics2; after:ThermalExpansion; after:TwilightForest; after:harvestcraft; after:magicalcrops; after:BuildCraft|Transport; after:BuildCraft|Silicon; after:BuildCraft|Factory; after:BuildCraft|Energy; after:BuildCraft|Core; after:BuildCraft|Builders; after:GalacticraftCore; after:GalacticraftMars; after:GalacticraftPlanets; after:ThermalExpansion|Transport; after:ThermalExpansion|Energy; after:ThermalExpansion|Factory; after:RedPowerCore; after:RedPowerBase; after:RedPowerMachine; after:RedPowerCompat; after:RedPowerWiring; after:RedPowerLogic; after:RedPowerLighting; after:RedPowerWorld; after:RedPowerControl; after:UndergroundBiomes;")
|
||||
public class GT_Mod implements IGT_Mod {
|
||||
public static final int VERSION = 509, SUBVERSION = 31;
|
||||
public static final int TOTAL_VERSION = 1000 * VERSION + SUBVERSION;
|
||||
public static final int TOTAL_VERSION = calculateTotalGTVersion(VERSION, SUBVERSION);
|
||||
public static final int REQUIRED_IC2 = 624;
|
||||
@Mod.Instance("gregtech")
|
||||
public static GT_Mod instance;
|
||||
|
@ -1163,4 +1163,11 @@ public class GT_Mod implements IGT_Mod {
|
|||
}
|
||||
}
|
||||
|
||||
public static int calculateTotalGTVersion(int minorVersion){
|
||||
return calculateTotalGTVersion(VERSION, minorVersion);
|
||||
}
|
||||
|
||||
public static int calculateTotalGTVersion(int majorVersion, int minorVersion){
|
||||
return majorVersion * 1000 + minorVersion;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1917,8 +1917,9 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE
|
|||
*/
|
||||
private int shiftInventoryIndex(int slotIndex, int nbtVersion){
|
||||
int oldInputSize, newInputSize, oldOutputSize, newOutputSize;
|
||||
int chemistryUpdateVersion = GT_Mod.calculateTotalGTVersion(509, 31);
|
||||
if (mID >= 211 && mID <= 218) {//Assembler
|
||||
if (nbtVersion < 509031) {
|
||||
if (nbtVersion < chemistryUpdateVersion) {
|
||||
oldInputSize = 2;
|
||||
oldOutputSize = 1;
|
||||
} else {
|
||||
|
@ -1927,7 +1928,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE
|
|||
newInputSize = 6;
|
||||
newOutputSize = 1;
|
||||
} else if (mID >= 421 && mID <= 428){//Chemical Reactor
|
||||
if (nbtVersion < 509031) {
|
||||
if (nbtVersion < chemistryUpdateVersion) {
|
||||
oldInputSize = 2;
|
||||
oldOutputSize = 1;
|
||||
} else {
|
||||
|
@ -1936,7 +1937,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE
|
|||
newInputSize = 2;
|
||||
newOutputSize = 2;
|
||||
} else if (mID >= 531 && mID <= 538) {//Distillery
|
||||
if (nbtVersion < 509031) {
|
||||
if (nbtVersion < chemistryUpdateVersion) {
|
||||
oldInputSize = 1;
|
||||
oldOutputSize = 0;
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue