Fixes #976 Now uses GitHub to retrieve most current version
Reworked whole Version Checker with an extensible interface to add any other service later on easier. The version checker now has its own config file, to collect the different options and extract them from the main config file. In that you can specify how fine the versions should be checked.
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
package appeng.services.version;
|
||||
|
||||
|
||||
/**
|
||||
* AE prints version like rv2-beta-8
|
||||
* GitHub prints version like rv2.beta.8
|
||||
*/
|
||||
public final class DefaultVersion extends BaseVersion
|
||||
{
|
||||
/**
|
||||
* @param revision natural number
|
||||
* @param channel either alpha, beta or release
|
||||
* @param build natural number
|
||||
*/
|
||||
public DefaultVersion( int revision, Channel channel, int build )
|
||||
{
|
||||
super( revision, channel, build );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNewerAs( Version maybeOlder )
|
||||
{
|
||||
if ( this.revision() > maybeOlder.revision() )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if ( this.channel().compareTo( maybeOlder.channel() ) > 0 )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return this.build() > maybeOlder.build();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user