Skip to content

Commit

Permalink
add Leaf Updater
Browse files Browse the repository at this point in the history
  • Loading branch information
HSGamer committed Sep 10, 2024
1 parent 3fdd577 commit 257eaee
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public final class UpdateBuilder {
registerUpdater(PlazmaUpdater::new, "plazma");
registerUpdater(KaiijuUpdater::new, "kaiiju", "kaiijumc");
registerUpdater(DivineUpdater::new, "divine", "divinemc");
registerUpdater(LeafUpdater::new, "leaf");
}

private final String project;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package me.hsgamer.mcserverupdater.updater;

import me.hsgamer.mcserverupdater.api.GithubReleaseUpdater;
import me.hsgamer.mcserverupdater.util.VersionQuery;
import org.json.JSONObject;

import java.util.regex.Pattern;

public class LeafUpdater extends GithubReleaseUpdater {
public LeafUpdater(VersionQuery versionQuery) {
super(versionQuery, "Winds-Studio/Leaf");
}

@Override
public Pattern getArtifactPattern() {
return Pattern.compile("leaf-[\\d.]+(-mojmap)?\\.jar");
}

@Override
public String getDefaultVersion() {
return "1.21.1";
}

@Override
public JSONObject getReleaseObject() {
return getReleaseByTag("ver-" + version);
}
}

0 comments on commit 257eaee

Please sign in to comment.