From fed61f92361fdcea5f1d4adb46c57ea1d210642b Mon Sep 17 00:00:00 2001 From: Aaron <51387595+AzureAaron@users.noreply.github.com> Date: Tue, 14 Jul 2026 23:38:13 -0400 Subject: [PATCH] Add Abiphone Contacts support --- .../github/moulberry/repo/NEUConstants.java | 2 ++ .../repo/constants/AbiphoneContact.java | 30 +++++++++++++++++++ .../moulberry/repo/NEURepoParserTest.java | 10 +++++++ 3 files changed, 42 insertions(+) create mode 100644 src/main/java/io/github/moulberry/repo/constants/AbiphoneContact.java diff --git a/src/main/java/io/github/moulberry/repo/NEUConstants.java b/src/main/java/io/github/moulberry/repo/NEUConstants.java index 2689d34..e6ab4ef 100644 --- a/src/main/java/io/github/moulberry/repo/NEUConstants.java +++ b/src/main/java/io/github/moulberry/repo/NEUConstants.java @@ -15,6 +15,7 @@ @Getter public class NEUConstants implements IReloadable { + Map abiphoneContacts; Bonuses bonuses; Parents parents; Enchants enchants; @@ -29,6 +30,7 @@ public class NEUConstants implements IReloadable { ResourcePack resourcePack; public void reload(NEURepository repository) throws NEURepositoryException { + abiphoneContacts = repository.requireFile("constants/abiphone.json").json(new TypeToken>() {}); bonuses = repository.requireFile("constants/bonuses.json").json(Bonuses.class); parents = new Parents(repository.requireFile("constants/parents.json") .json(new TypeToken>>() { diff --git a/src/main/java/io/github/moulberry/repo/constants/AbiphoneContact.java b/src/main/java/io/github/moulberry/repo/constants/AbiphoneContact.java new file mode 100644 index 0000000..07f1b76 --- /dev/null +++ b/src/main/java/io/github/moulberry/repo/constants/AbiphoneContact.java @@ -0,0 +1,30 @@ +package io.github.moulberry.repo.constants; + +import java.util.List; + +import org.checkerframework.checker.nullness.qual.Nullable; + +import com.google.gson.annotations.SerializedName; + +import lombok.Getter; + +public class AbiphoneContact { + @Getter + @Nullable List callNames; + + @Getter + @SerializedName("requirement") + List requirements; + + @Getter + @Nullable String island; + + @Getter + @Nullable Integer x; + + @Getter + @Nullable Integer y; + + @Getter + @Nullable Integer z; +} diff --git a/src/test/java/io/github/moulberry/repo/NEURepoParserTest.java b/src/test/java/io/github/moulberry/repo/NEURepoParserTest.java index 83892a5..324cff8 100644 --- a/src/test/java/io/github/moulberry/repo/NEURepoParserTest.java +++ b/src/test/java/io/github/moulberry/repo/NEURepoParserTest.java @@ -1,5 +1,6 @@ package io.github.moulberry.repo; +import io.github.moulberry.repo.constants.AbiphoneContact; import io.github.moulberry.repo.data.*; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; @@ -7,6 +8,7 @@ import java.nio.file.Paths; import java.util.Collections; +import java.util.Objects; import java.util.stream.Collectors; public class NEURepoParserTest { @@ -114,4 +116,12 @@ void testUnknownRecipes() { .collect(Collectors.toList()) ); } + + @Test + void testAbiphoneContacts() { + AbiphoneContact elizabeth = repository.getConstants().getAbiphoneContacts().get("Elizabeth"); + + Assertions.assertTrue(Objects.requireNonNull(elizabeth.getCallNames()).contains("elizabeth")); + Assertions.assertEquals("hub", elizabeth.getIsland()); + } }