diff --git a/Artifacts/SubServers.Bungee.jar b/Artifacts/SubServers.Bungee.jar index b694e35f..d27267cd 100644 Binary files a/Artifacts/SubServers.Bungee.jar and b/Artifacts/SubServers.Bungee.jar differ diff --git a/Artifacts/SubServers.Client.Bukkit.jar b/Artifacts/SubServers.Client.Bukkit.jar index 02e8d6ec..a011a54d 100644 Binary files a/Artifacts/SubServers.Client.Bukkit.jar and b/Artifacts/SubServers.Client.Bukkit.jar differ diff --git a/Artifacts/SubServers.Host.jar b/Artifacts/SubServers.Host.jar index 55aa9469..35596265 100644 Binary files a/Artifacts/SubServers.Host.jar and b/Artifacts/SubServers.Host.jar differ diff --git a/Artifacts/SubServers.Sync.jar b/Artifacts/SubServers.Sync.jar index d69283ea..5e28ca14 100644 Binary files a/Artifacts/SubServers.Sync.jar and b/Artifacts/SubServers.Sync.jar differ diff --git a/Javadoc/SubServers.Bungee.jar b/Javadoc/SubServers.Bungee.jar index 1c0f0cde..58c16798 100644 Binary files a/Javadoc/SubServers.Bungee.jar and b/Javadoc/SubServers.Bungee.jar differ diff --git a/Javadoc/SubServers.Bungee/allclasses-frame.html b/Javadoc/SubServers.Bungee/allclasses-frame.html index e44e086f..91949e14 100644 --- a/Javadoc/SubServers.Bungee/allclasses-frame.html +++ b/Javadoc/SubServers.Bungee/allclasses-frame.html @@ -109,6 +109,7 @@
  • Util.ExceptionRunnable
  • Util.ReturnRunnable
  • Version
  • +
  • Version.VersionType
  • YAMLConfig
  • YAMLSection
  • YAMLValue
  • diff --git a/Javadoc/SubServers.Bungee/allclasses-noframe.html b/Javadoc/SubServers.Bungee/allclasses-noframe.html index cb3231ed..5d9dad7d 100644 --- a/Javadoc/SubServers.Bungee/allclasses-noframe.html +++ b/Javadoc/SubServers.Bungee/allclasses-noframe.html @@ -109,6 +109,7 @@
  • Util.ExceptionRunnable
  • Util.ReturnRunnable
  • Version
  • +
  • Version.VersionType
  • YAMLConfig
  • YAMLSection
  • YAMLValue
  • diff --git a/Javadoc/SubServers.Bungee/index-all.html b/Javadoc/SubServers.Bungee/index-all.html index e2c78365..50b999c2 100644 --- a/Javadoc/SubServers.Bungee/index-all.html +++ b/Javadoc/SubServers.Bungee/index-all.html @@ -296,8 +296,6 @@
    Broadcast a Packet to everything on the Network
    Warning: There are usually different types of applications on the network at once, they may not recognise the same packet handles
    -
    bversion - Variable in class net.ME1312.SubServers.Bungee.SubPlugin
    -
     
    @@ -832,10 +830,6 @@
    Gets the Git Bash install directory
    -
    getBetaVersion() - Method in class net.ME1312.SubServers.Bungee.SubAPI
    -
    -
    Gets the SubServers Beta Version
    -
    getBoolean(String) - Method in class net.ME1312.SubServers.Bungee.Library.Config.YAMLSection
    Get a Boolean by Handle
    @@ -3310,10 +3304,31 @@
    Terminates the Server
    +
    toExtendedString() - Method in class net.ME1312.SubServers.Bungee.Library.Version.Version
    +
    +
    The extended toString() method
    +
    + new Version(new Version("1.0.0"), VersionType.PRE_ALPHA, "7") would return:
    + 1.0.0 pre-alpha 7
    +
    toFile() - Method in class net.ME1312.SubServers.Bungee.Host.Executable
    Get Executable File
    +
    toFullExtendedString() - Method in class net.ME1312.SubServers.Bungee.Library.Version.Version
    +
    +
    The full extended toString() method
    +
    + new Version(new Version("1.0.0"), VersionType.PRE_ALPHA, "7") would return:
    + release 1.0.0 pre-alpha 7
    +
    +
    toFullString() - Method in class net.ME1312.SubServers.Bungee.Library.Version.Version
    +
    +
    The full toString() method
    +
    + new Version(new Version("1.0.0"), VersionType.PRE_ALPHA, "7") would return:
    + r1.0.0/pa7
    +
    toggleCompatibility(SubServer...) - Method in interface net.ME1312.SubServers.Bungee.Host.SubServer
    Toggles compatibility with other Servers
    @@ -3351,7 +3366,12 @@
    toString() - Method in class net.ME1312.SubServers.Bungee.Library.Config.YAMLValue
     
    toString() - Method in class net.ME1312.SubServers.Bungee.Library.Version.Version
    -
     
    +
    +
    The default toString() method
    +
    + new Version(new Version("1.0.0"), VersionType.PRE_ALPHA, "7") would return:
    + 1.0.0/pa7
    +
    @@ -3430,6 +3450,10 @@
    Returns the enum constant of this type with the specified name.
    +
    valueOf(String) - Static method in enum net.ME1312.SubServers.Bungee.Library.Version.Version.VersionType
    +
    +
    Returns the enum constant of this type with the specified name.
    +
    valueOf(String) - Static method in enum net.ME1312.SubServers.Bungee.Network.Packet.PacketExUpdateServer.UpdateType
    Returns the enum constant of this type with the specified name.
    @@ -3439,6 +3463,11 @@
    Returns an array containing the constants of this enum type, in the order they are declared.
    +
    values() - Static method in enum net.ME1312.SubServers.Bungee.Library.Version.Version.VersionType
    +
    +
    Returns an array containing the constants of this enum type, in +the order they are declared.
    +
    values() - Static method in enum net.ME1312.SubServers.Bungee.Network.Packet.PacketExUpdateServer.UpdateType
    Returns an array containing the constants of this enum type, in @@ -3452,11 +3481,37 @@ the order they are declared.
    Creates a Version
    -
    Version(Integer...) - Constructor for class net.ME1312.SubServers.Bungee.Library.Version.Version
    +
    Version(Version.VersionType, String) - Constructor for class net.ME1312.SubServers.Bungee.Library.Version.Version
    Creates a Version
    -
    version - Variable in class net.ME1312.SubServers.Bungee.SubPlugin
    +
    Version(Version, String) - Constructor for class net.ME1312.SubServers.Bungee.Library.Version.Version
    +
    +
    Creates a Version (Prepending the parent)
    +
    +
    Version(Version, Version.VersionType, String) - Constructor for class net.ME1312.SubServers.Bungee.Library.Version.Version
    +
    +
    Creates a Version (Prepending the parent)
    +
    +
    Version(int...) - Constructor for class net.ME1312.SubServers.Bungee.Library.Version.Version
    +
    +
    Creates a Version
    +
    +
    Version(Version.VersionType, int...) - Constructor for class net.ME1312.SubServers.Bungee.Library.Version.Version
    +
    +
    Creates a Version
    +
    +
    Version(Version, int...) - Constructor for class net.ME1312.SubServers.Bungee.Library.Version.Version
    +
    +
    Creates a Version (Prepending the parent)
    +
    +
    Version(Version, Version.VersionType, int...) - Constructor for class net.ME1312.SubServers.Bungee.Library.Version.Version
    +
    +
    Creates a Version (Prepending the parent)
    +
    +
    version - Static variable in class net.ME1312.SubServers.Bungee.SubPlugin
    +
     
    +
    Version.VersionType - Enum in net.ME1312.SubServers.Bungee.Library.Version
     
    diff --git a/Javadoc/SubServers.Bungee/net/ME1312/SubServers/Bungee/Library/Version/Version.VersionType.html b/Javadoc/SubServers.Bungee/net/ME1312/SubServers/Bungee/Library/Version/Version.VersionType.html new file mode 100644 index 00000000..80f27511 --- /dev/null +++ b/Javadoc/SubServers.Bungee/net/ME1312/SubServers/Bungee/Library/Version/Version.VersionType.html @@ -0,0 +1,402 @@ + + + + + +Version.VersionType (SubServers.Bungee) + + + + + + + +
    + + +
    Skip navigation links
    + + + + +
    + + + +
    +
    net.ME1312.SubServers.Bungee.Library.Version
    +

    Enum Version.VersionType

    +
    +
    + +
    + +
    +
    + +
    +
    + +
    +
    + + +
    + + +
    Skip navigation links
    + + + + +
    + + + + diff --git a/Javadoc/SubServers.Bungee/net/ME1312/SubServers/Bungee/Library/Version/Version.html b/Javadoc/SubServers.Bungee/net/ME1312/SubServers/Bungee/Library/Version/Version.html index 9d197588..a5ab15b7 100644 --- a/Javadoc/SubServers.Bungee/net/ME1312/SubServers/Bungee/Library/Version/Version.html +++ b/Javadoc/SubServers.Bungee/net/ME1312/SubServers/Bungee/Library/Version/Version.html @@ -17,7 +17,7 @@ catch(err) { } //--> -var methods = {"i0":9,"i1":10,"i2":10,"i3":10,"i4":9,"i5":10}; +var methods = {"i0":9,"i1":10,"i2":10,"i3":10,"i4":9,"i5":10,"i6":10,"i7":10,"i8":10}; var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; @@ -48,7 +48,7 @@ var activeTableTab = "activeTableTab"; diff --git a/Javadoc/SubServers.Bungee/net/ME1312/SubServers/Bungee/Library/Version/package-summary.html b/Javadoc/SubServers.Bungee/net/ME1312/SubServers/Bungee/Library/Version/package-summary.html index 82095d15..f74c0a26 100644 --- a/Javadoc/SubServers.Bungee/net/ME1312/SubServers/Bungee/Library/Version/package-summary.html +++ b/Javadoc/SubServers.Bungee/net/ME1312/SubServers/Bungee/Library/Version/package-summary.html @@ -89,6 +89,21 @@ +
  • + + + + + + + + + + + + +
    Enum Summary 
    EnumDescription
    Version.VersionType 
    +
  • diff --git a/Javadoc/SubServers.Bungee/net/ME1312/SubServers/Bungee/Library/Version/package-tree.html b/Javadoc/SubServers.Bungee/net/ME1312/SubServers/Bungee/Library/Version/package-tree.html index 4ab7ad8a..e7b366db 100644 --- a/Javadoc/SubServers.Bungee/net/ME1312/SubServers/Bungee/Library/Version/package-tree.html +++ b/Javadoc/SubServers.Bungee/net/ME1312/SubServers/Bungee/Library/Version/package-tree.html @@ -83,6 +83,18 @@ +

    Enum Hierarchy

    +
    diff --git a/Javadoc/SubServers.Bungee/net/ME1312/SubServers/Bungee/SubAPI.html b/Javadoc/SubServers.Bungee/net/ME1312/SubServers/Bungee/SubAPI.html index efee8971..d2746484 100644 --- a/Javadoc/SubServers.Bungee/net/ME1312/SubServers/Bungee/SubAPI.html +++ b/Javadoc/SubServers.Bungee/net/ME1312/SubServers/Bungee/SubAPI.html @@ -17,7 +17,7 @@ catch(err) { } //--> -var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":9,"i24":42,"i25":10,"i26":10,"i27":10,"i28":10,"i29":10,"i30":10,"i31":10,"i32":10,"i33":10,"i34":10,"i35":10,"i36":10,"i37":10,"i38":10,"i39":10,"i40":10,"i41":10,"i42":10,"i43":10,"i44":10,"i45":10,"i46":10,"i47":10}; +var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":9,"i23":42,"i24":10,"i25":10,"i26":10,"i27":10,"i28":10,"i29":10,"i30":10,"i31":10,"i32":10,"i33":10,"i34":10,"i35":10,"i36":10,"i37":10,"i38":10,"i39":10,"i40":10,"i41":10,"i42":10,"i43":10,"i44":10,"i45":10,"i46":10}; var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"],32:["t6","Deprecated Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; @@ -260,59 +260,53 @@ extends java.lang.Object Version -getBetaVersion() -
    Gets the SubServers Beta Version
    - - - -Version getGameVersion()
    Gets the Recommended Minecraft Version
    - + java.util.Collection<NamedContainer<java.lang.String,java.util.UUID>> getGlobalPlayers()
    Get players on this network across all known proxies
    - + java.util.List<Server> getGroup(java.lang.String name)
    Gets a Server Group (Group names are case insensitive here)
    - + java.util.Map<java.lang.String,java.util.List<Server>> getGroups()
    Gets the Server Groups (Group names are case sensitive here)
    - + Host getHost(java.lang.String name)
    Gets a Host
    - + java.util.List<java.lang.String> getHostDrivers()
    Get a list of all available Host Drivers
    - + java.util.Map<java.lang.String,Host> getHosts()
    Gets the Hosts
    - + static SubAPI getInstance()
    Gets the SubAPI Methods
    - + SubPlugin getInternals()
    Deprecated.  @@ -320,130 +314,130 @@ extends java.lang.Object
    - + java.util.Map<java.lang.String,java.lang.String> getLang(java.lang.String channel)
    Gets values from the SubServers Lang
    - + java.lang.String getLang(java.lang.String channel, java.lang.String key)
    Gets a value from the SubServers Lang
    - + java.util.Collection<java.lang.String> getLangChannels()
    Gets the current SubServers Lang Channels
    - + java.util.Map<java.lang.String,java.util.List<Server>> getLowercaseGroups()
    Gets the Server Groups (Group names are all lowercase here)
    - + <R> R getObjectBySignature(java.lang.String signature)
    Get an Object by it's Signature
    - + java.util.Map<java.lang.String,Proxy> getProxies()
    Gets the known Proxies
    - + Proxy getProxy(java.lang.String name)
    Gets a Proxy
    - + Version getProxyVersion()
    Gets the BungeeCord Version
    - + UniversalFile getRuntimeDirectory()
    Gets the Runtime Directory
    - + Server getServer(java.lang.String name)
    Gets a Server
    - + java.util.Map<java.lang.String,Server> getServers()
    Gets the Servers (including SubServers)
    - + SubDataServer getSubDataNetwork()
    Gets the SubData Network Manager
    - + SubServer getSubServer(java.lang.String name)
    Gets a SubServer
    - + java.util.Map<java.lang.String,SubServer> getSubServers()
    Gets the SubServers
    - + Version getWrapperVersion()
    Gets the SubServers Version
    - + void invalidateObjectSignature(java.lang.String signature)
    Invalidate an Object Signature.
    - + boolean removeHost(java.lang.String name)
    Remove a Host from the Network
    - + boolean removeHost(java.util.UUID player, java.lang.String name)
    Remove a Host from the Network
    - + boolean removeServer(java.lang.String name)
    Remove a Server from the Network
    - + boolean removeServer(java.util.UUID player, java.lang.String name)
    Remove a Server from the Network
    - + void setLang(java.lang.String channel, java.lang.String key, @@ -451,13 +445,13 @@ extends java.lang.Object
    Adds to the SubServers Lang
    - + java.lang.String signAnonymousObject()
    Get an Object Signature without linking the Signature to any object
    - + java.lang.String signObject(java.lang.Object object)
    Signs an Object
    @@ -1281,20 +1275,6 @@ public  - - - - diff --git a/Javadoc/SubServers.Bungee/net/ME1312/SubServers/Bungee/SubPlugin.html b/Javadoc/SubServers.Bungee/net/ME1312/SubServers/Bungee/SubPlugin.html index 4b2559b5..132c04a5 100644 --- a/Javadoc/SubServers.Bungee/net/ME1312/SubServers/Bungee/SubPlugin.html +++ b/Javadoc/SubServers.Bungee/net/ME1312/SubServers/Bungee/SubPlugin.html @@ -148,55 +148,51 @@ implements net.md_5.bungee.api.plugin.Listener api  -Version -bversion  - - YAMLConfig config  - + UniversalFile dir  - + java.util.HashMap<java.lang.String,Server> exServers  - + java.util.HashMap<java.lang.String,Host> hosts  - + YAMLConfig langconfig  - + java.io.PrintStream out  - + java.util.HashMap<java.lang.String,Proxy> proxies  - + boolean redis  - + long resetDate  - + SubDataServer subdata  - + SubServer sudo  - -Version + +static Version version  @@ -404,16 +400,7 @@ implements net.md_5.bungee.api.plugin.Listener - - - - diff --git a/Javadoc/SubServers.Bungee/overview-tree.html b/Javadoc/SubServers.Bungee/overview-tree.html index 39a8c760..4c19cbde 100644 --- a/Javadoc/SubServers.Bungee/overview-tree.html +++ b/Javadoc/SubServers.Bungee/overview-tree.html @@ -290,6 +290,7 @@
  • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable)
  • diff --git a/Javadoc/SubServers.Bungee/serialized-form.html b/Javadoc/SubServers.Bungee/serialized-form.html index 61b48120..81c44b2e 100644 --- a/Javadoc/SubServers.Bungee/serialized-form.html +++ b/Javadoc/SubServers.Bungee/serialized-form.html @@ -157,6 +157,14 @@
  • Serialized Fields

  • diff --git a/Javadoc/SubServers.Client.Bukkit/net/ME1312/SubServers/Client/Bukkit/Library/Version/package-tree.html b/Javadoc/SubServers.Client.Bukkit/net/ME1312/SubServers/Client/Bukkit/Library/Version/package-tree.html index e3206c88..c70e23ff 100644 --- a/Javadoc/SubServers.Client.Bukkit/net/ME1312/SubServers/Client/Bukkit/Library/Version/package-tree.html +++ b/Javadoc/SubServers.Client.Bukkit/net/ME1312/SubServers/Client/Bukkit/Library/Version/package-tree.html @@ -83,6 +83,18 @@ +

    Enum Hierarchy

    +
    diff --git a/Javadoc/SubServers.Client.Bukkit/net/ME1312/SubServers/Client/Bukkit/SubAPI.html b/Javadoc/SubServers.Client.Bukkit/net/ME1312/SubServers/Client/Bukkit/SubAPI.html index cf18bff5..6322f965 100644 --- a/Javadoc/SubServers.Client.Bukkit/net/ME1312/SubServers/Client/Bukkit/SubAPI.html +++ b/Javadoc/SubServers.Client.Bukkit/net/ME1312/SubServers/Client/Bukkit/SubAPI.html @@ -17,7 +17,7 @@ catch(err) { } //--> -var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":9,"i5":42,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10}; +var methods = {"i0":10,"i1":10,"i2":10,"i3":9,"i4":42,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10}; var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"],32:["t6","Deprecated Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; @@ -136,29 +136,23 @@ extends java.lang.Object Version -getBetaVersion() -
    Gets the SubServers Beta Version
    - - - -Version getGameVersion()
    Gets the Minecraft Version
    - + UIHandler getGraphicHandler()
    Gets the Graphics Handler
    - + static SubAPI getInstance()
    Gets the SubAPI Methods
    - + SubPlugin getInternals()
    Deprecated.  @@ -166,44 +160,44 @@ extends java.lang.Object
    - + java.util.Map<java.lang.String,java.lang.String> getLang(java.lang.String channel)
    Gets values from the SubServers Lang
    - + java.lang.String getLang(java.lang.String channel, java.lang.String key)
    Gets a value from the SubServers Lang
    - + java.util.Collection<java.lang.String> getLangChannels()
    Gets the current SubServers Lang Channels
    - + Version getPluginVersion()
    Gets the SubServers Version
    - + Version getServerVersion()
    Gets the Server Version
    - + SubDataClient getSubDataNetwork()
    Gets the SubData Network Manager
    - + void setGraphicHandler(UIHandler graphics)
    Sets the Graphics Handler for SubServers to use
    @@ -365,20 +359,6 @@ public  - - - diff --git a/Javadoc/SubServers.Client.Bukkit/net/ME1312/SubServers/Client/Bukkit/SubPlugin.html b/Javadoc/SubServers.Client.Bukkit/net/ME1312/SubServers/Client/Bukkit/SubPlugin.html index 347a4538..44f42b6e 100644 --- a/Javadoc/SubServers.Client.Bukkit/net/ME1312/SubServers/Client/Bukkit/SubPlugin.html +++ b/Javadoc/SubServers.Client.Bukkit/net/ME1312/SubServers/Client/Bukkit/SubPlugin.html @@ -147,22 +147,18 @@ extends org.bukkit.plugin.java.JavaPlugin api  -Version -bversion  - - YAMLConfig config  - + UIHandler gui  - + SubDataClient subdata  - + Version version  @@ -286,15 +282,6 @@ extends org.bukkit.plugin.java.JavaPlugin
    public final Version version
    - - - - diff --git a/Javadoc/SubServers.Client.Bukkit/overview-tree.html b/Javadoc/SubServers.Client.Bukkit/overview-tree.html index 4cc6fcf6..eb32d184 100644 --- a/Javadoc/SubServers.Client.Bukkit/overview-tree.html +++ b/Javadoc/SubServers.Client.Bukkit/overview-tree.html @@ -196,6 +196,18 @@
  • net.ME1312.SubServers.Client.Bukkit.Library.Util.ExceptionRunnable
  • net.ME1312.SubServers.Client.Bukkit.Library.Util.ReturnRunnable<R>
  • +

    Enum Hierarchy

    +
    diff --git a/Javadoc/SubServers.Client.Bukkit/serialized-form.html b/Javadoc/SubServers.Client.Bukkit/serialized-form.html index 2b07a814..6812ad8e 100644 --- a/Javadoc/SubServers.Client.Bukkit/serialized-form.html +++ b/Javadoc/SubServers.Client.Bukkit/serialized-form.html @@ -103,6 +103,14 @@
  • Serialized Fields

  • Returns an array containing the constants of this enum type, in the order they are declared.
    +
    values() - Static method in enum net.ME1312.SubServers.Host.Library.Version.Version.VersionType
    +
    +
    Returns an array containing the constants of this enum type, in +the order they are declared.
    +
    values() - Static method in enum net.ME1312.SubServers.Host.Network.Packet.PacketExUpdateServer.UpdateType
    Returns an array containing the constants of this enum type, in @@ -2421,10 +2454,36 @@ the order they are declared.
    Creates a Version
    -
    Version(Integer...) - Constructor for class net.ME1312.SubServers.Host.Library.Version.Version
    +
    Version(Version.VersionType, String) - Constructor for class net.ME1312.SubServers.Host.Library.Version.Version
    Creates a Version
    +
    Version(Version, String) - Constructor for class net.ME1312.SubServers.Host.Library.Version.Version
    +
    +
    Creates a Version (Prepending the parent)
    +
    +
    Version(Version, Version.VersionType, String) - Constructor for class net.ME1312.SubServers.Host.Library.Version.Version
    +
    +
    Creates a Version (Prepending the parent)
    +
    +
    Version(int...) - Constructor for class net.ME1312.SubServers.Host.Library.Version.Version
    +
    +
    Creates a Version
    +
    +
    Version(Version.VersionType, int...) - Constructor for class net.ME1312.SubServers.Host.Library.Version.Version
    +
    +
    Creates a Version
    +
    +
    Version(Version, int...) - Constructor for class net.ME1312.SubServers.Host.Library.Version.Version
    +
    +
    Creates a Version (Prepending the parent)
    +
    +
    Version(Version, Version.VersionType, int...) - Constructor for class net.ME1312.SubServers.Host.Library.Version.Version
    +
    +
    Creates a Version (Prepending the parent)
    +
    +
    Version.VersionType - Enum in net.ME1312.SubServers.Host.Library.Version
    +
     
    VersionTokenizer - Class in net.ME1312.SubServers.Host.Library.Version
     
    VERY_EARLY - Static variable in class net.ME1312.SubServers.Host.Library.Event.EventOrder
    diff --git a/Javadoc/SubServers.Host/net/ME1312/SubServers/Host/ExHost.html b/Javadoc/SubServers.Host/net/ME1312/SubServers/Host/ExHost.html index 73532d43..c27d4219 100644 --- a/Javadoc/SubServers.Host/net/ME1312/SubServers/Host/ExHost.html +++ b/Javadoc/SubServers.Host/net/ME1312/SubServers/Host/ExHost.html @@ -133,42 +133,38 @@ extends java.lang.Object api  -Version -bversion  - - YAMLConfig config  - + SubCreator creator  - + UniversalFile dir  - + YAMLSection host  - + Logger log  - + java.util.HashMap<java.lang.String,SubServer> servers  - + SubDataClient subdata  - + java.util.HashMap<java.lang.String,SubCreator.ServerTemplate> templates  - + Version version  @@ -306,15 +302,6 @@ extends java.lang.Object
    public final Version version
    - - - - diff --git a/Javadoc/SubServers.Host/net/ME1312/SubServers/Host/Library/PluginClassLoader.html b/Javadoc/SubServers.Host/net/ME1312/SubServers/Host/Library/PluginClassLoader.html index 94cd019a..926c8bd6 100644 --- a/Javadoc/SubServers.Host/net/ME1312/SubServers/Host/Library/PluginClassLoader.html +++ b/Javadoc/SubServers.Host/net/ME1312/SubServers/Host/Library/PluginClassLoader.html @@ -174,11 +174,15 @@ extends java.net.URLClassLoader java.lang.Class<?> -getDefaultClass()  +getDefaultClass() +
    Get the Default Class to load when no class is found
    + void -setDefaultClass(java.lang.Class<?> clazz)  +setDefaultClass(java.lang.Class<?> clazz) +
    Set the Default Class to load when no class is found
    + @@ -271,9 +280,12 @@ extends java.net.URLClassLoader

    getDefaultClass

    public java.lang.Class<?> getDefaultClass()
                                        throws java.lang.ClassNotFoundException
    +
    Get the Default Class to load when no class is found
    +
    Returns:
    +
    Default Class
    Throws:
    -
    java.lang.ClassNotFoundException
    +
    java.lang.ClassNotFoundException - when no Default Class is set
    diff --git a/Javadoc/SubServers.Host/net/ME1312/SubServers/Host/Library/Version/Version.VersionType.html b/Javadoc/SubServers.Host/net/ME1312/SubServers/Host/Library/Version/Version.VersionType.html new file mode 100644 index 00000000..ce1729d1 --- /dev/null +++ b/Javadoc/SubServers.Host/net/ME1312/SubServers/Host/Library/Version/Version.VersionType.html @@ -0,0 +1,402 @@ + + + + + +Version.VersionType (SubServers.Host) + + + + + + + +
    + + + + + + + +
    + + + +
    +
    net.ME1312.SubServers.Host.Library.Version
    +

    Enum Version.VersionType

    +
    +
    + +
    + +
    +
    +
      +
    • + + + +
        +
      • + + +

        Method Summary

        + + + + + + + + + + + + + + +
        All Methods Static Methods Concrete Methods 
        Modifier and TypeMethod and Description
        static Version.VersionTypevalueOf(java.lang.String name) +
        Returns the enum constant of this type with the specified name.
        +
        static Version.VersionType[]values() +
        Returns an array containing the constants of this enum type, in +the order they are declared.
        +
        +
          +
        • + + +

          Methods inherited from class java.lang.Enum

          +compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
        • +
        +
          +
        • + + +

          Methods inherited from class java.lang.Object

          +getClass, notify, notifyAll, wait, wait, wait
        • +
        +
      • +
      +
    • +
    +
    +
    +
      +
    • + + + +
        +
      • + + +

        Method Detail

        + + + +
          +
        • +

          values

          +
          public static Version.VersionType[] values()
          +
          Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
          +for (Version.VersionType c : Version.VersionType.values())
          +    System.out.println(c);
          +
          +
          +
          Returns:
          +
          an array containing the constants of this enum type, in the order they are declared
          +
          +
        • +
        + + + +
          +
        • +

          valueOf

          +
          public static Version.VersionType valueOf(java.lang.String name)
          +
          Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
          +
          +
          Parameters:
          +
          name - the name of the enum constant to be returned.
          +
          Returns:
          +
          the enum constant with the specified name
          +
          Throws:
          +
          java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
          +
          java.lang.NullPointerException - if the argument is null
          +
          +
        • +
        +
      • +
      +
    • +
    +
    +
    + + +
    + + + + + + + +
    + + + + diff --git a/Javadoc/SubServers.Host/net/ME1312/SubServers/Host/Library/Version/Version.html b/Javadoc/SubServers.Host/net/ME1312/SubServers/Host/Library/Version/Version.html index 834aff4c..a0404d50 100644 --- a/Javadoc/SubServers.Host/net/ME1312/SubServers/Host/Library/Version/Version.html +++ b/Javadoc/SubServers.Host/net/ME1312/SubServers/Host/Library/Version/Version.html @@ -17,7 +17,7 @@ catch(err) { } //--> -var methods = {"i0":9,"i1":10,"i2":10,"i3":10,"i4":9,"i5":10}; +var methods = {"i0":9,"i1":10,"i2":10,"i3":10,"i4":9,"i5":10,"i6":10,"i7":10,"i8":10}; var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; @@ -48,7 +48,7 @@ var activeTableTab = "activeTableTab"; diff --git a/Javadoc/SubServers.Host/net/ME1312/SubServers/Host/Library/Version/package-summary.html b/Javadoc/SubServers.Host/net/ME1312/SubServers/Host/Library/Version/package-summary.html index 829c6942..0409ef30 100644 --- a/Javadoc/SubServers.Host/net/ME1312/SubServers/Host/Library/Version/package-summary.html +++ b/Javadoc/SubServers.Host/net/ME1312/SubServers/Host/Library/Version/package-summary.html @@ -93,6 +93,21 @@ +
  • + + + + + + + + + + + + +
    Enum Summary 
    EnumDescription
    Version.VersionType 
    +
  • diff --git a/Javadoc/SubServers.Host/net/ME1312/SubServers/Host/Library/Version/package-tree.html b/Javadoc/SubServers.Host/net/ME1312/SubServers/Host/Library/Version/package-tree.html index 184647c2..92a6643f 100644 --- a/Javadoc/SubServers.Host/net/ME1312/SubServers/Host/Library/Version/package-tree.html +++ b/Javadoc/SubServers.Host/net/ME1312/SubServers/Host/Library/Version/package-tree.html @@ -84,6 +84,18 @@ +

    Enum Hierarchy

    +
    diff --git a/Javadoc/SubServers.Host/net/ME1312/SubServers/Host/SubAPI.html b/Javadoc/SubServers.Host/net/ME1312/SubServers/Host/SubAPI.html index c436e54c..0be66876 100644 --- a/Javadoc/SubServers.Host/net/ME1312/SubServers/Host/SubAPI.html +++ b/Javadoc/SubServers.Host/net/ME1312/SubServers/Host/SubAPI.html @@ -17,7 +17,7 @@ catch(err) { } //--> -var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":9,"i7":42,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10}; +var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":9,"i6":42,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10}; var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"],32:["t6","Deprecated Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; @@ -161,18 +161,12 @@ extends java.lang.Object -Version -getBetaVersion() -
    Gets the SubServers Beta Version
    - - - static SubAPI getInstance()
    Gets the SubAPI Methods
    - + ExHost getInternals()
    Deprecated.  @@ -180,70 +174,70 @@ extends java.lang.Object
    - + java.util.Map<java.lang.String,java.lang.String> getLang(java.lang.String channel)
    Gets values from the SubServers Lang
    - + java.lang.String getLang(java.lang.String channel, java.lang.String key)
    Gets a value from the SubServers Lang
    - + java.util.Collection<java.lang.String> getLangChannels()
    Gets the current SubServers Lang Channels
    - + SubPluginInfo getPlugin(java.lang.String plugin)
    Gets a Plugin
    - + java.util.Map<java.lang.String,SubPluginInfo> getPlugins()
    Get a map of the Plugins
    - + UniversalFile getRuntimeDirectory()
    Gets the Runtime Directory
    - + SubDataClient getSubDataNetwork()
    Gets the SubData Network Manager
    - + void removeCommand(java.lang.String... handles)
    Unregisters a Command
    - + void removeListener(SubPluginInfo plugin, java.lang.Object... listeners)
    Unregister SubEvent Listeners
    - + java.util.UUID schedule(SubPluginInfo plugin, java.lang.Runnable run)
    Schedule a task
    - + java.util.UUID schedule(SubPluginInfo plugin, java.lang.Runnable run, @@ -251,7 +245,7 @@ extends java.lang.Object
    Schedule a task
    - + java.util.UUID schedule(SubPluginInfo plugin, java.lang.Runnable run, @@ -260,7 +254,7 @@ extends java.lang.Object
    Schedule a task
    - + java.util.UUID schedule(SubPluginInfo plugin, java.lang.Runnable run, @@ -270,7 +264,7 @@ extends java.lang.Object
    Schedule a task
    - + java.util.UUID schedule(SubTask builder)
    Schedule a task
    @@ -624,20 +618,6 @@ public  - - -
      -
    • -

      getBetaVersion

      -
      public Version getBetaVersion()
      -
      Gets the SubServers Beta Version
      -
      -
      Returns:
      -
      SubServers Beta Version (or null if this is a release version)
      -
      -
    • -
    diff --git a/Javadoc/SubServers.Host/overview-tree.html b/Javadoc/SubServers.Host/overview-tree.html index 8e261b4a..f39deb7f 100644 --- a/Javadoc/SubServers.Host/overview-tree.html +++ b/Javadoc/SubServers.Host/overview-tree.html @@ -261,6 +261,7 @@ diff --git a/Javadoc/SubServers.Host/serialized-form.html b/Javadoc/SubServers.Host/serialized-form.html index 7e56caff..0ffd1457 100644 --- a/Javadoc/SubServers.Host/serialized-form.html +++ b/Javadoc/SubServers.Host/serialized-form.html @@ -157,6 +157,14 @@
  • Serialized Fields

  • diff --git a/Javadoc/SubServers.Sync/net/ME1312/SubServers/Sync/Library/Version/package-tree.html b/Javadoc/SubServers.Sync/net/ME1312/SubServers/Sync/Library/Version/package-tree.html index 5aa5dce2..86d88c08 100644 --- a/Javadoc/SubServers.Sync/net/ME1312/SubServers/Sync/Library/Version/package-tree.html +++ b/Javadoc/SubServers.Sync/net/ME1312/SubServers/Sync/Library/Version/package-tree.html @@ -83,6 +83,18 @@ +

    Enum Hierarchy

    +
      +
    • java.lang.Object +
        +
      • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable) + +
      • +
      +
    • +
    diff --git a/Javadoc/SubServers.Sync/net/ME1312/SubServers/Sync/SubAPI.html b/Javadoc/SubServers.Sync/net/ME1312/SubServers/Sync/SubAPI.html index e3ea0957..b92a0115 100644 --- a/Javadoc/SubServers.Sync/net/ME1312/SubServers/Sync/SubAPI.html +++ b/Javadoc/SubServers.Sync/net/ME1312/SubServers/Sync/SubAPI.html @@ -17,7 +17,7 @@ catch(err) { } //--> -var methods = {"i0":10,"i1":10,"i2":10,"i3":9,"i4":42,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10}; +var methods = {"i0":10,"i1":10,"i2":9,"i3":42,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10}; var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"],32:["t6","Deprecated Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; @@ -137,23 +137,17 @@ extends java.lang.Object Version -getBetaVersion() -
    Gets the SubServers.Sync Beta Version
    - - - -Version getGameVersion()
    Gets the Latest Supported Minecraft Version
    - + static SubAPI getInstance()
    Gets the SubAPI Methods
    - + SubPlugin getInternals()
    Deprecated.  @@ -161,56 +155,56 @@ extends java.lang.Object
    - + java.util.Map<java.lang.String,java.lang.String> getLang(java.lang.String channel)
    Gets values from the SubServers Lang
    - + java.lang.String getLang(java.lang.String channel, java.lang.String key)
    Gets a value from the SubServers Lang
    - + java.util.Collection<java.lang.String> getLangChannels()
    Gets the current SubServers Lang Channels
    - + Version getProxyVersion()
    Gets the BungeeCord Version
    - + UniversalFile getRuntimeDirectory()
    Gets the Runtime Directory
    - + Server getServer(java.lang.String name)
    Gets a Server
    - + java.util.Map<java.lang.String,Server> getServers()
    Gets the Servers (including SubServers)
    - + SubDataClient getSubDataNetwork()
    Gets the SubData Network Manager
    - + Version getWrapperVersion()
    Gets the SubServers.Sync Version
    @@ -390,20 +384,6 @@ public  - - - -
      -
    • -

      getBetaVersion

      -
      public Version getBetaVersion()
      -
      Gets the SubServers.Sync Beta Version
      -
      -
      Returns:
      -
      SubServers.Sync Beta Version (or null if this is a release version)
      -
      -
    • -
    diff --git a/Javadoc/SubServers.Sync/net/ME1312/SubServers/Sync/SubPlugin.html b/Javadoc/SubServers.Sync/net/ME1312/SubServers/Sync/SubPlugin.html index 649bdf1a..260489d0 100644 --- a/Javadoc/SubServers.Sync/net/ME1312/SubServers/Sync/SubPlugin.html +++ b/Javadoc/SubServers.Sync/net/ME1312/SubServers/Sync/SubPlugin.html @@ -148,39 +148,35 @@ implements net.md_5.bungee.api.plugin.Listener api  -Version -bversion  - - YAMLConfig config  - + UniversalFile dir  - + long lastReload  - + java.io.PrintStream out  - + boolean redis  - + java.util.Map<java.lang.String,Server> servers  - + SubDataClient subdata  - -Version + +static Version version  @@ -377,16 +373,7 @@ implements net.md_5.bungee.api.plugin.Listener
    • version

      -
      public final Version version
      -
    • -
    - - - -
      -
    • -

      bversion

      -
      public final Version bversion
      +
      public static final Version version
    diff --git a/Javadoc/SubServers.Sync/overview-tree.html b/Javadoc/SubServers.Sync/overview-tree.html index e67f59f1..ca15944b 100644 --- a/Javadoc/SubServers.Sync/overview-tree.html +++ b/Javadoc/SubServers.Sync/overview-tree.html @@ -206,6 +206,18 @@
  • net.ME1312.SubServers.Sync.Library.Util.ExceptionRunnable
  • net.ME1312.SubServers.Sync.Library.Util.ReturnRunnable<R>
  • +

    Enum Hierarchy

    +
      +
    • java.lang.Object +
        +
      • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable) + +
      • +
      +
    • +
    diff --git a/Javadoc/SubServers.Sync/serialized-form.html b/Javadoc/SubServers.Sync/serialized-form.html index 0226d013..877fcb0c 100644 --- a/Javadoc/SubServers.Sync/serialized-form.html +++ b/Javadoc/SubServers.Sync/serialized-form.html @@ -103,6 +103,14 @@
  • Serialized Fields

      +
    • +

      parent

      +
      Version parent
      +
    • +
    • +

      type

      +
      Version.VersionType type
      +
    • string

      java.lang.String string
      diff --git a/SubServers.Bungee/META-INF/MANIFEST.MF b/SubServers.Bungee/META-INF/MANIFEST.MF index 7419f689..23417399 100644 --- a/SubServers.Bungee/META-INF/MANIFEST.MF +++ b/SubServers.Bungee/META-INF/MANIFEST.MF @@ -1,5 +1,4 @@ Manifest-Version: 1.0 Class-Path: BungeeCord.jar Main-Class: net.ME1312.SubServers.Bungee.Launch -Implementation-Version: 2.13a -Specification-Version: 2 +Implementation-Version: SubServers.Bungee diff --git a/SubServers.Bungee/src.jar b/SubServers.Bungee/src.jar index 978860d4..10875404 100644 Binary files a/SubServers.Bungee/src.jar and b/SubServers.Bungee/src.jar differ diff --git a/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Launch.java b/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Launch.java index 95ef9dcc..e537b55a 100644 --- a/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Launch.java +++ b/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Launch.java @@ -50,8 +50,9 @@ public final class Launch { System.out.println(System.getProperty("os.name") + " " + System.getProperty("os.version") + ","); System.out.println("Java " + System.getProperty("java.version") + ","); System.out.println("BungeeCord " + net.md_5.bungee.Bootstrap.class.getPackage().getImplementationVersion() + ","); - System.out.println("SubServers.Bungee v" + SubPlugin.class.getPackage().getImplementationVersion() + ((SubPlugin.class.getPackage().getSpecificationVersion().equals("0"))?"":" BETA "+SubPlugin.class.getPackage().getSpecificationVersion())); + System.out.println("SubServers.Bungee v" + SubPlugin.version.toExtendedString()); System.out.println(""); + } else { System.out.println(""); System.out.println("*******************************************"); diff --git a/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Library/Metrics.java b/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Library/Metrics.java index fde972bd..7c90d078 100644 --- a/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Library/Metrics.java +++ b/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Library/Metrics.java @@ -126,7 +126,7 @@ public class Metrics { JsonObject data = new JsonObject(); String pluginName = "SubServers 2"; - String pluginVersion = plugin.version + ((plugin.bversion != null)?"/b"+plugin.bversion.toString():""); + String pluginVersion = plugin.version.toString(); data.addProperty("pluginName", pluginName); data.addProperty("pluginVersion", pluginVersion); diff --git a/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Library/Version/Version.java b/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Library/Version/Version.java index 1af8c5f0..29f8b458 100644 --- a/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Library/Version/Version.java +++ b/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Library/Version/Version.java @@ -9,7 +9,27 @@ import java.io.Serializable; */ @SuppressWarnings("serial") public class Version implements Serializable, Comparable { - private String string; + private final Version parent; + private final VersionType type; + private final String string; + + public enum VersionType { + PRE_ALPHA(0, "pa", "pre-alpha"), + ALPHA(1, "a", "alpha"), + PREVIEW(2, "pb", "preview"), + PRE_BETA(2, "pb", "pre-beta"), + BETA(3, "b", "beta"), + PRE_RELEASE(4, "pr", "pre-release"), + RELEASE(5, "r", "release"); + + private final int id; + private final String shortname, longname; + VersionType(int id, String shortname, String longname) { + this.id = id; + this.shortname = shortname; + this.longname = longname; + } + } /** * Creates a Version @@ -17,17 +37,83 @@ public class Version implements Serializable, Comparable { * @param string Version String */ public Version(String string) { - if (Util.isNull(string)) throw new NullPointerException(); - this.string = string; + this(VersionType.RELEASE, string); } + /** + * Creates a Version + * + * @param type Version Type + * @param string Version String + */ + public Version(VersionType type, String string) { + this(null, type, string); + } + + /** + * Creates a Version (Prepending the parent) + * + * @param parent Parent Version + * @param string Version String + */ + public Version(Version parent, String string) { + this(parent, VersionType.RELEASE, string); + } + + /** + * Creates a Version (Prepending the parent) + * + * @param parent Parent Version + * @param type Version Type + * @param string Version String + */ + public Version(Version parent, VersionType type, String string) { + if (Util.isNull(string, type)) throw new NullPointerException(); + this.parent = parent; + this.type = type; + this.string = string; + } /** * Creates a Version * * @param ints Version Numbers (Will be separated with dots) */ - public Version(Integer... ints) { + public Version(int... ints) { + this(VersionType.RELEASE, ints); + } + + /** + * Creates a Version + * + * @param type Version Type + * @param ints Version Numbers (Will be separated with dots) + */ + public Version(VersionType type, int... ints) { + this(null, type, ints); + } + + /** + * Creates a Version (Prepending the parent) + * + * @param parent Parent Version + * @param ints Version Numbers (Will be separated with dots) + */ + public Version(Version parent, int... ints) { + this(parent, VersionType.RELEASE, ints); + } + + /** + * Creates a Version (Prepending the parent) + * + * @param parent Parent Version + * @param type Version Type + * @param ints Version Numbers (Will be separated with dots) + */ + public Version(Version parent, VersionType type, int... ints) { + if (Util.isNull(type)) throw new NullPointerException(); + this.parent = parent; + this.type = type; String string = Integer.toString(ints[0]); int i = 0; if (ints.length != 1) { @@ -38,12 +124,75 @@ public class Version implements Serializable, Comparable { } this.string = string; } - + + /* + * The internal toString() method + * new Version(new Version("1.0.0"), VersionType.PRE_ALPHA, "7") would return: + * 5 1.0.0 0 7 9 + */ + private String toInternalString() { + String str = type.id + ' ' + string + ' ' + '9'; + if (parent != null) str = parent.toInternalString()+' '+str; + return str; + } + + /** + * The default toString() method
      + *
      + * new Version(new Version("1.0.0"), VersionType.PRE_ALPHA, "7") would return:
      + * 1.0.0/pa7 + * + * @return Version as a String + */ @Override public String toString() { - return string; + String str = (parent == null)?"":parent.toString()+'/'+type.shortname; + str += string; + return str; } + /** + * The full toString() method
      + *
      + * new Version(new Version("1.0.0"), VersionType.PRE_ALPHA, "7") would return:
      + * r1.0.0/pa7 + * + * @return Version as a String + */ + public String toFullString() { + String str = type.shortname + string; + if (parent != null) str = parent.toFullString()+'/'+str; + return str; + } + + /** + * The extended toString() method
      + *
      + * new Version(new Version("1.0.0"), VersionType.PRE_ALPHA, "7") would return:
      + * 1.0.0 pre-alpha 7 + * + * @return Version as a String + */ + public String toExtendedString() { + String str = (parent == null)?"":parent.toExtendedString()+' '+type.longname+' '; + str += string; + return str; + } + + /** + * The full extended toString() method
      + *
      + * new Version(new Version("1.0.0"), VersionType.PRE_ALPHA, "7") would return:
      + * release 1.0.0 pre-alpha 7 + * + * @return Version as a String + */ + public String toFullExtendedString() { + String str = type.longname + ' ' + string; + if (parent != null) str = parent.toFullExtendedString()+' '+str; + return str; + } + @Override public boolean equals(Object object) { if (object instanceof Version) { @@ -74,8 +223,8 @@ public class Version implements Serializable, Comparable { * @param version The version to compare to */ public int compareTo(Version version) { - String version1 = this.string; - String version2 = version.toString(); + String version1 = toInternalString(); + String version2 = version.toInternalString(); VersionTokenizer tokenizer1 = new VersionTokenizer(version1); VersionTokenizer tokenizer2 = new VersionTokenizer(version2); @@ -164,8 +313,8 @@ public class Version implements Serializable, Comparable { * @param ver2 Version to Compare */ public static int compare(Version ver1, Version ver2) { - String version1 = ver1.toString(); - String version2 = ver2.toString(); + String version1 = ver1.toInternalString(); + String version2 = ver2.toInternalString(); VersionTokenizer tokenizer1 = new VersionTokenizer(version1); VersionTokenizer tokenizer2 = new VersionTokenizer(version2); diff --git a/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Network/Packet/PacketDownloadProxyInfo.java b/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Network/Packet/PacketDownloadProxyInfo.java index 44fee5be..b2ba788a 100644 --- a/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Network/Packet/PacketDownloadProxyInfo.java +++ b/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Network/Packet/PacketDownloadProxyInfo.java @@ -40,7 +40,6 @@ public class PacketDownloadProxyInfo implements PacketIn, PacketOut { if (id != null) json.put("id", id); JSONObject subservers = new JSONObject(); subservers.put("version", plugin.version.toString()); - if (plugin.bversion != null) subservers.put("beta", plugin.bversion.toString()); subservers.put("last-reload", plugin.resetDate); subservers.put("hosts", plugin.api.getHosts().size()); subservers.put("subservers", plugin.api.getSubServers().size()); diff --git a/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/SubAPI.java b/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/SubAPI.java index 26065ccc..352136ba 100644 --- a/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/SubAPI.java +++ b/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/SubAPI.java @@ -647,15 +647,6 @@ public final class SubAPI { return plugin.dir; } - /** - * Gets the SubServers Beta Version - * - * @return SubServers Beta Version (or null if this is a release version) - */ - public Version getBetaVersion() { - return plugin.bversion; - } - /** * Gets the SubServers Version * diff --git a/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/SubCommand.java b/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/SubCommand.java index 967c9912..8a2ccedb 100644 --- a/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/SubCommand.java +++ b/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/SubCommand.java @@ -66,32 +66,30 @@ public final class SubCommand extends CommandX { if (args[0].equalsIgnoreCase("help") || args[0].equalsIgnoreCase("?")) { sender.sendMessages(printHelp()); } else if (args[0].equalsIgnoreCase("version") || args[0].equalsIgnoreCase("ver")) { - sender.sendMessage("SubServers > SubServers.Bungee is running version " + plugin.version.toString() + ((plugin.bversion != null)?" BETA "+plugin.bversion.toString():"")); - if (plugin.bversion == null) { - new Thread(() -> { - try { - Document updxml = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(new StringReader(Util.readAll(new BufferedReader(new InputStreamReader(new URL("https://src.me1312.net/maven/net/ME1312/SubServers/SubServers.Bungee/maven-metadata.xml").openStream(), Charset.forName("UTF-8"))))))); + sender.sendMessage("SubServers > SubServers.Bungee is running version " + plugin.version.toExtendedString()); + new Thread(() -> { + try { + Document updxml = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(new StringReader(Util.readAll(new BufferedReader(new InputStreamReader(new URL("https://src.me1312.net/maven/net/ME1312/SubServers/SubServers.Bungee/maven-metadata.xml").openStream(), Charset.forName("UTF-8"))))))); - NodeList updnodeList = updxml.getElementsByTagName("version"); - Version updversion = plugin.version; - int updcount = -1; - for (int i = 0; i < updnodeList.getLength(); i++) { - Node node = updnodeList.item(i); - if (node.getNodeType() == Node.ELEMENT_NODE) { - if (!node.getTextContent().startsWith("-") && new Version(node.getTextContent()).compareTo(updversion) >= 0) { - updversion = new Version(node.getTextContent()); - updcount++; - } + NodeList updnodeList = updxml.getElementsByTagName("version"); + Version updversion = plugin.version; + int updcount = -1; + for (int i = 0; i < updnodeList.getLength(); i++) { + Node node = updnodeList.item(i); + if (node.getNodeType() == Node.ELEMENT_NODE) { + if (!node.getTextContent().startsWith("-") && new Version(node.getTextContent()).compareTo(updversion) >= 0) { + updversion = new Version(node.getTextContent()); + updcount++; } } - if (updversion.equals(plugin.version)) { - sender.sendMessage("You are on the latest version."); - } else { - sender.sendMessage("You are " + updcount + " version" + ((updcount == 1)?"":"s") + " behind."); - } - } catch (Exception e) {} - }).start(); - } + } + if (updversion.equals(plugin.version)) { + sender.sendMessage("You are on the latest version."); + } else { + sender.sendMessage("You are " + updcount + " version" + ((updcount == 1)?"":"s") + " behind."); + } + } catch (Exception e) {} + }).start(); } else if (args[0].equalsIgnoreCase("reload")) { if (args.length > 1) { switch (args[1].toLowerCase()) { diff --git a/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/SubPlugin.java b/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/SubPlugin.java index 6822eba6..165793c2 100644 --- a/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/SubPlugin.java +++ b/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/SubPlugin.java @@ -57,8 +57,8 @@ public final class SubPlugin extends BungeeCord implements Listener { public final SubAPI api = new SubAPI(this); public SubDataServer subdata = null; public SubServer sudo = null; - public final Version version = new Version(SubPlugin.class.getPackage().getImplementationVersion()); - public final Version bversion = (SubPlugin.class.getPackage().getSpecificationVersion().equals("0"))?null:new Version(SubPlugin.class.getPackage().getSpecificationVersion()); + //public static final Version version = new Version("2.13a"); + public static final Version version = new Version(new Version("2.13a"), Version.VersionType.PRE_RELEASE, 1); public boolean redis = false; public long resetDate = 0; @@ -613,7 +613,7 @@ public final class SubPlugin extends BungeeCord implements Listener { */ @Override public String getName() { - return (new Version(super.getVersion()).equals(version))?"SubServers.Bungee":super.getName(); + return (super.getVersion()).equals("SubServers.Bungee")?"SubServers.Bungee":super.getName(); } /** @@ -623,7 +623,7 @@ public final class SubPlugin extends BungeeCord implements Listener { */ @Override public String getVersion() { - return (new Version(super.getVersion()).equals(version))?version+((bversion != null)?"-BETA-"+bversion.toString():"")+"-PATCHED":super.getVersion(); + return (super.getVersion().equals("SubServers.Bungee"))?version.toExtendedString().replace(' ', '-'):super.getVersion(); } /** diff --git a/SubServers.Client/Bukkit/src.jar b/SubServers.Client/Bukkit/src.jar index 3063733d..f8f6199f 100644 Binary files a/SubServers.Client/Bukkit/src.jar and b/SubServers.Client/Bukkit/src.jar differ diff --git a/SubServers.Client/Bukkit/src/net/ME1312/SubServers/Client/Bukkit/Library/Version/Version.java b/SubServers.Client/Bukkit/src/net/ME1312/SubServers/Client/Bukkit/Library/Version/Version.java index 0aeb2018..6c481262 100644 --- a/SubServers.Client/Bukkit/src/net/ME1312/SubServers/Client/Bukkit/Library/Version/Version.java +++ b/SubServers.Client/Bukkit/src/net/ME1312/SubServers/Client/Bukkit/Library/Version/Version.java @@ -9,7 +9,27 @@ import java.io.Serializable; */ @SuppressWarnings("serial") public class Version implements Serializable, Comparable { - private String string; + private final Version parent; + private final VersionType type; + private final String string; + + public enum VersionType { + PRE_ALPHA(0, "pa", "pre-alpha"), + ALPHA(1, "a", "alpha"), + PREVIEW(2, "pb", "preview"), + PRE_BETA(2, "pb", "pre-beta"), + BETA(3, "b", "beta"), + PRE_RELEASE(4, "pr", "pre-release"), + RELEASE(5, "r", "release"); + + private final int id; + private final String shortname, longname; + VersionType(int id, String shortname, String longname) { + this.id = id; + this.shortname = shortname; + this.longname = longname; + } + } /** * Creates a Version @@ -17,17 +37,83 @@ public class Version implements Serializable, Comparable { * @param string Version String */ public Version(String string) { - if (Util.isNull(string)) throw new NullPointerException(); - this.string = string; + this(VersionType.RELEASE, string); } + /** + * Creates a Version + * + * @param type Version Type + * @param string Version String + */ + public Version(VersionType type, String string) { + this(null, type, string); + } + + /** + * Creates a Version (Prepending the parent) + * + * @param parent Parent Version + * @param string Version String + */ + public Version(Version parent, String string) { + this(parent, VersionType.RELEASE, string); + } + + /** + * Creates a Version (Prepending the parent) + * + * @param parent Parent Version + * @param type Version Type + * @param string Version String + */ + public Version(Version parent, VersionType type, String string) { + if (Util.isNull(string, type)) throw new NullPointerException(); + this.parent = parent; + this.type = type; + this.string = string; + } /** * Creates a Version * * @param ints Version Numbers (Will be separated with dots) */ - public Version(Integer... ints) { + public Version(int... ints) { + this(VersionType.RELEASE, ints); + } + + /** + * Creates a Version + * + * @param type Version Type + * @param ints Version Numbers (Will be separated with dots) + */ + public Version(VersionType type, int... ints) { + this(null, type, ints); + } + + /** + * Creates a Version (Prepending the parent) + * + * @param parent Parent Version + * @param ints Version Numbers (Will be separated with dots) + */ + public Version(Version parent, int... ints) { + this(parent, VersionType.RELEASE, ints); + } + + /** + * Creates a Version (Prepending the parent) + * + * @param parent Parent Version + * @param type Version Type + * @param ints Version Numbers (Will be separated with dots) + */ + public Version(Version parent, VersionType type, int... ints) { + if (Util.isNull(type)) throw new NullPointerException(); + this.parent = parent; + this.type = type; String string = Integer.toString(ints[0]); int i = 0; if (ints.length != 1) { @@ -38,12 +124,75 @@ public class Version implements Serializable, Comparable { } this.string = string; } - + + /* + * The internal toString() method + * new Version(new Version("1.0.0"), VersionType.PRE_ALPHA, "7") would return: + * 5 1.0.0 0 7 9 + */ + private String toInternalString() { + String str = type.id + ' ' + string + ' ' + '9'; + if (parent != null) str = parent.toInternalString()+' '+str; + return str; + } + + /** + * The default toString() method
      + *
      + * new Version(new Version("1.0.0"), VersionType.PRE_ALPHA, "7") would return:
      + * 1.0.0/pa7 + * + * @return Version as a String + */ @Override public String toString() { - return string; + String str = (parent == null)?"":parent.toString()+'/'+type.shortname; + str += string; + return str; } + /** + * The full toString() method
      + *
      + * new Version(new Version("1.0.0"), VersionType.PRE_ALPHA, "7") would return:
      + * r1.0.0/pa7 + * + * @return Version as a String + */ + public String toFullString() { + String str = type.shortname + string; + if (parent != null) str = parent.toFullString()+'/'+str; + return str; + } + + /** + * The extended toString() method
      + *
      + * new Version(new Version("1.0.0"), VersionType.PRE_ALPHA, "7") would return:
      + * 1.0.0 pre-alpha 7 + * + * @return Version as a String + */ + public String toExtendedString() { + String str = (parent == null)?"":parent.toExtendedString()+' '+type.longname+' '; + str += string; + return str; + } + + /** + * The full extended toString() method
      + *
      + * new Version(new Version("1.0.0"), VersionType.PRE_ALPHA, "7") would return:
      + * release 1.0.0 pre-alpha 7 + * + * @return Version as a String + */ + public String toFullExtendedString() { + String str = type.longname + ' ' + string; + if (parent != null) str = parent.toFullExtendedString()+' '+str; + return str; + } + @Override public boolean equals(Object object) { if (object instanceof Version) { @@ -74,8 +223,8 @@ public class Version implements Serializable, Comparable { * @param version The version to compare to */ public int compareTo(Version version) { - String version1 = this.string; - String version2 = version.toString(); + String version1 = toInternalString(); + String version2 = version.toInternalString(); VersionTokenizer tokenizer1 = new VersionTokenizer(version1); VersionTokenizer tokenizer2 = new VersionTokenizer(version2); @@ -164,8 +313,8 @@ public class Version implements Serializable, Comparable { * @param ver2 Version to Compare */ public static int compare(Version ver1, Version ver2) { - String version1 = ver1.toString(); - String version2 = ver2.toString(); + String version1 = ver1.toInternalString(); + String version2 = ver2.toInternalString(); VersionTokenizer tokenizer1 = new VersionTokenizer(version1); VersionTokenizer tokenizer2 = new VersionTokenizer(version2); diff --git a/SubServers.Client/Bukkit/src/net/ME1312/SubServers/Client/Bukkit/SubAPI.java b/SubServers.Client/Bukkit/src/net/ME1312/SubServers/Client/Bukkit/SubAPI.java index a3e4a30c..d32f0cb1 100644 --- a/SubServers.Client/Bukkit/src/net/ME1312/SubServers/Client/Bukkit/SubAPI.java +++ b/SubServers.Client/Bukkit/src/net/ME1312/SubServers/Client/Bukkit/SubAPI.java @@ -111,15 +111,6 @@ public final class SubAPI { plugin.gui = graphics; } - /** - * Gets the SubServers Beta Version - * - * @return SubServers Beta Version (or null if this is a release version) - */ - public Version getBetaVersion() { - return plugin.bversion; - } - /** * Gets the SubServers Version * diff --git a/SubServers.Client/Bukkit/src/net/ME1312/SubServers/Client/Bukkit/SubCommand.java b/SubServers.Client/Bukkit/src/net/ME1312/SubServers/Client/Bukkit/SubCommand.java index 232b44ba..8e9a2746 100644 --- a/SubServers.Client/Bukkit/src/net/ME1312/SubServers/Client/Bukkit/SubCommand.java +++ b/SubServers.Client/Bukkit/src/net/ME1312/SubServers/Client/Bukkit/SubCommand.java @@ -48,32 +48,30 @@ public final class SubCommand implements CommandExecutor { if (args[0].equalsIgnoreCase("help") || args[0].equalsIgnoreCase("?")) { sender.sendMessage(printHelp(label)); } else if (args[0].equalsIgnoreCase("version") || args[0].equalsIgnoreCase("ver")) { - sender.sendMessage(plugin.api.getLang("SubServers", "Command.Version").replace("$name$", "SubServers.Client.Bukkit").replace("$str$", plugin.version.toString() + ((plugin.bversion != null)?" BETA "+plugin.bversion.toString():""))); - if (plugin.bversion == null) { - Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> { - try { - Document updxml = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(new StringReader(Util.readAll(new BufferedReader(new InputStreamReader(new URL("https://src.me1312.net/maven/net/ME1312/SubServers/SubServers.Client.Bukkit/maven-metadata.xml").openStream(), Charset.forName("UTF-8"))))))); + sender.sendMessage(plugin.api.getLang("SubServers", "Command.Version").replace("$name$", "SubServers.Client.Bukkit").replace("$str$", plugin.version.toExtendedString())); + Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> { + try { + Document updxml = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(new StringReader(Util.readAll(new BufferedReader(new InputStreamReader(new URL("https://src.me1312.net/maven/net/ME1312/SubServers/SubServers.Client.Bukkit/maven-metadata.xml").openStream(), Charset.forName("UTF-8"))))))); - NodeList updnodeList = updxml.getElementsByTagName("version"); - Version updversion = plugin.version; - int updcount = -1; - for (int i = 0; i < updnodeList.getLength(); i++) { - Node node = updnodeList.item(i); - if (node.getNodeType() == Node.ELEMENT_NODE) { - if (!node.getTextContent().startsWith("-") && new Version(node.getTextContent()).compareTo(updversion) >= 0) { - updversion = new Version(node.getTextContent()); - updcount++; - } + NodeList updnodeList = updxml.getElementsByTagName("version"); + Version updversion = plugin.version; + int updcount = -1; + for (int i = 0; i < updnodeList.getLength(); i++) { + Node node = updnodeList.item(i); + if (node.getNodeType() == Node.ELEMENT_NODE) { + if (!node.getTextContent().startsWith("-") && new Version(node.getTextContent()).compareTo(updversion) >= 0) { + updversion = new Version(node.getTextContent()); + updcount++; } } - if (updversion.equals(plugin.version)) { - sender.sendMessage(plugin.api.getLang("SubServers", "Command.Version.Latest")); - } else { - sender.sendMessage(plugin.api.getLang("SubServers", "Command.Version.Outdated").replace("$int$", Integer.toString(updcount))); - } - } catch (Exception e) {} - }); - } + } + if (updversion.equals(plugin.version)) { + sender.sendMessage(plugin.api.getLang("SubServers", "Command.Version.Latest")); + } else { + sender.sendMessage(plugin.api.getLang("SubServers", "Command.Version.Outdated").replace("$int$", Integer.toString(updcount))); + } + } catch (Exception e) {} + }); } else if (args[0].equalsIgnoreCase("list")) { final String fLabel = label; plugin.subdata.sendPacket(new PacketDownloadServerList(null, null, json -> { diff --git a/SubServers.Client/Bukkit/src/net/ME1312/SubServers/Client/Bukkit/SubPlugin.java b/SubServers.Client/Bukkit/src/net/ME1312/SubServers/Client/Bukkit/SubPlugin.java index 8ac810c5..99f87c8a 100644 --- a/SubServers.Client/Bukkit/src/net/ME1312/SubServers/Client/Bukkit/SubPlugin.java +++ b/SubServers.Client/Bukkit/src/net/ME1312/SubServers/Client/Bukkit/SubPlugin.java @@ -40,12 +40,12 @@ public final class SubPlugin extends JavaPlugin { public UIHandler gui = null; public final Version version; - public final Version bversion = new Version(2); public final SubAPI api = new SubAPI(this); public SubPlugin() { super(); - version = new Version(getDescription().getVersion()); + //version = new Version(getDescription().getVersion()); + version = new Version(new Version(getDescription().getVersion()), Version.VersionType.PRE_RELEASE, 1); } /** diff --git a/SubServers.Host/src.jar b/SubServers.Host/src.jar index fd760762..88e5ca27 100644 Binary files a/SubServers.Host/src.jar and b/SubServers.Host/src.jar differ diff --git a/SubServers.Host/src/net/ME1312/SubServers/Host/ExHost.java b/SubServers.Host/src/net/ME1312/SubServers/Host/ExHost.java index 1cce64ef..164049bb 100644 --- a/SubServers.Host/src/net/ME1312/SubServers/Host/ExHost.java +++ b/SubServers.Host/src/net/ME1312/SubServers/Host/ExHost.java @@ -57,8 +57,8 @@ public final class ExHost { public YAMLSection host = null; public SubDataClient subdata = null; - public final Version version = new Version("2.13a"); - public final Version bversion = new Version(3); + //public final Version version = new Version("2.13a"); + public final Version version = new Version(new Version("2.13a"), Version.VersionType.PRE_RELEASE, 1); public final SubAPI api = new SubAPI(this); private ConsoleReader jline; @@ -202,8 +202,8 @@ public final class ExHost { PluginClassLoader loader = new PluginClassLoader(this.getClass().getClassLoader(), file.toURI().toURL()); List contents = new ArrayList(); - boolean isplugin = false; loader.setDefaultClass(ClassNotFoundException.class); + boolean isplugin = false; while (entries.hasMoreElements()) { JarEntry entry = entries.nextElement(); if (!entry.isDirectory() && entry.getName().endsWith(".class")) { diff --git a/SubServers.Host/src/net/ME1312/SubServers/Host/Library/PluginClassLoader.java b/SubServers.Host/src/net/ME1312/SubServers/Host/Library/PluginClassLoader.java index 5da7c30a..53877e7c 100644 --- a/SubServers.Host/src/net/ME1312/SubServers/Host/Library/PluginClassLoader.java +++ b/SubServers.Host/src/net/ME1312/SubServers/Host/Library/PluginClassLoader.java @@ -34,10 +34,22 @@ public class PluginClassLoader extends URLClassLoader { loaders.add(this); } + /** + * Set the Default Class to load when no class is found + * + * @param clazz Class + */ public void setDefaultClass(Class clazz) { - this.defaultClass = clazz; + defaultClass = clazz; } + + /** + * Get the Default Class to load when no class is found + * + * @throws ClassNotFoundException when no Default Class is set + * @return Default Class + */ public Class getDefaultClass() throws ClassNotFoundException { if (defaultClass == null) { throw new ClassNotFoundException(); @@ -79,7 +91,7 @@ public class PluginClassLoader extends URLClassLoader { } catch (NoClassDefFoundError | ClassNotFoundException ex) {} } } else { - return getDefaultClass(name); + throw new ClassNotFoundException(name); } } } diff --git a/SubServers.Host/src/net/ME1312/SubServers/Host/Library/Version/Version.java b/SubServers.Host/src/net/ME1312/SubServers/Host/Library/Version/Version.java index cbdce98b..f675659f 100644 --- a/SubServers.Host/src/net/ME1312/SubServers/Host/Library/Version/Version.java +++ b/SubServers.Host/src/net/ME1312/SubServers/Host/Library/Version/Version.java @@ -9,7 +9,27 @@ import java.io.Serializable; */ @SuppressWarnings("serial") public class Version implements Serializable, Comparable { - private String string; + private final Version parent; + private final VersionType type; + private final String string; + + public enum VersionType { + PRE_ALPHA(0, "pa", "pre-alpha"), + ALPHA(1, "a", "alpha"), + PREVIEW(2, "pb", "preview"), + PRE_BETA(2, "pb", "pre-beta"), + BETA(3, "b", "beta"), + PRE_RELEASE(4, "pr", "pre-release"), + RELEASE(5, "r", "release"); + + private final int id; + private final String shortname, longname; + VersionType(int id, String shortname, String longname) { + this.id = id; + this.shortname = shortname; + this.longname = longname; + } + } /** * Creates a Version @@ -17,17 +37,83 @@ public class Version implements Serializable, Comparable { * @param string Version String */ public Version(String string) { - if (Util.isNull(string)) throw new NullPointerException(); - this.string = string; + this(VersionType.RELEASE, string); } + /** + * Creates a Version + * + * @param type Version Type + * @param string Version String + */ + public Version(VersionType type, String string) { + this(null, type, string); + } + + /** + * Creates a Version (Prepending the parent) + * + * @param parent Parent Version + * @param string Version String + */ + public Version(Version parent, String string) { + this(parent, VersionType.RELEASE, string); + } + + /** + * Creates a Version (Prepending the parent) + * + * @param parent Parent Version + * @param type Version Type + * @param string Version String + */ + public Version(Version parent, VersionType type, String string) { + if (Util.isNull(string, type)) throw new NullPointerException(); + this.parent = parent; + this.type = type; + this.string = string; + } /** * Creates a Version * * @param ints Version Numbers (Will be separated with dots) */ - public Version(Integer... ints) { + public Version(int... ints) { + this(VersionType.RELEASE, ints); + } + + /** + * Creates a Version + * + * @param type Version Type + * @param ints Version Numbers (Will be separated with dots) + */ + public Version(VersionType type, int... ints) { + this(null, type, ints); + } + + /** + * Creates a Version (Prepending the parent) + * + * @param parent Parent Version + * @param ints Version Numbers (Will be separated with dots) + */ + public Version(Version parent, int... ints) { + this(parent, VersionType.RELEASE, ints); + } + + /** + * Creates a Version (Prepending the parent) + * + * @param parent Parent Version + * @param type Version Type + * @param ints Version Numbers (Will be separated with dots) + */ + public Version(Version parent, VersionType type, int... ints) { + if (Util.isNull(type)) throw new NullPointerException(); + this.parent = parent; + this.type = type; String string = Integer.toString(ints[0]); int i = 0; if (ints.length != 1) { @@ -38,12 +124,75 @@ public class Version implements Serializable, Comparable { } this.string = string; } - + + /* + * The internal toString() method + * new Version(new Version("1.0.0"), VersionType.PRE_ALPHA, "7") would return: + * 5 1.0.0 0 7 9 + */ + private String toInternalString() { + String str = type.id + ' ' + string + ' ' + '9'; + if (parent != null) str = parent.toInternalString()+' '+str; + return str; + } + + /** + * The default toString() method
      + *
      + * new Version(new Version("1.0.0"), VersionType.PRE_ALPHA, "7") would return:
      + * 1.0.0/pa7 + * + * @return Version as a String + */ @Override public String toString() { - return string; + String str = (parent == null)?"":parent.toString()+'/'+type.shortname; + str += string; + return str; } + /** + * The full toString() method
      + *
      + * new Version(new Version("1.0.0"), VersionType.PRE_ALPHA, "7") would return:
      + * r1.0.0/pa7 + * + * @return Version as a String + */ + public String toFullString() { + String str = type.shortname + string; + if (parent != null) str = parent.toFullString()+'/'+str; + return str; + } + + /** + * The extended toString() method
      + *
      + * new Version(new Version("1.0.0"), VersionType.PRE_ALPHA, "7") would return:
      + * 1.0.0 pre-alpha 7 + * + * @return Version as a String + */ + public String toExtendedString() { + String str = (parent == null)?"":parent.toExtendedString()+' '+type.longname+' '; + str += string; + return str; + } + + /** + * The full extended toString() method
      + *
      + * new Version(new Version("1.0.0"), VersionType.PRE_ALPHA, "7") would return:
      + * release 1.0.0 pre-alpha 7 + * + * @return Version as a String + */ + public String toFullExtendedString() { + String str = type.longname + ' ' + string; + if (parent != null) str = parent.toFullExtendedString()+' '+str; + return str; + } + @Override public boolean equals(Object object) { if (object instanceof Version) { @@ -74,8 +223,8 @@ public class Version implements Serializable, Comparable { * @param version The version to compare to */ public int compareTo(Version version) { - String version1 = this.string; - String version2 = version.toString(); + String version1 = toInternalString(); + String version2 = version.toInternalString(); VersionTokenizer tokenizer1 = new VersionTokenizer(version1); VersionTokenizer tokenizer2 = new VersionTokenizer(version2); @@ -164,8 +313,8 @@ public class Version implements Serializable, Comparable { * @param ver2 Version to Compare */ public static int compare(Version ver1, Version ver2) { - String version1 = ver1.toString(); - String version2 = ver2.toString(); + String version1 = ver1.toInternalString(); + String version2 = ver2.toInternalString(); VersionTokenizer tokenizer1 = new VersionTokenizer(version1); VersionTokenizer tokenizer2 = new VersionTokenizer(version2); diff --git a/SubServers.Host/src/net/ME1312/SubServers/Host/SubAPI.java b/SubServers.Host/src/net/ME1312/SubServers/Host/SubAPI.java index 0fb460ed..9a48ab02 100644 --- a/SubServers.Host/src/net/ME1312/SubServers/Host/SubAPI.java +++ b/SubServers.Host/src/net/ME1312/SubServers/Host/SubAPI.java @@ -375,15 +375,6 @@ public final class SubAPI { return host.dir; } - /** - * Gets the SubServers Beta Version - * - * @return SubServers Beta Version (or null if this is a release version) - */ - public Version getBetaVersion() { - return host.bversion; - } - /** * Gets the SubServers Version * diff --git a/SubServers.Host/src/net/ME1312/SubServers/Host/SubCommand.java b/SubServers.Host/src/net/ME1312/SubServers/Host/SubCommand.java index 1714acec..767a462e 100644 --- a/SubServers.Host/src/net/ME1312/SubServers/Host/SubCommand.java +++ b/SubServers.Host/src/net/ME1312/SubServers/Host/SubCommand.java @@ -33,33 +33,31 @@ public class SubCommand { host.log.message.println( System.getProperty("os.name") + ' ' + System.getProperty("os.version") + ',', "Java " + System.getProperty("java.version") + ',', - "SubServers.Host v" + host.version.toString() + ((host.bversion == null) ? "" : " BETA " + host.bversion.toString())); - if (host.bversion == null) { - new Thread(() -> { - try { - Document updxml = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(new StringReader(Util.readAll(new BufferedReader(new InputStreamReader(new URL("https://src.me1312.net/maven/net/ME1312/SubServers/SubServers.Host/maven-metadata.xml").openStream(), Charset.forName("UTF-8"))))))); + "SubServers.Host v" + host.version.toExtendedString()); + new Thread(() -> { + try { + Document updxml = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(new StringReader(Util.readAll(new BufferedReader(new InputStreamReader(new URL("https://src.me1312.net/maven/net/ME1312/SubServers/SubServers.Host/maven-metadata.xml").openStream(), Charset.forName("UTF-8"))))))); - NodeList updnodeList = updxml.getElementsByTagName("version"); - Version updversion = host.version; - int updcount = -1; - for (int i = 0; i < updnodeList.getLength(); i++) { - Node node = updnodeList.item(i); - if (node.getNodeType() == Node.ELEMENT_NODE) { - if (!node.getTextContent().startsWith("-") && new Version(node.getTextContent()).compareTo(updversion) >= 0) { - updversion = new Version(node.getTextContent()); - updcount++; - } + NodeList updnodeList = updxml.getElementsByTagName("version"); + Version updversion = host.version; + int updcount = -1; + for (int i = 0; i < updnodeList.getLength(); i++) { + Node node = updnodeList.item(i); + if (node.getNodeType() == Node.ELEMENT_NODE) { + if (!node.getTextContent().startsWith("-") && new Version(node.getTextContent()).compareTo(updversion) >= 0) { + updversion = new Version(node.getTextContent()); + updcount++; } } - if (updversion.equals(host.version)) { - host.log.message.println("You are on the latest version."); - } else { - host.log.message.println("You are " + updcount + " version" + ((updcount == 1) ? "" : "s") + " behind."); - } - } catch (Exception e) { } - }).start(); - } + if (updversion.equals(host.version)) { + host.log.message.println("You are on the latest version."); + } else { + host.log.message.println("You are " + updcount + " version" + ((updcount == 1) ? "" : "s") + " behind."); + } + } catch (Exception e) { + } + }).start(); } else if (host.api.plugins.get(args[0].toLowerCase()) != null) { SubPluginInfo plugin = host.api.plugins.get(args[0].toLowerCase()); host.log.message.println(plugin.getName() + " v" + plugin.getVersion() + " by " + plugin.getAuthors().toString().substring(1, plugin.getAuthors().toString().length() - 1)); diff --git a/SubServers.Sync/META-INF/MANIFEST.MF b/SubServers.Sync/META-INF/MANIFEST.MF index 2d2f1746..7fc842f6 100644 --- a/SubServers.Sync/META-INF/MANIFEST.MF +++ b/SubServers.Sync/META-INF/MANIFEST.MF @@ -1,5 +1,4 @@ Manifest-Version: 1.0 Class-Path: BungeeCord.jar Main-Class: net.ME1312.SubServers.Sync.Launch -Implementation-Version: 2.13a -Specification-Version: 2 +Implementation-Version: SubServers.Sync diff --git a/SubServers.Sync/src.jar b/SubServers.Sync/src.jar index c9513db2..710899b6 100644 Binary files a/SubServers.Sync/src.jar and b/SubServers.Sync/src.jar differ diff --git a/SubServers.Sync/src/net/ME1312/SubServers/Sync/Launch.java b/SubServers.Sync/src/net/ME1312/SubServers/Sync/Launch.java index 55e27629..da20974f 100644 --- a/SubServers.Sync/src/net/ME1312/SubServers/Sync/Launch.java +++ b/SubServers.Sync/src/net/ME1312/SubServers/Sync/Launch.java @@ -50,7 +50,7 @@ public final class Launch { System.out.println(System.getProperty("os.name") + " " + System.getProperty("os.version") + ","); System.out.println("Java " + System.getProperty("java.version") + ","); System.out.println("BungeeCord " + net.md_5.bungee.Bootstrap.class.getPackage().getImplementationVersion() + ","); - System.out.println("SubServers.Sync v" + SubPlugin.class.getPackage().getImplementationVersion() + ((SubPlugin.class.getPackage().getSpecificationVersion().equals("0"))?"":" BETA "+SubPlugin.class.getPackage().getSpecificationVersion())); + System.out.println("SubServers.Sync v" + SubPlugin.version.toExtendedString()); System.out.println(""); } else { System.out.println(""); diff --git a/SubServers.Sync/src/net/ME1312/SubServers/Sync/Library/Metrics.java b/SubServers.Sync/src/net/ME1312/SubServers/Sync/Library/Metrics.java index ccb7f830..db8550fd 100644 --- a/SubServers.Sync/src/net/ME1312/SubServers/Sync/Library/Metrics.java +++ b/SubServers.Sync/src/net/ME1312/SubServers/Sync/Library/Metrics.java @@ -118,7 +118,7 @@ public class Metrics { JsonObject data = new JsonObject(); String pluginName = "SubServers Sync"; - String pluginVersion = plugin.version + ((plugin.bversion != null)?"/b"+plugin.bversion.toString():""); + String pluginVersion = plugin.version.toString(); data.addProperty("pluginName", pluginName); data.addProperty("pluginVersion", pluginVersion); diff --git a/SubServers.Sync/src/net/ME1312/SubServers/Sync/Library/Version/Version.java b/SubServers.Sync/src/net/ME1312/SubServers/Sync/Library/Version/Version.java index 761c067f..6e14a977 100644 --- a/SubServers.Sync/src/net/ME1312/SubServers/Sync/Library/Version/Version.java +++ b/SubServers.Sync/src/net/ME1312/SubServers/Sync/Library/Version/Version.java @@ -9,7 +9,27 @@ import java.io.Serializable; */ @SuppressWarnings("serial") public class Version implements Serializable, Comparable { - private String string; + private final Version parent; + private final VersionType type; + private final String string; + + public enum VersionType { + PRE_ALPHA(0, "pa", "pre-alpha"), + ALPHA(1, "a", "alpha"), + PREVIEW(2, "pb", "preview"), + PRE_BETA(2, "pb", "pre-beta"), + BETA(3, "b", "beta"), + PRE_RELEASE(4, "pr", "pre-release"), + RELEASE(5, "r", "release"); + + private final int id; + private final String shortname, longname; + VersionType(int id, String shortname, String longname) { + this.id = id; + this.shortname = shortname; + this.longname = longname; + } + } /** * Creates a Version @@ -17,17 +37,83 @@ public class Version implements Serializable, Comparable { * @param string Version String */ public Version(String string) { - if (Util.isNull(string)) throw new NullPointerException(); - this.string = string; + this(VersionType.RELEASE, string); } + /** + * Creates a Version + * + * @param type Version Type + * @param string Version String + */ + public Version(VersionType type, String string) { + this(null, type, string); + } + + /** + * Creates a Version (Prepending the parent) + * + * @param parent Parent Version + * @param string Version String + */ + public Version(Version parent, String string) { + this(parent, VersionType.RELEASE, string); + } + + /** + * Creates a Version (Prepending the parent) + * + * @param parent Parent Version + * @param type Version Type + * @param string Version String + */ + public Version(Version parent, VersionType type, String string) { + if (Util.isNull(string, type)) throw new NullPointerException(); + this.parent = parent; + this.type = type; + this.string = string; + } /** * Creates a Version * * @param ints Version Numbers (Will be separated with dots) */ - public Version(Integer... ints) { + public Version(int... ints) { + this(VersionType.RELEASE, ints); + } + + /** + * Creates a Version + * + * @param type Version Type + * @param ints Version Numbers (Will be separated with dots) + */ + public Version(VersionType type, int... ints) { + this(null, type, ints); + } + + /** + * Creates a Version (Prepending the parent) + * + * @param parent Parent Version + * @param ints Version Numbers (Will be separated with dots) + */ + public Version(Version parent, int... ints) { + this(parent, VersionType.RELEASE, ints); + } + + /** + * Creates a Version (Prepending the parent) + * + * @param parent Parent Version + * @param type Version Type + * @param ints Version Numbers (Will be separated with dots) + */ + public Version(Version parent, VersionType type, int... ints) { + if (Util.isNull(type)) throw new NullPointerException(); + this.parent = parent; + this.type = type; String string = Integer.toString(ints[0]); int i = 0; if (ints.length != 1) { @@ -38,12 +124,75 @@ public class Version implements Serializable, Comparable { } this.string = string; } - + + /* + * The internal toString() method + * new Version(new Version("1.0.0"), VersionType.PRE_ALPHA, "7") would return: + * 5 1.0.0 0 7 9 + */ + private String toInternalString() { + String str = type.id + ' ' + string + ' ' + '9'; + if (parent != null) str = parent.toInternalString()+' '+str; + return str; + } + + /** + * The default toString() method
      + *
      + * new Version(new Version("1.0.0"), VersionType.PRE_ALPHA, "7") would return:
      + * 1.0.0/pa7 + * + * @return Version as a String + */ @Override public String toString() { - return string; + String str = (parent == null)?"":parent.toString()+'/'+type.shortname; + str += string; + return str; } + /** + * The full toString() method
      + *
      + * new Version(new Version("1.0.0"), VersionType.PRE_ALPHA, "7") would return:
      + * r1.0.0/pa7 + * + * @return Version as a String + */ + public String toFullString() { + String str = type.shortname + string; + if (parent != null) str = parent.toFullString()+'/'+str; + return str; + } + + /** + * The extended toString() method
      + *
      + * new Version(new Version("1.0.0"), VersionType.PRE_ALPHA, "7") would return:
      + * 1.0.0 pre-alpha 7 + * + * @return Version as a String + */ + public String toExtendedString() { + String str = (parent == null)?"":parent.toExtendedString()+' '+type.longname+' '; + str += string; + return str; + } + + /** + * The full extended toString() method
      + *
      + * new Version(new Version("1.0.0"), VersionType.PRE_ALPHA, "7") would return:
      + * release 1.0.0 pre-alpha 7 + * + * @return Version as a String + */ + public String toFullExtendedString() { + String str = type.longname + ' ' + string; + if (parent != null) str = parent.toFullExtendedString()+' '+str; + return str; + } + @Override public boolean equals(Object object) { if (object instanceof Version) { @@ -74,8 +223,8 @@ public class Version implements Serializable, Comparable { * @param version The version to compare to */ public int compareTo(Version version) { - String version1 = this.string; - String version2 = version.toString(); + String version1 = toInternalString(); + String version2 = version.toInternalString(); VersionTokenizer tokenizer1 = new VersionTokenizer(version1); VersionTokenizer tokenizer2 = new VersionTokenizer(version2); @@ -164,8 +313,8 @@ public class Version implements Serializable, Comparable { * @param ver2 Version to Compare */ public static int compare(Version ver1, Version ver2) { - String version1 = ver1.toString(); - String version2 = ver2.toString(); + String version1 = ver1.toInternalString(); + String version2 = ver2.toInternalString(); VersionTokenizer tokenizer1 = new VersionTokenizer(version1); VersionTokenizer tokenizer2 = new VersionTokenizer(version2); diff --git a/SubServers.Sync/src/net/ME1312/SubServers/Sync/SubAPI.java b/SubServers.Sync/src/net/ME1312/SubServers/Sync/SubAPI.java index dade3023..5758b004 100644 --- a/SubServers.Sync/src/net/ME1312/SubServers/Sync/SubAPI.java +++ b/SubServers.Sync/src/net/ME1312/SubServers/Sync/SubAPI.java @@ -122,15 +122,6 @@ public final class SubAPI { return plugin.dir; } - /** - * Gets the SubServers.Sync Beta Version - * - * @return SubServers.Sync Beta Version (or null if this is a release version) - */ - public Version getBetaVersion() { - return plugin.bversion; - } - /** * Gets the SubServers.Sync Version * diff --git a/SubServers.Sync/src/net/ME1312/SubServers/Sync/SubCommand.java b/SubServers.Sync/src/net/ME1312/SubServers/Sync/SubCommand.java index 02d960a2..68ebdc44 100644 --- a/SubServers.Sync/src/net/ME1312/SubServers/Sync/SubCommand.java +++ b/SubServers.Sync/src/net/ME1312/SubServers/Sync/SubCommand.java @@ -66,33 +66,31 @@ public final class SubCommand extends CommandX { if (args[0].equalsIgnoreCase("help") || args[0].equalsIgnoreCase("?")) { sender.sendMessages(printHelp()); } else if (args[0].equalsIgnoreCase("version") || args[0].equalsIgnoreCase("ver")) { - sender.sendMessage("SubServers > SubServers.Sync is running version " + plugin.version.toString() + ((plugin.bversion != null)?" BETA "+plugin.bversion.toString():"")); - if (plugin.bversion == null) { - new Thread(() -> { - try { - Document updxml = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(new StringReader(Util.readAll(new BufferedReader(new InputStreamReader(new URL("https://src.me1312.net/maven/net/ME1312/SubServers/SubServers.Sync/maven-metadata.xml").openStream(), Charset.forName("UTF-8"))))))); + sender.sendMessage("SubServers > SubServers.Sync is running version " + plugin.version.toExtendedString()); + new Thread(() -> { + try { + Document updxml = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(new StringReader(Util.readAll(new BufferedReader(new InputStreamReader(new URL("https://src.me1312.net/maven/net/ME1312/SubServers/SubServers.Sync/maven-metadata.xml").openStream(), Charset.forName("UTF-8"))))))); - NodeList updnodeList = updxml.getElementsByTagName("version"); - Version updversion = plugin.version; - int updcount = -1; - for (int i = 0; i < updnodeList.getLength(); i++) { - Node node = updnodeList.item(i); - if (node.getNodeType() == Node.ELEMENT_NODE) { - if (!node.getTextContent().startsWith("-") && new Version(node.getTextContent()).compareTo(updversion) >= 0) { - updversion = new Version(node.getTextContent()); - updcount++; - } + NodeList updnodeList = updxml.getElementsByTagName("version"); + Version updversion = plugin.version; + int updcount = -1; + for (int i = 0; i < updnodeList.getLength(); i++) { + Node node = updnodeList.item(i); + if (node.getNodeType() == Node.ELEMENT_NODE) { + if (!node.getTextContent().startsWith("-") && new Version(node.getTextContent()).compareTo(updversion) >= 0) { + updversion = new Version(node.getTextContent()); + updcount++; } } - if (updversion.equals(plugin.version)) { - sender.sendMessage("You are on the latest version."); - } else { - sender.sendMessage("You are " + updcount + " version" + ((updcount == 1) ? "" : "s") + " behind."); - } - } catch (Exception e) { } - }).start(); - } + if (updversion.equals(plugin.version)) { + sender.sendMessage("You are on the latest version."); + } else { + sender.sendMessage("You are " + updcount + " version" + ((updcount == 1) ? "" : "s") + " behind."); + } + } catch (Exception e) { + } + }).start(); } else if (args[0].equalsIgnoreCase("list")) { plugin.subdata.sendPacket(new PacketDownloadServerList(null, null, json -> { int i = 0; diff --git a/SubServers.Sync/src/net/ME1312/SubServers/Sync/SubPlugin.java b/SubServers.Sync/src/net/ME1312/SubServers/Sync/SubPlugin.java index 442d3c3c..2193e009 100644 --- a/SubServers.Sync/src/net/ME1312/SubServers/Sync/SubPlugin.java +++ b/SubServers.Sync/src/net/ME1312/SubServers/Sync/SubPlugin.java @@ -48,8 +48,8 @@ public final class SubPlugin extends BungeeCord implements Listener { public boolean redis = false; public final SubAPI api = new SubAPI(this); public SubDataClient subdata = null; - public final Version version = new Version(SubPlugin.class.getPackage().getImplementationVersion()); - public final Version bversion = (SubPlugin.class.getPackage().getSpecificationVersion().equals("0"))?null:new Version(SubPlugin.class.getPackage().getSpecificationVersion()); + //public static final Version version = new Version("2.13a"); + public static final Version version = new Version(new Version("2.13a"), Version.VersionType.PRE_RELEASE, 1); public long lastReload = -1; @@ -183,7 +183,7 @@ public final class SubPlugin extends BungeeCord implements Listener { */ @Override public String getName() { - return (new Version(super.getVersion()).equals(version))?"SubServers.Sync":super.getName(); + return (super.getVersion()).equals("SubServers.Sync")?"SubServers.Sync":super.getName(); } /** @@ -193,7 +193,7 @@ public final class SubPlugin extends BungeeCord implements Listener { */ @Override public String getVersion() { - return (new Version(super.getVersion()).equals(version))?version+((bversion != null)?"-BETA-"+bversion.toString():"")+"-PATCHED":super.getVersion(); + return (super.getVersion().equals("SubServers.Sync"))?version.toExtendedString().replace(' ', '-'):super.getVersion(); } /**