1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 03:35:51 +00:00

[Ci skip] Little preparation

This commit is contained in:
TheBusyBiscuit 2020-01-30 23:19:42 +01:00
parent 761d52a9c6
commit aa3007ef0a
5 changed files with 21 additions and 6 deletions

View File

@ -357,7 +357,12 @@ public final class GuideSettings {
String info = entry.getKey();
if (!info.startsWith("&")) {
info = SlimefunPlugin.getLocal().getMessage(p, "guide.credits.roles." + info);
String[] segments = info.split(",");
info = SlimefunPlugin.getLocal().getMessage(p, "guide.credits.roles." + segments[0]);
if (segments.length == 2) {
info += " &7(" + SlimefunPlugin.getLocal().getMessage(p, "languages." + segments[1]) + ")";
}
}
if (entry.getValue() > 0) {

View File

@ -45,13 +45,16 @@ public class GitHubService {
}
private void addDefaultContributors() {
Contributor thebusybiscuit = new Contributor("TheBusyBiscuit", "https://github.com/TheBusyBiscuit");
thebusybiscuit.setContribution("&4Original Creator", 0);
contributors.put(thebusybiscuit.getName(), thebusybiscuit);
Contributor fuffles = new Contributor("Fuffles_");
fuffles.setContribution("&dSkull Texture Artist", 0);
contributors.put(fuffles.getName(), fuffles);
addTranslator("TheBusyBiscuit", "de");
}
private void addTranslator(String name, String language) {
Contributor contributor = contributors.computeIfAbsent(name, user -> new Contributor(user, "https://github.com/" + user));
contributor.setContribution("translator," + language, 0);
}
public void connect(boolean logging) {

View File

@ -22,7 +22,9 @@ public class ContributionsConnector extends GitHubConnector {
"ImgBotApp",
"imgbot",
"imgbot[bot]",
"github-actions[bot]"
"github-actions[bot]",
"gitlocalize-app",
"gitlocalize-app[bot]"
);
// Matches a GitHub name with a Minecraft name.

View File

@ -78,6 +78,10 @@ public class Contributor {
return list;
}
public int getContributions(String role) {
return contributions.getOrDefault(role, 0);
}
/**
* Returns this Creator's head texture.
* If no texture could be found, or it hasn't been pulled yet,

View File

@ -1,5 +1,6 @@
package io.github.thebusybiscuit.slimefun4.core.services.github;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;