mirror of
https://github.com/itHotL/PlayerStats.git
synced 2024-11-22 11:55:17 +01:00
Changed banlist-check for player-is-banned check if LiteBans is present (#77), release v1.5!
This commit is contained in:
parent
98d9f94544
commit
5093fc6398
@ -3,7 +3,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.gmail.artemis-the-gr8</groupId>
|
||||
<artifactId>PlayerStats</artifactId>
|
||||
<version>1.4</version>
|
||||
<version>1.5</version>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
|
2
pom.xml
2
pom.xml
@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>com.gmail.artemis-the-gr8</groupId>
|
||||
<artifactId>PlayerStats</artifactId>
|
||||
<version>1.4</version>
|
||||
<version>1.5</version>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
|
@ -13,12 +13,12 @@ import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.ConsoleCommandSender;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ForkJoinPool;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
public class ReloadThread extends Thread {
|
||||
|
||||
@ -91,10 +91,17 @@ public class ReloadThread extends Thread {
|
||||
"retrieved whitelist", time, DebugLevel.MEDIUM);
|
||||
}
|
||||
else if (config.excludeBanned()) {
|
||||
Set<OfflinePlayer> bannedPlayers = Bukkit.getBannedPlayers();
|
||||
offlinePlayers = Arrays.stream(Bukkit.getOfflinePlayers())
|
||||
.parallel()
|
||||
.filter(offlinePlayer -> !bannedPlayers.contains(offlinePlayer)).toArray(OfflinePlayer[]::new);
|
||||
if (Bukkit.getPluginManager().getPlugin("LiteBans") != null) {
|
||||
offlinePlayers = Arrays.stream(Bukkit.getOfflinePlayers())
|
||||
.parallel()
|
||||
.filter(Predicate.not(OfflinePlayer::isBanned))
|
||||
.toArray(OfflinePlayer[]::new);
|
||||
} else {
|
||||
Set<OfflinePlayer> bannedPlayers = Bukkit.getBannedPlayers();
|
||||
offlinePlayers = Arrays.stream(Bukkit.getOfflinePlayers())
|
||||
.parallel()
|
||||
.filter(offlinePlayer -> !bannedPlayers.contains(offlinePlayer)).toArray(OfflinePlayer[]::new);
|
||||
}
|
||||
MyLogger.logTimeTaken("ReloadThread",
|
||||
"retrieved banlist", time, DebugLevel.MEDIUM);
|
||||
}
|
||||
|
BIN
src/main/resources/images/distance_format.png
Normal file
BIN
src/main/resources/images/distance_format.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
BIN
src/main/resources/images/time_format.png
Normal file
BIN
src/main/resources/images/time_format.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 21 KiB |
@ -1,6 +1,6 @@
|
||||
main: com.gmail.artemis.the.gr8.playerstats.Main
|
||||
name: PlayerStats
|
||||
version: 1.4
|
||||
version: 1.5
|
||||
api-version: 1.18
|
||||
description: adds commands to view player statistics in chat
|
||||
author: Artemis_the_gr8
|
||||
|
Loading…
Reference in New Issue
Block a user