mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-12-23 09:37:38 +01:00
Switched to TheBusyBiscuit's GitHubWebAPI4Java
This commit is contained in:
parent
3c3e01747b
commit
23f4e66a02
14
pom.xml
14
pom.xml
@ -176,12 +176,6 @@
|
||||
<version>${spigot.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- Some APIs from us :D -->
|
||||
<dependency>
|
||||
<groupId>world.bentobox</groupId>
|
||||
<artifactId>GitHubAPI4Java</artifactId>
|
||||
<version>${githubapi.version}</version>
|
||||
</dependency>
|
||||
<!-- Metrics -->
|
||||
<dependency>
|
||||
<groupId>org.bstats</groupId>
|
||||
@ -243,6 +237,12 @@
|
||||
<artifactId>dynmap-api</artifactId>
|
||||
<version>3.0-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- Shaded APIs -->
|
||||
<dependency>
|
||||
<groupId>com.github.TheBusyBiscuit</groupId>
|
||||
<artifactId>GitHubWebAPI4Java</artifactId>
|
||||
<version>f972b82</version>
|
||||
</dependency>
|
||||
<!-- Static analysis -->
|
||||
<!-- We are using Eclipse's annotations.
|
||||
@ -336,7 +336,7 @@
|
||||
<shadedPattern>world.bentobox.bentobox.util.metrics</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>world.bentobox.githubapi4java</pattern>
|
||||
<pattern>io.github.TheBusyBiscuit.GitHubWebAPI4Java</pattern>
|
||||
<shadedPattern>world.bentobox.bentobox.api.github</shadedPattern>
|
||||
</relocation>
|
||||
</relocations>
|
||||
|
@ -3,13 +3,13 @@ package world.bentobox.bentobox.managers;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import io.github.TheBusyBiscuit.GitHubWebAPI4Java.GitHubWebAPI;
|
||||
import io.github.TheBusyBiscuit.GitHubWebAPI4Java.objects.GitHubGist;
|
||||
import org.eclipse.jdt.annotation.NonNull;
|
||||
import org.eclipse.jdt.annotation.Nullable;
|
||||
import world.bentobox.bentobox.BentoBox;
|
||||
import world.bentobox.bentobox.Settings;
|
||||
import world.bentobox.bentobox.web.catalog.CatalogEntry;
|
||||
import world.bentobox.githubapi4java.GitHub;
|
||||
import world.bentobox.githubapi4java.objects.GitHubGist;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -24,7 +24,7 @@ import java.util.Optional;
|
||||
public class WebManager {
|
||||
|
||||
private @NonNull BentoBox plugin;
|
||||
private @Nullable GitHub gitHub;
|
||||
private @Nullable GitHubWebAPI gitHub;
|
||||
private @NonNull List<CatalogEntry> addonsCatalog;
|
||||
private @NonNull List<CatalogEntry> gamemodesCatalog;
|
||||
|
||||
@ -35,7 +35,7 @@ public class WebManager {
|
||||
|
||||
// Setup the GitHub connection
|
||||
if (plugin.getSettings().isGithubDownloadData()) {
|
||||
this.gitHub = new GitHub();
|
||||
this.gitHub = new GitHubWebAPI();
|
||||
|
||||
long connectionInterval = plugin.getSettings().getGithubConnectionInterval() * 20L * 60L;
|
||||
if (connectionInterval <= 0) {
|
||||
@ -98,12 +98,12 @@ public class WebManager {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an optional that may contain the {@link GitHub} instance only and only if {@link Settings#isGithubDownloadData()} is {@code true}.
|
||||
* Returns an optional that may contain the {@link GitHubWebAPI} instance only and only if {@link Settings#isGithubDownloadData()} is {@code true}.
|
||||
* @return the GitHub instance.
|
||||
* @since 1.5.0
|
||||
*/
|
||||
@NonNull
|
||||
public Optional<GitHub> getGitHub() {
|
||||
public Optional<GitHubWebAPI> getGitHub() {
|
||||
return Optional.ofNullable(gitHub);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user