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

[Ci skip] Preparing for the french...

This commit is contained in:
TheBusyBiscuit 2020-01-31 00:18:19 +01:00
parent 6b7435a181
commit 268f39cccd
2 changed files with 16 additions and 6 deletions

View File

@ -50,17 +50,19 @@ public class GitHubService {
contributors.put(fuffles.getName(), fuffles); contributors.put(fuffles.getName(), fuffles);
// Translators - German // Translators - German
addTranslator("TheBusyBiscuit", "de"); addTranslator("TheBusyBiscuit", "de", false);
// Translators - French // Translators - French
addTranslator("JustDams", "fr"); addTranslator("JustDams", "fr", true);
addTranslator("edkerforne", "fr"); addTranslator("edkerforne", "fr", true);
addTranslator("tnthomastn", "fr"); addTranslator("tnthomastn", "fr", true);
} }
private void addTranslator(String name, String language) { private void addTranslator(String name, String language, boolean lock) {
Contributor contributor = contributors.computeIfAbsent(name, user -> new Contributor(user, "https://github.com/" + user)); Contributor contributor = contributors.computeIfAbsent(name, user -> new Contributor(user, "https://github.com/" + user));
contributor.setContribution("translator," + language, 0); contributor.setContribution("translator," + language, 0);
if (lock) contributor.lock();
} }
public void connect(boolean logging) { public void connect(boolean logging) {

View File

@ -26,6 +26,8 @@ public class Contributor {
private final ConcurrentMap<String, Integer> contributions = new ConcurrentHashMap<>(); private final ConcurrentMap<String, Integer> contributions = new ConcurrentHashMap<>();
private final ComputedOptional<String> headTexture = ComputedOptional.createNew(); private final ComputedOptional<String> headTexture = ComputedOptional.createNew();
private boolean locked = false;
public Contributor(String name, String profile) { public Contributor(String name, String profile) {
ghName = profile.substring(profile.lastIndexOf('/') + 1); ghName = profile.substring(profile.lastIndexOf('/') + 1);
mcName = name; mcName = name;
@ -39,7 +41,9 @@ public class Contributor {
} }
public void setContribution(String role, int commits) { public void setContribution(String role, int commits) {
contributions.put(role, commits); if (!locked) {
contributions.put(role, commits);
}
} }
/** /**
@ -123,4 +127,8 @@ public class Contributor {
public String getDisplayName() { public String getDisplayName() {
return ChatColor.GRAY + ghName + (!ghName.equals(mcName) ? ChatColor.DARK_GRAY + " (MC: " + mcName + ")" : ""); return ChatColor.GRAY + ghName + (!ghName.equals(mcName) ? ChatColor.DARK_GRAY + " (MC: " + mcName + ")" : "");
} }
public void lock() {
this.locked = true;
}
} }