Skip to content

Commit

Permalink
Multi-ver support. Allow 1.21.1 versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Dueris committed Aug 10, 2024
1 parent fcf9d83 commit 084cf8a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ allprojects {
"mcVer" to mcVer,
"pluginVer" to pluginVer,
"fullVer" to "mc$mcVer-$pluginVer",
"apiVer" to "1.$mcMajorVer"
"apiVer" to "1.$mcMajorVer",
"supportedVersions" to listOf("1.21", "1.21.1")
)
inputs.properties(props)
filesMatching("paper-plugin.yml") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ public void finalizePreboot() {
String contents = new String(bytes, StandardCharsets.UTF_8);
YamlConfiguration yamlConfiguration = new YamlConfiguration();
yamlConfiguration.loadFromString(contents);
versions.add(yamlConfiguration.getString("supportedVer"));
if (!yamlConfiguration.contains("supportedVersions")) throw new RuntimeException("Supported Versions list not found in plugin yaml!");
versions.addAll(yamlConfiguration.getStringList("supportedVersions"));
LANGUAGE = yamlConfiguration.getString("default-language");
} catch (InvalidConfigurationException | IOException var8) {
throw new RuntimeException(var8);
Expand Down Expand Up @@ -213,7 +214,7 @@ public void onEnable() {
if (isCorrectVersion) {
this.getLogger().severe("Unable to start OriginsPaper due to it not being compatible with this server type");
} else {
this.getLogger().severe("Unable to start OriginsPaper due to it not being compatible with this server version");
this.getLogger().severe("Unable to start OriginsPaper due to it not being compatible with this server version, {}".replace("{}", version));
}

Bukkit.getLogger().info("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
Expand Down
2 changes: 1 addition & 1 deletion origins/src/main/resources/paper-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ dependencies:
load: BEFORE
required: false

supportedVer: "${mcVer}"
supportedVersions: ${supportedVersions}
default-language: "en_us"

0 comments on commit 084cf8a

Please sign in to comment.