mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 03:35:51 +00:00
Some refactoring and documentation
This commit is contained in:
parent
912eaa2383
commit
feadc9f231
@ -100,7 +100,7 @@ public final class SlimefunGuideSettings {
|
||||
});
|
||||
|
||||
if (SlimefunPlugin.getUpdater().getBranch().isOfficial()) {
|
||||
menu.addItem(49, new CustomItem(Material.REDSTONE_TORCH, "&4" + SlimefunPlugin.getLocal().getMessage(p, "guide.title.bugs"), "", "&7&oBug reports have to be made in English!", "", "&7Open Issues: &a" + SlimefunPlugin.getGitHubService().getIssues(), "&7Pending Pull Requests: &a" + SlimefunPlugin.getGitHubService().getPullRequests(), "", "&7\u21E8 &eClick to go to the Slimefun4 Bug Tracker"), (pl, slot, item, action) -> {
|
||||
menu.addItem(49, new CustomItem(Material.REDSTONE_TORCH, "&4" + SlimefunPlugin.getLocal().getMessage(p, "guide.title.bugs"), "", "&7&oBug reports have to be made in English!", "", "&7Open Issues: &a" + SlimefunPlugin.getGitHubService().getOpenissues(), "&7Pending Pull Requests: &a" + SlimefunPlugin.getGitHubService().getPendingPullRequests(), "", "&7\u21E8 &eClick to go to the Slimefun4 Bug Tracker"), (pl, slot, item, action) -> {
|
||||
pl.closeInventory();
|
||||
ChatUtils.sendURL(pl, "https://github.com/TheBusyBiscuit/Slimefun4/issues");
|
||||
return false;
|
||||
|
@ -35,6 +35,12 @@ public class GitHubService {
|
||||
private int stars = 0;
|
||||
private LocalDateTime lastUpdate = LocalDateTime.now();
|
||||
|
||||
/**
|
||||
* This creates a new {@link GitHubService} for the given repository.
|
||||
*
|
||||
* @param repository
|
||||
* The repository to create this {@link GitHubService} for
|
||||
*/
|
||||
public GitHubService(String repository) {
|
||||
this.repository = repository;
|
||||
|
||||
@ -103,35 +109,74 @@ public class GitHubService {
|
||||
});
|
||||
}
|
||||
|
||||
public Set<GitHubConnector> getConnectors() {
|
||||
protected Set<GitHubConnector> getConnectors() {
|
||||
return connectors;
|
||||
}
|
||||
|
||||
protected boolean isLoggingEnabled() {
|
||||
return logging;
|
||||
}
|
||||
|
||||
/**
|
||||
* This returns the {@link Contributor Contributors} to this project.
|
||||
*
|
||||
* @return A {@link ConcurrentMap} containing all {@link Contributor Contributors}
|
||||
*/
|
||||
public ConcurrentMap<String, Contributor> getContributors() {
|
||||
return contributors;
|
||||
}
|
||||
|
||||
/**
|
||||
* This returns the amount of forks of our repository
|
||||
*
|
||||
* @return The amount of forks
|
||||
*/
|
||||
public int getForks() {
|
||||
return forks;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method returns the amount of stargazers of the repository.
|
||||
*
|
||||
* @return The amount of people who starred the repository
|
||||
*/
|
||||
public int getStars() {
|
||||
return stars;
|
||||
}
|
||||
|
||||
public int getIssues() {
|
||||
/**
|
||||
* This returns the amount of open Issues on our repository.
|
||||
*
|
||||
* @return The amount of open issues
|
||||
*/
|
||||
public int getOpenissues() {
|
||||
return issues;
|
||||
}
|
||||
|
||||
public int getPullRequests() {
|
||||
/**
|
||||
* Returns the id of Slimefun's GitHub Repository. (e.g. "TheBusyBiscuit/Slimefun4").
|
||||
*
|
||||
* @return The id of our GitHub Repository
|
||||
*/
|
||||
public String getRepository() {
|
||||
return repository;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method returns the amount of pending pull requests.
|
||||
*
|
||||
* @return The amount of pending pull requests
|
||||
*/
|
||||
public int getPendingPullRequests() {
|
||||
return pullRequests;
|
||||
}
|
||||
|
||||
/**
|
||||
* This returns the date and time of the last commit to this repository.
|
||||
*
|
||||
* @return A {@link LocalDateTime} object representing the date and time of the latest commit
|
||||
*/
|
||||
public LocalDateTime getLastUpdate() {
|
||||
return lastUpdate;
|
||||
}
|
||||
|
||||
public boolean isLoggingEnabled() {
|
||||
return logging;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user