This commit is contained in:
ayunami2000 2022-04-17 19:44:42 -04:00
parent 5823b0c790
commit c7658647fc

View file

@ -13,11 +13,10 @@ import org.bukkit.entity.Player;
public class ListEndpoint extends AbstractServlet public class ListEndpoint extends AbstractServlet
{ {
List<String> players = new ArrayList<>();
@GetMapping(endpoint = "/api/list/") @GetMapping(endpoint = "/api/list/")
public String getOnlinePlayers(HttpServletRequest request, HttpServletResponse response) public String getOnlinePlayers(HttpServletRequest request, HttpServletResponse response)
{ {
List<String> players = new ArrayList<>();
for (Player player : Bukkit.getOnlinePlayers()) for (Player player : Bukkit.getOnlinePlayers())
{ {
players.add(player.getName()); players.add(player.getName());