mirror of
https://github.com/TuxCoding/FastLogin.git
synced 2025-07-30 10:47:33 +02:00
Use static imports for Colectors.*
This commit is contained in:
4
.github/ISSUE_TEMPLATE.md
vendored
4
.github/ISSUE_TEMPLATE.md
vendored
@ -1,6 +1,6 @@
|
|||||||
[//]: # (Lines in this format are considered as comments and will not be displayed.)
|
[//]: # (Lines in this format are considered as comments and will not be displayed.)
|
||||||
[//]: #
|
[//]: #
|
||||||
[//]: # (Before reporting an issue make sure you are running the latest build of the plugin and checked for duplicate issues!)
|
[//]: # (Before reporting make sure you're running the **latest build** of the plugin and checked for duplicate issues!)
|
||||||
|
|
||||||
### What behaviour is observed:
|
### What behaviour is observed:
|
||||||
[//]: # (What happened?)
|
[//]: # (What happened?)
|
||||||
@ -15,7 +15,7 @@
|
|||||||
[//]: # (This can be found by running `/pl`)
|
[//]: # (This can be found by running `/pl`)
|
||||||
|
|
||||||
### Environment description
|
### Environment description
|
||||||
[//]: # (Standalone server/Bungeecord network with version and build number , SQLite/MySQL, ...)
|
[//]: # (Server software with exact version number, Minecraft version, SQLite/MySQL, ...)
|
||||||
|
|
||||||
### Plugin version or build number (don't write latest):
|
### Plugin version or build number (don't write latest):
|
||||||
[//]: # (This can be found by running `/version plugin-name`.)
|
[//]: # (This can be found by running `/version plugin-name`.)
|
||||||
|
@ -74,6 +74,7 @@
|
|||||||
<groupId>com.comphenix.protocol</groupId>
|
<groupId>com.comphenix.protocol</groupId>
|
||||||
<artifactId>ProtocolLib</artifactId>
|
<artifactId>ProtocolLib</artifactId>
|
||||||
<version>4.3.0</version>
|
<version>4.3.0</version>
|
||||||
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -81,6 +82,7 @@
|
|||||||
<artifactId>ProtocolSupport</artifactId>
|
<artifactId>ProtocolSupport</artifactId>
|
||||||
<!--4.25.dev-->
|
<!--4.25.dev-->
|
||||||
<version>a4f060dc46</version>
|
<version>a4f060dc46</version>
|
||||||
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -102,6 +104,7 @@
|
|||||||
<groupId>fr.xephi</groupId>
|
<groupId>fr.xephi</groupId>
|
||||||
<artifactId>authme</artifactId>
|
<artifactId>authme</artifactId>
|
||||||
<version>5.3.2</version>
|
<version>5.3.2</version>
|
||||||
|
<scope>provided</scope>
|
||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
@ -115,6 +118,7 @@
|
|||||||
<groupId>com.lenis0012.bukkit</groupId>
|
<groupId>com.lenis0012.bukkit</groupId>
|
||||||
<artifactId>loginsecurity</artifactId>
|
<artifactId>loginsecurity</artifactId>
|
||||||
<version>2.1.7</version>
|
<version>2.1.7</version>
|
||||||
|
<scope>provided</scope>
|
||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
@ -128,8 +132,8 @@
|
|||||||
<groupId>com.github.games647</groupId>
|
<groupId>com.github.games647</groupId>
|
||||||
<artifactId>LogIt</artifactId>
|
<artifactId>LogIt</artifactId>
|
||||||
<version>9e3581db27</version>
|
<version>9e3581db27</version>
|
||||||
<optional>true</optional>
|
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
|
<optional>true</optional>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>*</groupId>
|
<groupId>*</groupId>
|
||||||
@ -142,6 +146,7 @@
|
|||||||
<groupId>de.luricos.bukkit</groupId>
|
<groupId>de.luricos.bukkit</groupId>
|
||||||
<artifactId>xAuth</artifactId>
|
<artifactId>xAuth</artifactId>
|
||||||
<version>2.6</version>
|
<version>2.6</version>
|
||||||
|
<scope>provided</scope>
|
||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
<!--These artifacts produce conflicts on downloading-->
|
<!--These artifacts produce conflicts on downloading-->
|
||||||
<exclusions>
|
<exclusions>
|
||||||
|
@ -14,12 +14,13 @@ import java.nio.file.Path;
|
|||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.plugin.messaging.PluginMessageListener;
|
import org.bukkit.plugin.messaging.PluginMessageListener;
|
||||||
|
|
||||||
|
import static java.util.stream.Collectors.toSet;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Responsible for receiving messages from a BungeeCord instance.
|
* Responsible for receiving messages from a BungeeCord instance.
|
||||||
*
|
*
|
||||||
@ -104,7 +105,7 @@ public class BungeeListener implements PluginMessageListener {
|
|||||||
return Files.lines(whitelistFile)
|
return Files.lines(whitelistFile)
|
||||||
.map(String::trim)
|
.map(String::trim)
|
||||||
.map(UUID::fromString)
|
.map(UUID::fromString)
|
||||||
.collect(Collectors.toSet());
|
.collect(toSet());
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
plugin.getLog().error("Failed to create file for Proxy whitelist", ex);
|
plugin.getLog().error("Failed to create file for Proxy whitelist", ex);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
|
@ -48,6 +48,7 @@
|
|||||||
<groupId>me.vik1395</groupId>
|
<groupId>me.vik1395</groupId>
|
||||||
<artifactId>BungeeAuth</artifactId>
|
<artifactId>BungeeAuth</artifactId>
|
||||||
<version>1.4</version>
|
<version>1.4</version>
|
||||||
|
<scope>provided</scope>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>*</groupId>
|
<groupId>*</groupId>
|
||||||
|
@ -38,6 +38,7 @@
|
|||||||
<version>1.7.25</version>
|
<version>1.7.25</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!--GSON is not at the right position for Minecraft 1.7-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.code.gson</groupId>
|
<groupId>com.google.code.gson</groupId>
|
||||||
<artifactId>gson</artifactId>
|
<artifactId>gson</artifactId>
|
||||||
|
@ -22,13 +22,15 @@ import java.util.Set;
|
|||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.concurrent.ConcurrentMap;
|
import java.util.concurrent.ConcurrentMap;
|
||||||
import java.util.function.Function;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
import net.md_5.bungee.config.Configuration;
|
import net.md_5.bungee.config.Configuration;
|
||||||
import net.md_5.bungee.config.ConfigurationProvider;
|
import net.md_5.bungee.config.ConfigurationProvider;
|
||||||
import net.md_5.bungee.config.YamlConfiguration;
|
import net.md_5.bungee.config.YamlConfiguration;
|
||||||
|
|
||||||
|
import static java.util.function.Function.identity;
|
||||||
|
import static java.util.stream.Collectors.toList;
|
||||||
|
import static java.util.stream.Collectors.toMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param <P> GameProfile class
|
* @param <P> GameProfile class
|
||||||
* @param <C> CommandSender
|
* @param <C> CommandSender
|
||||||
@ -63,7 +65,7 @@ public class FastLoginCore<P extends C, C, T extends PlatformPlugin<C>> {
|
|||||||
messages.getKeys()
|
messages.getKeys()
|
||||||
.stream()
|
.stream()
|
||||||
.filter(key -> messages.get(key) != null)
|
.filter(key -> messages.get(key) != null)
|
||||||
.collect(Collectors.toMap(Function.identity(), messages::get))
|
.collect(toMap(identity(), messages::get))
|
||||||
.forEach((key, message) -> {
|
.forEach((key, message) -> {
|
||||||
String colored = CommonUtil.translateColorCodes((String) message);
|
String colored = CommonUtil.translateColorCodes((String) message);
|
||||||
if (!colored.isEmpty()) {
|
if (!colored.isEmpty()) {
|
||||||
@ -77,7 +79,7 @@ public class FastLoginCore<P extends C, C, T extends PlatformPlugin<C>> {
|
|||||||
List<String> ipAddresses = config.getStringList("ip-addresses");
|
List<String> ipAddresses = config.getStringList("ip-addresses");
|
||||||
int requestLimit = config.getInt("mojang-request-limit");
|
int requestLimit = config.getInt("mojang-request-limit");
|
||||||
List<String> proxyList = config.get("proxies", new ArrayList<>());
|
List<String> proxyList = config.get("proxies", new ArrayList<>());
|
||||||
List<HostAndPort> proxies = proxyList.stream().map(HostAndPort::fromString).collect(Collectors.toList());
|
List<HostAndPort> proxies = proxyList.stream().map(HostAndPort::fromString).collect(toList());
|
||||||
|
|
||||||
this.apiConnector = plugin.makeApiConnector(ipAddresses, requestLimit, proxies);
|
this.apiConnector = plugin.makeApiConnector(ipAddresses, requestLimit, proxies);
|
||||||
}
|
}
|
||||||
|
2
pom.xml
2
pom.xml
@ -41,7 +41,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>pl.project13.maven</groupId>
|
<groupId>pl.project13.maven</groupId>
|
||||||
<artifactId>git-commit-id-plugin</artifactId>
|
<artifactId>git-commit-id-plugin</artifactId>
|
||||||
<version>2.2.3</version>
|
<version>2.2.4</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<failOnNoGitDirectory>false</failOnNoGitDirectory>
|
<failOnNoGitDirectory>false</failOnNoGitDirectory>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
Reference in New Issue
Block a user