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

[CI skip] 200+ contributors, we need a third page 👀

This commit is contained in:
TheBusyBiscuit 2021-04-19 20:15:56 +02:00
parent dcc5648c8f
commit 0fbb9b2d9b
5 changed files with 43 additions and 23 deletions

View File

@ -48,6 +48,6 @@ assignees: ''
<!-- Make sure that the screenshot covers the entire output of that command. --> <!-- Make sure that the screenshot covers the entire output of that command. -->
<!-- If your issue is related to other plugins, make sure to include the versions of these plugins too! --> <!-- If your issue is related to other plugins, make sure to include the versions of these plugins too! -->
- Server Software: - Server software:
- Minecraft Version: - Minecraft version:
- Slimefun Version: - Slimefun version:

View File

@ -1,12 +1,15 @@
## Description ## Description / Background
<!-- Please explain what you changed/added and why you did it in detail. --> <!-- Please explain why you are making this pull request. -->
<!-- Start writing below this line -->
## Changes ## Proposed changes
<!-- Please list all the changes you have made. --> <!-- Please explain what changes you have made to the code. -->
<!-- Start writing below this line -->
## Related Issues ## Related Issues (if applicable)
<!-- Please tag any Issues related to your Pull Request --> <!-- Please tag any Issues related to your Pull Request -->
<!-- Syntax: "Resolves #000" --> <!-- Syntax: "Resolves #000" -->
<!-- Start writing below this line -->
## Checklist ## Checklist
<!-- Here is a little checklist you should follow. --> <!-- Here is a little checklist you should follow. -->

View File

