diff --git a/src/main/java/me/totalfreedom/plex/command/impl/AdventureCMD.java b/src/main/java/me/totalfreedom/plex/command/impl/AdventureCMD.java index ab5aeb7..0801df2 100644 --- a/src/main/java/me/totalfreedom/plex/command/impl/AdventureCMD.java +++ b/src/main/java/me/totalfreedom/plex/command/impl/AdventureCMD.java @@ -2,6 +2,8 @@ package me.totalfreedom.plex.command.impl; import java.util.Collections; import java.util.List; + +import com.google.common.collect.ImmutableList; import me.totalfreedom.plex.command.PlexCommand; import me.totalfreedom.plex.command.annotation.CommandParameters; import me.totalfreedom.plex.command.annotation.CommandPermissions; @@ -66,6 +68,6 @@ public class AdventureCMD extends PlexCommand { return PlexUtils.getPlayerNameList(); } - return Collections.emptyList(); + return ImmutableList.of(); } } diff --git a/src/main/java/me/totalfreedom/plex/command/impl/CreativeCMD.java b/src/main/java/me/totalfreedom/plex/command/impl/CreativeCMD.java index e76b1a0..ac719b5 100644 --- a/src/main/java/me/totalfreedom/plex/command/impl/CreativeCMD.java +++ b/src/main/java/me/totalfreedom/plex/command/impl/CreativeCMD.java @@ -2,6 +2,8 @@ package me.totalfreedom.plex.command.impl; import java.util.Collections; import java.util.List; + +import com.google.common.collect.ImmutableList; import me.totalfreedom.plex.command.PlexCommand; import me.totalfreedom.plex.command.annotation.CommandParameters; import me.totalfreedom.plex.command.annotation.CommandPermissions; @@ -65,6 +67,6 @@ public class CreativeCMD extends PlexCommand { return PlexUtils.getPlayerNameList(); } - return Collections.emptyList(); + return ImmutableList.of(); } } diff --git a/src/main/java/me/totalfreedom/plex/command/impl/SpectatorCMD.java b/src/main/java/me/totalfreedom/plex/command/impl/SpectatorCMD.java index 4ae6901..06eb272 100644 --- a/src/main/java/me/totalfreedom/plex/command/impl/SpectatorCMD.java +++ b/src/main/java/me/totalfreedom/plex/command/impl/SpectatorCMD.java @@ -2,6 +2,8 @@ package me.totalfreedom.plex.command.impl; import java.util.Collections; import java.util.List; + +import com.google.common.collect.ImmutableList; import me.totalfreedom.plex.command.PlexCommand; import me.totalfreedom.plex.command.annotation.CommandParameters; import me.totalfreedom.plex.command.annotation.CommandPermissions; @@ -62,6 +64,6 @@ public class SpectatorCMD extends PlexCommand { return PlexUtils.getPlayerNameList(); } - return Collections.emptyList(); + return ImmutableList.of(); } } \ No newline at end of file diff --git a/src/main/java/me/totalfreedom/plex/command/impl/SurvivalCMD.java b/src/main/java/me/totalfreedom/plex/command/impl/SurvivalCMD.java index 21e0b36..72fae82 100644 --- a/src/main/java/me/totalfreedom/plex/command/impl/SurvivalCMD.java +++ b/src/main/java/me/totalfreedom/plex/command/impl/SurvivalCMD.java @@ -2,6 +2,8 @@ package me.totalfreedom.plex.command.impl; import java.util.Collections; import java.util.List; + +import com.google.common.collect.ImmutableList; import me.totalfreedom.plex.command.PlexCommand; import me.totalfreedom.plex.command.annotation.CommandParameters; import me.totalfreedom.plex.command.annotation.CommandPermissions; @@ -65,6 +67,6 @@ public class SurvivalCMD extends PlexCommand { return PlexUtils.getPlayerNameList(); } - return Collections.emptyList(); + return ImmutableList.of(); } } diff --git a/src/main/java/me/totalfreedom/plex/util/PlexUtils.java b/src/main/java/me/totalfreedom/plex/util/PlexUtils.java index 95cdcc8..0ca7363 100644 --- a/src/main/java/me/totalfreedom/plex/util/PlexUtils.java +++ b/src/main/java/me/totalfreedom/plex/util/PlexUtils.java @@ -13,6 +13,7 @@ import java.util.List; import java.util.Map; import java.util.Random; import java.util.UUID; +import java.util.concurrent.ThreadLocalRandom; import java.util.stream.Collectors; import me.totalfreedom.plex.Plex; import me.totalfreedom.plex.config.Config; @@ -225,4 +226,18 @@ public class PlexUtils String uuidString = (String)profile.get("uuid"); return UUID.fromString(uuidString); } + + public static int randomNum() + { + return ThreadLocalRandom.current().nextInt(); + } + + public static int randomNum(int limit) + { + return ThreadLocalRandom.current().nextInt(limit); + } + public static int randomNum(int start, int limit) + { + return ThreadLocalRandom.current().nextInt(start, limit); + } }