mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-02-16 20:32:29 +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>
|
<version>${spigot.version}</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- Some APIs from us :D -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>world.bentobox</groupId>
|
|
||||||
<artifactId>GitHubAPI4Java</artifactId>
|
|
||||||
<version>${githubapi.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- Metrics -->
|
<!-- Metrics -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bstats</groupId>
|
<groupId>org.bstats</groupId>
|
||||||
@ -243,6 +237,12 @@
|
|||||||
<artifactId>dynmap-api</artifactId>
|
<artifactId>dynmap-api</artifactId>
|
||||||
<version>3.0-SNAPSHOT</version>
|
<version>3.0-SNAPSHOT</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<!-- Shaded APIs -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.TheBusyBiscuit</groupId>
|
||||||
|
<artifactId>GitHubWebAPI4Java</artifactId>
|
||||||
|
<version>f972b82</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- Static analysis -->
|
<!-- Static analysis -->
|
||||||
<!-- We are using Eclipse's annotations.
|
<!-- We are using Eclipse's annotations.
|
||||||
@ -336,7 +336,7 @@
|
|||||||
<shadedPattern>world.bentobox.bentobox.util.metrics</shadedPattern>
|
<shadedPattern>world.bentobox.bentobox.util.metrics</shadedPattern>
|
||||||
</relocation>
|
</relocation>
|
||||||
<relocation>
|
<relocation>
|
||||||
<pattern>world.bentobox.githubapi4java</pattern>
|
<pattern>io.github.TheBusyBiscuit.GitHubWebAPI4Java</pattern>
|
||||||
<shadedPattern>world.bentobox.bentobox.api.github</shadedPattern>
|
<shadedPattern>world.bentobox.bentobox.api.github</shadedPattern>
|
||||||
</relocation>
|
</relocation>
|
||||||
</relocations>
|
</relocations>
|
||||||
|
@ -3,13 +3,13 @@ package world.bentobox.bentobox.managers;
|
|||||||
import com.google.gson.JsonElement;
|
import com.google.gson.JsonElement;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
import com.google.gson.JsonParser;
|
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.NonNull;
|
||||||
import org.eclipse.jdt.annotation.Nullable;
|
import org.eclipse.jdt.annotation.Nullable;
|
||||||
import world.bentobox.bentobox.BentoBox;
|
import world.bentobox.bentobox.BentoBox;
|
||||||
import world.bentobox.bentobox.Settings;
|
import world.bentobox.bentobox.Settings;
|
||||||
import world.bentobox.bentobox.web.catalog.CatalogEntry;
|
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.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -24,7 +24,7 @@ import java.util.Optional;
|
|||||||
public class WebManager {
|
public class WebManager {
|
||||||
|
|
||||||
private @NonNull BentoBox plugin;
|
private @NonNull BentoBox plugin;
|
||||||
private @Nullable GitHub gitHub;
|
private @Nullable GitHubWebAPI gitHub;
|
||||||
private @NonNull List<CatalogEntry> addonsCatalog;
|
private @NonNull List<CatalogEntry> addonsCatalog;
|
||||||
private @NonNull List<CatalogEntry> gamemodesCatalog;
|
private @NonNull List<CatalogEntry> gamemodesCatalog;
|
||||||
|
|
||||||
@ -35,7 +35,7 @@ public class WebManager {
|
|||||||
|
|
||||||
// Setup the GitHub connection
|
// Setup the GitHub connection
|
||||||
if (plugin.getSettings().isGithubDownloadData()) {
|
if (plugin.getSettings().isGithubDownloadData()) {
|
||||||
this.gitHub = new GitHub();
|
this.gitHub = new GitHubWebAPI();
|
||||||
|
|
||||||
long connectionInterval = plugin.getSettings().getGithubConnectionInterval() * 20L * 60L;
|
long connectionInterval = plugin.getSettings().getGithubConnectionInterval() * 20L * 60L;
|
||||||
if (connectionInterval <= 0) {
|
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.
|
* @return the GitHub instance.
|
||||||
* @since 1.5.0
|
* @since 1.5.0
|
||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
public Optional<GitHub> getGitHub() {
|
public Optional<GitHubWebAPI> getGitHub() {
|
||||||
return Optional.ofNullable(gitHub);
|
return Optional.ofNullable(gitHub);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user