mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-07-02 04:56:40 +00:00
Too much shit to list in the commit name
- Removes ancient unused code - General code cleanup in some places - Rewrites a few components to use Adventure (testing needed) - Rewrites a few commands to use more modern Java features like Streams - Fixes oversight where vanishing still worked by names and not UUIDs - Removes unused Pterodactyl integration - Removes AutoEject's IP range banning functionality - Does some minor cleanup to HTTPD's list & players modules - Fixes ages-old bug in the AntiSpam that caused it to falsely mute players
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
@ -15,17 +16,6 @@ import org.bukkit.entity.Player;
|
||||
@CommandParameters(description = "See who has an item and optionally clear the specified item.", usage = "/<command> <item> [clear]", aliases = "wh")
|
||||
public class Command_whohas extends FreedomCommand
|
||||
{
|
||||
|
||||
public static List<String> getAllMaterials()
|
||||
{
|
||||
List<String> names = new ArrayList<>();
|
||||
for (Material material : Material.values())
|
||||
{
|
||||
names.add(material.name());
|
||||
}
|
||||
return names;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
@ -49,7 +39,7 @@ public class Command_whohas extends FreedomCommand
|
||||
|
||||
for (final Player player : server.getOnlinePlayers())
|
||||
{
|
||||
if (!plugin.al.isAdmin(sender) && plugin.al.isVanished(player.getName()))
|
||||
if (!plugin.al.isAdmin(sender) && plugin.al.isVanished(player.getUniqueId()))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@ -80,7 +70,7 @@ public class Command_whohas extends FreedomCommand
|
||||
{
|
||||
if (args.length == 1)
|
||||
{
|
||||
return getAllMaterials();
|
||||
return Arrays.stream(Material.values()).map(Enum::name).toList();
|
||||
}
|
||||
|
||||
if (args.length == 2 && plugin.al.isAdmin(sender))
|
||||
|
Reference in New Issue
Block a user