Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plugins {

dependencies {
implementation(platform(libs.aonyx.bom))
implementation(libs.slf4j.api)
compileOnly(libs.adventure)
compileOnly(libs.minestom)
compileOnly(libs.aves)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import net.minestom.server.coordinate.Pos;
import net.onelitefeather.cygnus.common.page.PageResource;

import java.util.List;
import java.util.Set;

/**
Expand All @@ -30,7 +31,7 @@ public final class GameMap extends BaseMap {
* @param survivorSpawns the spawn positions for the survivors
* @param builders the builders for the map
*/
public GameMap(String name, Pos spawn, Pos slenderSpawn, Set<PageResource> pageFaces, Set<Pos> survivorSpawns, String... builders) {
public GameMap(String name, Pos spawn, Pos slenderSpawn, Set<PageResource> pageFaces, Set<Pos> survivorSpawns, List<String> builders) {
super(name, spawn, builders);
this.slenderSpawn = slenderSpawn;
this.pageFaces = pageFaces;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public void setSlenderSpawn(@Nullable Pos slenderSpawn) {
*/
@Override
public GameMap build() {
return new GameMap(name, spawn, slenderSpawn, pageFaces, survivorSpawns, builders.toArray(new String[0]));
return new GameMap(name, spawn, slenderSpawn, pageFaces, survivorSpawns, builders);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

import java.util.List;
import java.util.Set;

import static org.junit.jupiter.api.Assertions.assertArrayEquals;
Expand All @@ -25,15 +26,15 @@ void testMapCreationWithGivenData() {
Pos slenderPos = new Pos(1, 1, 1);
Set<PageResource> pages = Set.of();
Set<Pos> survivorPos = Set.of(new Pos(2, 2, 2), new Pos(3, 3, 3));
GameMap gameMap = new GameMap(name, spawnPos, slenderPos, pages, survivorPos, "Test");
GameMap gameMap = new GameMap(name, spawnPos, slenderPos, pages, survivorPos, List.of("Test"));

assertNotNull(gameMap);
assertEquals(name, gameMap.getName());
assertEquals(spawnPos, gameMap.getSpawn());
assertEquals(name, gameMap.name());
assertEquals(spawnPos, gameMap.spawn());
assertEquals(slenderPos, gameMap.getSlenderSpawn());
assertTrue(gameMap.getPageFaces().isEmpty());
assertEquals(survivorPos, gameMap.getSurvivorSpawns());
assertArrayEquals(new String[]{"Test"}, gameMap.getBuilders());
assertEquals(List.of("Test"), gameMap.builders());
}

@Test
Expand Down
1 change: 1 addition & 0 deletions game/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ application {
dependencies {
implementation(platform(libs.aonyx.bom))
implementation(project(":common"))
implementation(libs.slf4j.api)
implementation(libs.minestom)
implementation(libs.aves)
implementation(libs.xerus)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public final class GameMapProvider extends AbstractMapProvider {

public GameMapProvider(Path path) {
super(GsonHelper.FILE_HANDLER, MapFilters::filterMapsForGame);
this.mapEntries = this.loadMapEntries(path.resolve("maps"));
this.loadMapEntries(path.resolve("maps"));

if (this.mapEntries.isEmpty()) {
throw new IllegalStateException("No maps found in the given path");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

import java.nio.file.Paths;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import static org.junit.jupiter.api.Assertions.assertEquals;
Expand Down Expand Up @@ -112,7 +113,7 @@ void testSlenderTeleport(@NotNull Env env) {
};
teamCreator.createTeams(gameConfig, teamService, ambientProvider);
Pos slenderSpawn = new Pos(10, 10, 10);
GameMap gameMap = new GameMap("Test", Pos.ZERO, slenderSpawn, Set.of(), Set.of(), "");
GameMap gameMap = new GameMap("Test", Pos.ZERO, slenderSpawn, Set.of(), Set.of(), List.of());
assertNotNull(gameMap);
assertEquals(slenderSpawn, gameMap.getSlenderSpawn());

Expand Down
5 changes: 4 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,14 @@ dependencyResolutionManagement {
create("libs") {
version("shadow", "9.4.2")
version("cloudnet", "4.0.0-RC16")
version("aonyx", "0.7.1")
version("aonyx", "0.7.3")
version("cyclonedx", "3.2.4")
version("pica", "0.0.3")
version("slf4j", "2.0.18")

library("aonyx.bom", "net.onelitefeather", "aonyx-bom").versionRef("aonyx")
library("slf4j.api", "org.slf4j", "slf4j-api").versionRef("slf4j")

library("minestom", "net.minestom", "minestom").withoutVersion()
library("adventure", "net.kyori", "adventure-text-minimessage").withoutVersion()
library("cyano", "net.onelitefeather", "cyano").withoutVersion()
Expand Down
1 change: 1 addition & 0 deletions setup/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ application {
dependencies {
implementation(platform(libs.aonyx.bom))
implementation(project(":common"))
implementation(libs.slf4j.api)
implementation(libs.minestom)
implementation(libs.aves)
implementation(libs.xerus)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public final class SetupMapProvider extends AbstractMapProvider {

public SetupMapProvider(Path path) {
super(GsonHelper.FILE_HANDLER, MapFilters::filterMapsForSetup);
this.mapEntries = loadMapEntries(path.resolve("maps"));
this.loadMapEntries(path.resolve("maps"));

Optional<MapEntry> lobbyOptional = this.mapEntries.stream().filter(MapEntry::hasMapFile)
.filter(mapEntry -> mapEntry.getDirectoryRoot().equals("lobby"))
Expand Down
Loading