diff --git a/Core/src/main/java/com/readutf/inari/core/arena/stores/schematic/SchematicArenaManager.java b/Core/src/main/java/com/readutf/inari/core/arena/stores/schematic/SchematicArenaManager.java index 7580c7e..8de32b2 100644 --- a/Core/src/main/java/com/readutf/inari/core/arena/stores/schematic/SchematicArenaManager.java +++ b/Core/src/main/java/com/readutf/inari/core/arena/stores/schematic/SchematicArenaManager.java @@ -207,10 +207,6 @@ private Arena loadArena(ArenaMeta arenaMeta) throws IOException, WorldEditExcept List list = new ArrayList<>(); for (ArenaMeta arenaMeta : availableArenas) { if (predicate.test(arenaMeta)) { - if (cachedArenas.getOrDefault(arenaMeta, new ArrayDeque<>()).isEmpty()) { - logger.info("Failed to find available arena for " + arenaMeta.getName() + ", low cache level"); - continue; - } list.add(arenaMeta); } } diff --git a/Core/src/main/java/com/readutf/inari/core/commands/ArenaCommands.java b/Core/src/main/java/com/readutf/inari/core/commands/ArenaCommands.java index a94f16c..48356e1 100644 --- a/Core/src/main/java/com/readutf/inari/core/commands/ArenaCommands.java +++ b/Core/src/main/java/com/readutf/inari/core/commands/ArenaCommands.java @@ -4,18 +4,15 @@ import co.aikar.commands.annotation.CommandAlias; import co.aikar.commands.annotation.Subcommand; import com.readutf.inari.core.arena.ArenaManager; -import com.readutf.inari.core.arena.exceptions.ArenaLoadException; import com.readutf.inari.core.arena.exceptions.ArenaStoreException; import com.readutf.inari.core.arena.meta.ArenaMeta; import com.readutf.inari.core.arena.selection.SelectionManager; -import com.readutf.inari.core.arena.stores.gridworld.GridArenaManager; import com.readutf.inari.core.utils.ColorUtils; import com.readutf.inari.core.utils.WorldCuboid; import lombok.AllArgsConstructor; import net.md_5.bungee.api.ChatColor; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; -import org.bukkit.scheduler.BukkitRunnable; import java.util.List; @@ -47,41 +44,15 @@ public void createArena(Player player, String name) { } - @Subcommand( "testload" ) - public void testLoad(Player player) { + @Subcommand( "list" ) + public void listArenas(Player player) { + List allArenas = arenaManager.findAvailableArenas(arenaMeta -> true); - try { - - - List availableArenas = arenaManager.findAvailableArenas(arenaMeta -> true); - - availableArenas.stream().findFirst().ifPresent(arenaMeta -> { - try { - arenaManager.load(arenaMeta).thenAccept(arena -> { - - - player.sendMessage(ChatColor.GREEN + "Loaded arena " + arenaMeta.getName()); - - System.out.println(arena); - - player.teleport(arena.getBounds().getMin().toLocation(GridArenaManager.getActiveArenasWorld())); - - new BukkitRunnable() { - @Override - public void run() { - arenaManager.unload(arena); - } - }.runTaskLater(javaPlugin, 20 * 5); - }); - - - } catch (ArenaLoadException e) { - e.getException().printStackTrace(); - } - }); - } catch (Exception e) { - e.printStackTrace(); + player.sendMessage(ColorUtils.color("&aAvailable Arenas:")); + for (ArenaMeta allArena : allArenas) { + player.sendMessage(ColorUtils.color(" &8* &f%s &7(%s markers)".formatted(allArena.getName(), allArena.getNumOfMarkers()))); } + } } diff --git a/Development/src/main/java/com/readutf/inari/test/InariDemo.java b/Development/src/main/java/com/readutf/inari/test/InariDemo.java index a35cba3..189eb9a 100644 --- a/Development/src/main/java/com/readutf/inari/test/InariDemo.java +++ b/Development/src/main/java/com/readutf/inari/test/InariDemo.java @@ -45,7 +45,7 @@ public InariDemo() { public void onEnable() { WorldEditSelectionManager worldEditSelectionManager = new WorldEditSelectionManager(); - this.arenaManager = new SchematicArenaManager(this, new TileEntityScanner(), new WorldEditLoader(this), new File(getDataFolder(), "arenas")); + this.arenaManager = new SchematicArenaManager(this, new TileEntityScanner(), new WorldEditLoader(this), new File(getDataFolder(), "schematics")); // this.arenaManager = new GridArenaManager(this, getDataFolder(), new TileEntityScanner()); this.gameManager = new GameManager(); this.gameEventManager = new GameEventManager(this, gameManager); diff --git a/Development/src/main/java/com/readutf/inari/test/commands/GameCommand.java b/Development/src/main/java/com/readutf/inari/test/commands/GameCommand.java index f3b8721..cdfdfe9 100644 --- a/Development/src/main/java/com/readutf/inari/test/commands/GameCommand.java +++ b/Development/src/main/java/com/readutf/inari/test/commands/GameCommand.java @@ -21,8 +21,7 @@ public class GameCommand extends BaseCommand { private final ArenaManager arenaManager; private final GameStarterManager gameStarterManager; - - + @SneakyThrows @Subcommand("start") @CommandCompletion("@gametypes @arena @players") public void start(Player player, String gameName, String arenaName, String... players) {