MegavexNetwork/scoreboard-library

Loading version only SNAPSHOT?

Closed this issue · 5 comments

case "1.8.8-R0.1-SNAPSHOT":
return tryLoadImplementationClass(V1_8_R3);
case "1.17-R0.1-SNAPSHOT":
case "1.17.1-R0.1-SNAPSHOT":
case "1.18-R0.1-SNAPSHOT":
case "1.18.1-R0.1-SNAPSHOT":
case "1.18.2-R0.1-SNAPSHOT":
case "1.19-R0.1-SNAPSHOT":
case "1.19.1-R0.1-SNAPSHOT":
case "1.19.2-R0.1-SNAPSHOT":
case "1.19.3-R0.1-SNAPSHOT":
case "1.19.4-R0.1-SNAPSHOT":
case "1.20-R0.1-SNAPSHOT":
case "1.20.1-R0.1-SNAPSHOT":
case "1.20.2-R0.1-SNAPSHOT":
case "1.20.3-R0.1-SNAPSHOT":
case "1.20.4-R0.1-SNAPSHOT":
case "1.20.5-R0.1-SNAPSHOT":
case "1.20.6-R0.1-SNAPSHOT":

I think instead of just loading the SNAPSHOT version, this won't work when using other non-SNAPSHOT, so we should check the server version like

switch(version)  {
      case "1.8.8":
        return tryLoadImplementationClass(V1_8_R3);
      case "1.17":
      case "1.17.1":
      case "1.18":
      case "1.18.1":
      case "1.18.2":
      case "1.19":
      case "1.19.1":
      case "1.19.2":
      case "1.19.3":
      case "1.19.4":
      case "1.20":
      case "1.20.1":
      case "1.20.2":
      case "1.20.3":
      case "1.20.4":
      case "1.20.5":
      case "1.20.6":
        return tryLoadImplementationClass(MODERN);
}

Is there any server software that returns a value without the SNAPSHOT?

Is there any server software that returns a value without the SNAPSHOT?

You are right, but when getBukkitVersion() return 1.17-R0.1-xxx-SNAPSHOT or 1.17-R0.1-SNAPSHOT-xxx, 1.17-R0.2-SNAPSHOT scoreboard-library will not work.

I guess everything after the first "-" could be cut out, but what software even returns values like that?

I guess everything after the first "-" could be cut out, but what software even returns values like that?

when someone change this or use a custom server with a changed version
https://github.com/PaperMC/Paper/blob/master/gradle.properties#L2

should be fixed in cf8fa59