@ -50,8 +50,11 @@ class ContributionsConnector extends GitHubConnector {
* These people are... "special cases". * These people are... "special cases".
*/ */
private void loadConfiguration() { private void loadConfiguration() {
// Bots and invalid accounts we want to ignore.
ignoredAccounts.add("invalid-email-address"); ignoredAccounts.add("invalid-email-address");
ignoredAccounts.add("renovate");
ignoredAccounts.add("renovate-bot"); ignoredAccounts.add("renovate-bot");
ignoredAccounts.add("renovate[bot]");
ignoredAccounts.add("TheBusyBot"); ignoredAccounts.add("TheBusyBot");
ignoredAccounts.add("ImgBotApp"); ignoredAccounts.add("ImgBotApp");
ignoredAccounts.add("imgbot"); ignoredAccounts.add("imgbot");
@ -61,6 +64,7 @@ class ContributionsConnector extends GitHubConnector {
ignoredAccounts.add("gitlocalize-app[bot]"); ignoredAccounts.add("gitlocalize-app[bot]");
ignoredAccounts.add("mt-gitlocalize"); ignoredAccounts.add("mt-gitlocalize");
// Known Minecraft aliases.
aliases.put("WalshyDev", "HumanRightsAct"); aliases.put("WalshyDev", "HumanRightsAct");
aliases.put("J3fftw1", "_lagpc_"); aliases.put("J3fftw1", "_lagpc_");
aliases.put("ajan-12", "ajan_12"); aliases.put("ajan-12", "ajan_12");

View File

@ -13,6 +13,8 @@ import java.util.concurrent.TimeUnit;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import org.apache.commons.lang.Validate;
import io.github.thebusybiscuit.cscorelib2.config.Config; import io.github.thebusybiscuit.cscorelib2.config.Config;
import io.github.thebusybiscuit.slimefun4.core.services.localization.Translators; import io.github.thebusybiscuit.slimefun4.core.services.localization.Translators;
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin;
@ -78,10 +80,14 @@ public class GitHubService {
* the usual methods. * the usual methods.
*/ */
private void addDefaultContributors() { private void addDefaultContributors() {
// Artists
addContributor("Fuffles_", "&dArtist"); addContributor("Fuffles_", "&dArtist");
addContributor("IMS_Art", "&dArtist"); addContributor("IMS_Art", "https://github.com/IAmSorryArt", "&dArtist", 0);
// Addon Jam winners
addContributor("nahkd123", "&aWinner of the 2020 Addon Jam"); addContributor("nahkd123", "&aWinner of the 2020 Addon Jam");
// Translators
new Translators(this); new Translators(this);
} }
@ -94,6 +100,11 @@ public class GitHubService {
@Nonnull @Nonnull
public Contributor addContributor(@Nonnull String minecraftName, @Nonnull String profileURL, @Nonnull String role, int commits) { public Contributor addContributor(@Nonnull String minecraftName, @Nonnull String profileURL, @Nonnull String role, int commits) {
Validate.notNull(minecraftName, "Minecraft username must not be null.");
Validate.notNull(profileURL, "GitHub profile url must not be null.");
Validate.notNull(role, "Role should not be null.");
Validate.isTrue(commits >= 0, "Commit count cannot be negative.");;
String username = profileURL.substring(profileURL.lastIndexOf('/') + 1); String username = profileURL.substring(profileURL.lastIndexOf('/') + 1);
Contributor contributor = contributors.computeIfAbsent(username, key -> new Contributor(minecraftName, profileURL)); Contributor contributor = contributors.computeIfAbsent(username, key -> new Contributor(minecraftName, profileURL));
@ -106,9 +117,10 @@ public class GitHubService {
this.logging = logging; this.logging = logging;
addDefaultContributors(); addDefaultContributors();
// TheBusyBiscuit/Slimefun4 (twice because there may me multiple pages) // TheBusyBiscuit/Slimefun4 (multiple times because there may me multiple pages)
connectors.add(new ContributionsConnector(this, "code", 1, repository, "developer")); connectors.add(new ContributionsConnector(this, "code", 1, repository, "developer"));
connectors.add(new ContributionsConnector(this, "code2", 2, repository, "developer")); connectors.add(new ContributionsConnector(this, "code2", 2, repository, "developer"));
connectors.add(new ContributionsConnector(this, "code3", 3, repository, "developer"));
// TheBusyBiscuit/Slimefun4-Wiki // TheBusyBiscuit/Slimefun4-Wiki
connectors.add(new ContributionsConnector(this, "wiki", 1, "Slimefun/Wiki", "wiki")); connectors.add(new ContributionsConnector(this, "wiki", 1, "Slimefun/Wiki", "wiki"));
@ -122,6 +134,7 @@ public class GitHubService {
this.pendingPullRequests = pullRequests; this.pendingPullRequests = pullRequests;
})); }));
// Forks, star count and last commit date
connectors.add(new GitHubActivityConnector(this, repository, (forks, stars, date) -> { connectors.add(new GitHubActivityConnector(this, repository, (forks, stars, date) -> {
this.publicForks = forks; this.publicForks = forks;
this.stargazers = stars; this.stargazers = stars;

View File

@ -124,7 +124,7 @@ public abstract class SlimefunLocalization extends Localization implements Keyed
@Nonnull @Nonnull
@Override @Override
public String getMessage(@Nonnull String key) { public String getMessage(@Nonnull String key) {
Validate.notNull(key, "Message key cannot be null!"); Validate.notNull(key, "Message key must not be null!");
Language language = getDefaultLanguage(); Language language = getDefaultLanguage();
@ -140,8 +140,8 @@ public abstract class SlimefunLocalization extends Localization implements Keyed
@Nonnull @Nonnull
public String getMessage(@Nonnull Player p, @Nonnull String key) { public String getMessage(@Nonnull Player p, @Nonnull String key) {
Validate.notNull(p, "Player cannot be null!"); Validate.notNull(p, "Player must not be null!");
Validate.notNull(key, "Message key cannot be null!"); Validate.notNull(key, "Message key must not be null!");
Language language = getLanguage(p); Language language = getLanguage(p);
@ -161,8 +161,8 @@ public abstract class SlimefunLocalization extends Localization implements Keyed
@Nonnull @Nonnull
public List<String> getMessages(@Nonnull Player p, @Nonnull String key) { public List<String> getMessages(@Nonnull Player p, @Nonnull String key) {
Validate.notNull(p, "Player cannot be null!"); Validate.notNull(p, "Player should not be null.");
Validate.notNull(key, "Message key cannot be null!"); Validate.notNull(key, "Message key cannot be null.");
Language language = getLanguage(p); Language language = getLanguage(p);
@ -183,9 +183,9 @@ public abstract class SlimefunLocalization extends Localization implements Keyed
@Nonnull @Nonnull
@ParametersAreNonnullByDefault @ParametersAreNonnullByDefault
public List<String> getMessages(Player p, String key, UnaryOperator<String> function) { public List<String> getMessages(Player p, String key, UnaryOperator<String> function) {
Validate.notNull(p, "Player cannot be null!"); Validate.notNull(p, "Player cannot be null.");
Validate.notNull(key, "Message key cannot be null!"); Validate.notNull(key, "Message key cannot be null.");
Validate.notNull(function, "Function cannot be null!"); Validate.notNull(function, "Function cannot be null.");
List<String> messages = getMessages(p, key); List<String> messages = getMessages(p, key);
messages.replaceAll(function); messages.replaceAll(function);
@ -195,8 +195,8 @@ public abstract class SlimefunLocalization extends Localization implements Keyed
@Nullable @Nullable
public String getResearchName(@Nonnull Player p, @Nonnull NamespacedKey key) { public String getResearchName(@Nonnull Player p, @Nonnull NamespacedKey key) {
Validate.notNull(p, "Player cannot be null!"); Validate.notNull(p, "Player must not be null.");
Validate.notNull(key, "NamespacedKey cannot be null!"); Validate.notNull(key, "NamespacedKey cannot be null.");
Language language = getLanguage(p); Language language = getLanguage(p);
@ -209,7 +209,7 @@ public abstract class SlimefunLocalization extends Localization implements Keyed
@Nullable @Nullable
public String getCategoryName(@Nonnull Player p, @Nonnull NamespacedKey key) { public String getCategoryName(@Nonnull Player p, @Nonnull NamespacedKey key) {
Validate.notNull(p, "Player cannot be null!"); Validate.notNull(p, "Player must not be null.");
Validate.notNull(key, "NamespacedKey cannot be null!"); Validate.notNull(key, "NamespacedKey cannot be null!");
Language language = getLanguage(p); Language language = getLanguage(p);
@ -223,8 +223,8 @@ public abstract class SlimefunLocalization extends Localization implements Keyed
@Nullable @Nullable
public String getResourceString(@Nonnull Player p, @Nonnull String key) { public String getResourceString(@Nonnull Player p, @Nonnull String key) {
Validate.notNull(p, "Player cannot be null!"); Validate.notNull(p, "Player should not be null!");
Validate.notNull(key, "Message key cannot be null!"); Validate.notNull(key, "Message key should not be null!");
Language language = getLanguage(p); Language language = getLanguage(p);