Skip to content

Commit

Permalink
Merge pull request #4028 from Slimefun/chore/replace-buildspage-with-…
Browse files Browse the repository at this point in the history
…blobbuild
  • Loading branch information
Sfiguz7 authored Dec 3, 2023
2 parents 0589b21 + 087e985 commit dc82173
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@

import javax.annotation.Nonnull;

import io.github.bakedlibs.dough.updater.BlobBuildUpdater;
import org.bukkit.plugin.Plugin;

import io.github.bakedlibs.dough.config.Config;
import io.github.bakedlibs.dough.updater.GitHubBuildsUpdater;
import io.github.bakedlibs.dough.updater.PluginUpdater;
import io.github.bakedlibs.dough.versions.PrefixedVersion;
import io.github.thebusybiscuit.slimefun4.api.SlimefunBranch;
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;

/**
* This Class represents our {@link PluginUpdater} Service.
* If enabled, it will automatically connect to https://thebusybiscuit.github.io/builds/
* If enabled, it will automatically connect to https://blob.build/
* to check for updates and to download them automatically.
*
* @author TheBusyBiscuit
Expand Down Expand Up @@ -53,15 +53,15 @@ public class UpdaterService {
*/
public UpdaterService(@Nonnull Slimefun plugin, @Nonnull String version, @Nonnull File file) {
this.plugin = plugin;
GitHubBuildsUpdater autoUpdater = null;
BlobBuildUpdater autoUpdater = null;

if (version.contains("UNOFFICIAL")) {
// This Server is using a modified build that is not a public release.
branch = SlimefunBranch.UNOFFICIAL;
} else if (version.startsWith("DEV - ")) {
} else if (version.startsWith("Dev - ")) {
// If we are using a development build, we want to switch to our custom
try {
autoUpdater = new GitHubBuildsUpdater(plugin, file, "TheBusyBiscuit/Slimefun4/master");
autoUpdater = new BlobBuildUpdater(plugin, file, "Slimefun4", "Dev");
} catch (Exception x) {
plugin.getLogger().log(Level.SEVERE, "Failed to create AutoUpdater", x);
}
Expand All @@ -70,7 +70,7 @@ public UpdaterService(@Nonnull Slimefun plugin, @Nonnull String version, @Nonnul
} else if (version.startsWith("RC - ")) {
// If we are using a "stable" build, we want to switch to our custom
try {
autoUpdater = new GitHubBuildsUpdater(plugin, file, "TheBusyBiscuit/Slimefun4/stable", "RC - ");
autoUpdater = new BlobBuildUpdater(plugin, file, "Slimefun4", "RC");
} catch (Exception x) {
plugin.getLogger().log(Level.SEVERE, "Failed to create AutoUpdater", x);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static void unload() {
@Test
@DisplayName("Test if the development branch is recognized correctly")
void testDevelopmentBuilds() {
UpdaterService service = new UpdaterService(plugin, "DEV - 131 (git 123456)", file);
UpdaterService service = new UpdaterService(plugin, "Dev - 131 (git 123456)", file);
Assertions.assertEquals(SlimefunBranch.DEVELOPMENT, service.getBranch());
Assertions.assertTrue(service.getBranch().isOfficial());
// Cannot currently be tested... yay
Expand Down

0 comments on commit dc82173

Please sign in to comment.