From 2fe63b53b6a882c1747384cad61c5e92498d651d Mon Sep 17 00:00:00 2001 From: Mari023 <38946771+Mari023@users.noreply.github.com> Date: Sun, 28 Jul 2024 14:08:22 +0200 Subject: [PATCH] New api (#288) * add api subproject * WIP move api into its own mod * update mdg * load ae2wtlib api when ae2wtlib is present * rename the api run config, so it doesn't run both * fix ordering so ae2wtlib runs after api (and by extension, ae2) * fix ordering so ae2wtlib runs after ae2 (turns out ordering is not applied transitively) * properly register components * get the ModContainer via constructor parameter * fix upgrades, run terminal registration at the right time * spotless * make api methods static instead of requiring to use .instance() anywhere * move lang entries that are relevant on api to api * scale up icon to 400*400 because neoforge is stupid and doesn't use nearest neighbor scaling * slightly clean up buildscript * use sourceSet instead of subproject * CHANGELOG [no ci] * Revert "use sourceSet instead of subproject" This reverts commit ca32ef0e3c9c2cd531fd8144d0bd420a2c75543a. * update dependencies * add incompatible marker to currently released extendedae versions * CHANGELOG [no ci] * fix rebase error * match changes from main branch * move assets that are required in api to api * remove outdated icon from gui * always open universal terminal first if there is one * update reference textures and move them into their own folder [no ci] * update dependencies * slightly change which libraries are set as dependencies sadly I can't get it to not include the runtimeOnly dependencies * add modmaven publishing * add megacells as incompatibility * fix modmaven publishing using the wrong url * use smaller scale icon again and turn off blurring * fix typo in CHANGELOG * update incompatible version ranges for extendedae and megacells * add incompatibility with old ae2wtlib versions to ae2wtlib_api * fix formatting in build.gradle.kts * add some api documentation to the readme --- .github/workflows/publish.yml | 7 +- CHANGELOG.md | 2 + README.md | 52 ++ api/build.gradle.kts | 111 ++++ api/gradle.properties | 1 + .../de/mari_023/ae2wtlib/api/AE2wtlibAPI.java | 76 +++ .../ae2wtlib/api/AE2wtlibAPIEntrypoint.java | 26 + .../ae2wtlib/api/AE2wtlibAPIImpl.java | 53 ++ .../ae2wtlib/api}/AE2wtlibComponents.java | 20 +- .../mari_023/ae2wtlib/api}/TextConstants.java | 4 +- .../api/gui}/AE2wtlibSlotSemantics.java | 2 +- .../de/mari_023/ae2wtlib/api/gui}/Icon.java | 2 +- .../ae2wtlib/api/gui}/IconButton.java | 2 +- .../api/gui}/ScrollingUpgradesPanel.java | 6 +- .../ae2wtlib/api/gui}/UpgradeBackground.java | 2 +- .../ae2wtlib/api/gui}/package-info.java | 2 +- .../mari_023/ae2wtlib/api}/package-info.java | 2 +- .../api/registration}/AddTerminalEvent.java | 6 +- .../api/registration}/UpgradeHelper.java | 24 +- .../api/registration}/WTDefinition.java | 17 +- .../registration}/WTDefinitionBuilder.java | 19 +- .../api/registration/package-info.java | 9 + .../api}/results/ActionHostResult.java | 2 +- .../ae2wtlib/api}/results/LongResult.java | 2 +- .../ae2wtlib/api}/results/Result.java | 2 +- .../ae2wtlib/api}/results/Status.java | 4 +- .../ae2wtlib/api/results/package-info.java | 9 + .../terminal}/Ae2wtlibLocatingService.java | 5 +- .../terminal}/IUniversalTerminalCapable.java | 16 +- .../ae2wtlib/api}/terminal/ItemWT.java | 8 +- .../ae2wtlib/api/terminal}/ItemWUT.java | 6 +- .../ae2wtlib/api}/terminal/WTMenuHost.java | 19 +- .../ae2wtlib/api/terminal}/WUTHandler.java | 33 +- .../ae2wtlib/api/terminal/package-info.java | 9 + .../resources/META-INF/accesstransformer.cfg | 3 + .../resources/META-INF/neoforge.mods.toml | 44 ++ .../assets/ae2/screens/wtlib/schema.json | 505 ++++++++++++++++++ .../ae2/screens/wtlib/universal_terminal.json | 0 .../assets/ae2/textures/wtlib/guis/icons.png | Bin 0 -> 913 bytes .../assets/ae2wtlib_api/lang/de_de.json | 7 + .../assets/ae2wtlib_api/lang/en_ud.json | 7 + .../assets/ae2wtlib_api/lang/en_us.json | 7 + api/src/main/resources/icon.png | Bin 0 -> 224 bytes build.gradle.kts | 84 +-- gradle.properties | 10 +- gradlew | 2 +- settings.gradle.kts | 1 + .../java/de/mari_023/ae2wtlib/AE2wtlib.java | 33 +- .../ae2wtlib/AE2wtlibAPIImplementation.java | 42 ++ .../AE2wtlibAdditionalComponents.java | 28 + .../ae2wtlib/AE2wtlibCreativeTab.java | 8 +- .../de/mari_023/ae2wtlib/AE2wtlibEvents.java | 1 + .../de/mari_023/ae2wtlib/AE2wtlibForge.java | 22 +- .../de/mari_023/ae2wtlib/AE2wtlibItems.java | 4 +- .../mari_023/ae2wtlib/AE2wtlibTestPlots.java | 2 +- .../ae2wtlib/hotkeys/MagnetHotkeyAction.java | 2 +- .../ae2wtlib/hotkeys/RestockHotkeyAction.java | 8 +- .../ae2wtlib/mixin/RestockRender.java | 2 +- .../networking/CycleTerminalPacket.java | 8 +- .../networking/RestockAmountPacket.java | 4 +- .../networking/UpdateRestockPacket.java | 4 +- .../ae2wtlib/networking/UpdateWUTPackage.java | 8 +- .../ae2wtlib/recipeviewer/JEIPlugin.java | 4 +- .../ae2wtlib/recipeviewer/REIPlugin.java | 4 +- .../de/mari_023/ae2wtlib/wat/ItemWAT.java | 2 +- .../de/mari_023/ae2wtlib/wat/WATMenu.java | 6 +- .../de/mari_023/ae2wtlib/wat/WATMenuHost.java | 4 +- .../de/mari_023/ae2wtlib/wat/WATScreen.java | 6 +- .../ae2wtlib/{terminal => wct}/ArmorSlot.java | 4 +- .../ae2wtlib/wct/CraftingTerminalHandler.java | 8 +- .../de/mari_023/ae2wtlib/wct/ItemWCT.java | 2 +- .../de/mari_023/ae2wtlib/wct/TrashMenu.java | 2 +- .../de/mari_023/ae2wtlib/wct/WCTMenu.java | 7 +- .../de/mari_023/ae2wtlib/wct/WCTMenuHost.java | 8 +- .../de/mari_023/ae2wtlib/wct/WCTScreen.java | 9 +- .../WrappedPlayerInventory.java | 2 +- .../wct/magnet_card/MagnetHandler.java | 7 +- .../ae2wtlib/wct/magnet_card/MagnetHost.java | 2 +- .../ae2wtlib/wct/magnet_card/MagnetMenu.java | 2 +- .../wct/magnet_card/MagnetScreen.java | 6 +- .../de/mari_023/ae2wtlib/wet/ItemWET.java | 2 +- .../de/mari_023/ae2wtlib/wet/WETMenu.java | 6 +- .../de/mari_023/ae2wtlib/wet/WETMenuHost.java | 6 +- .../de/mari_023/ae2wtlib/wet/WETScreen.java | 6 +- .../mari_023/ae2wtlib/wut/WTDefinitions.java | 9 +- .../mari_023/ae2wtlib/wut/recipe/Combine.java | 2 +- .../wut/recipe/CombineSerializer.java | 2 +- .../mari_023/ae2wtlib/wut/recipe/Common.java | 6 +- .../mari_023/ae2wtlib/wut/recipe/Upgrade.java | 2 +- .../wut/recipe/UpgradeSerializer.java | 2 +- .../ae2wtlib/wut/select/WUTSelectScreen.java | 9 +- .../resources/META-INF/neoforge.mods.toml | 34 +- .../textures/wtlib/guis/crafting-REF-FULL.png | Bin 3543 -> 0 bytes .../ae2/textures/wtlib/guis/crafting-REF.png | Bin 889 -> 0 bytes .../assets/ae2/textures/wtlib/guis/icons.png | Bin 939 -> 0 bytes .../ae2/textures/wtlib/guis/magnet-REF.png | Bin 615 -> 0 bytes .../resources/assets/ae2wtlib/lang/de_de.json | 8 +- .../resources/assets/ae2wtlib/lang/en_ud.json | 8 +- .../resources/assets/ae2wtlib/lang/en_us.json | 8 +- .../texture_references/crafting-REF-FULL.png | Bin 0 -> 3553 bytes .../texture_references/magnet-REF.png | Bin 0 -> 543 bytes 101 files changed, 1302 insertions(+), 299 deletions(-) create mode 100644 api/build.gradle.kts create mode 100644 api/gradle.properties create mode 100644 api/src/main/java/de/mari_023/ae2wtlib/api/AE2wtlibAPI.java create mode 100644 api/src/main/java/de/mari_023/ae2wtlib/api/AE2wtlibAPIEntrypoint.java create mode 100644 api/src/main/java/de/mari_023/ae2wtlib/api/AE2wtlibAPIImpl.java rename {src/main/java/de/mari_023/ae2wtlib => api/src/main/java/de/mari_023/ae2wtlib/api}/AE2wtlibComponents.java (78%) rename {src/main/java/de/mari_023/ae2wtlib => api/src/main/java/de/mari_023/ae2wtlib/api}/TextConstants.java (98%) rename {src/main/java/de/mari_023/ae2wtlib => api/src/main/java/de/mari_023/ae2wtlib/api/gui}/AE2wtlibSlotSemantics.java (96%) rename {src/main/java/de/mari_023/ae2wtlib/terminal => api/src/main/java/de/mari_023/ae2wtlib/api/gui}/Icon.java (98%) rename {src/main/java/de/mari_023/ae2wtlib/terminal => api/src/main/java/de/mari_023/ae2wtlib/api/gui}/IconButton.java (98%) rename {src/main/java/de/mari_023/ae2wtlib/terminal => api/src/main/java/de/mari_023/ae2wtlib/api/gui}/ScrollingUpgradesPanel.java (97%) rename {src/main/java/de/mari_023/ae2wtlib/terminal => api/src/main/java/de/mari_023/ae2wtlib/api/gui}/UpgradeBackground.java (93%) rename {src/main/java/de/mari_023/ae2wtlib/terminal => api/src/main/java/de/mari_023/ae2wtlib/api/gui}/package-info.java (86%) rename {src/main/java/de/mari_023/ae2wtlib/terminal/results => api/src/main/java/de/mari_023/ae2wtlib/api}/package-info.java (83%) rename {src/main/java/de/mari_023/ae2wtlib/wut => api/src/main/java/de/mari_023/ae2wtlib/api/registration}/AddTerminalEvent.java (92%) rename {src/main/java/de/mari_023/ae2wtlib => api/src/main/java/de/mari_023/ae2wtlib/api/registration}/UpgradeHelper.java (73%) rename {src/main/java/de/mari_023/ae2wtlib/wut => api/src/main/java/de/mari_023/ae2wtlib/api/registration}/WTDefinition.java (89%) rename {src/main/java/de/mari_023/ae2wtlib/wut => api/src/main/java/de/mari_023/ae2wtlib/api/registration}/WTDefinitionBuilder.java (87%) create mode 100644 api/src/main/java/de/mari_023/ae2wtlib/api/registration/package-info.java rename {src/main/java/de/mari_023/ae2wtlib/terminal => api/src/main/java/de/mari_023/ae2wtlib/api}/results/ActionHostResult.java (90%) rename {src/main/java/de/mari_023/ae2wtlib/terminal => api/src/main/java/de/mari_023/ae2wtlib/api}/results/LongResult.java (85%) rename {src/main/java/de/mari_023/ae2wtlib/terminal => api/src/main/java/de/mari_023/ae2wtlib/api}/results/Result.java (80%) rename {src/main/java/de/mari_023/ae2wtlib/terminal => api/src/main/java/de/mari_023/ae2wtlib/api}/results/Status.java (93%) create mode 100644 api/src/main/java/de/mari_023/ae2wtlib/api/results/package-info.java rename {src/main/java/de/mari_023/ae2wtlib/hotkeys => api/src/main/java/de/mari_023/ae2wtlib/api/terminal}/Ae2wtlibLocatingService.java (83%) rename {src/main/java/de/mari_023/ae2wtlib/wut => api/src/main/java/de/mari_023/ae2wtlib/api/terminal}/IUniversalTerminalCapable.java (84%) rename {src/main/java/de/mari_023/ae2wtlib => api/src/main/java/de/mari_023/ae2wtlib/api}/terminal/ItemWT.java (90%) rename {src/main/java/de/mari_023/ae2wtlib/wut => api/src/main/java/de/mari_023/ae2wtlib/api/terminal}/ItemWUT.java (96%) rename {src/main/java/de/mari_023/ae2wtlib => api/src/main/java/de/mari_023/ae2wtlib/api}/terminal/WTMenuHost.java (95%) rename {src/main/java/de/mari_023/ae2wtlib/wut => api/src/main/java/de/mari_023/ae2wtlib/api/terminal}/WUTHandler.java (85%) create mode 100644 api/src/main/java/de/mari_023/ae2wtlib/api/terminal/package-info.java create mode 100644 api/src/main/resources/META-INF/accesstransformer.cfg create mode 100644 api/src/main/resources/META-INF/neoforge.mods.toml create mode 100644 api/src/main/resources/assets/ae2/screens/wtlib/schema.json rename {src => api/src}/main/resources/assets/ae2/screens/wtlib/universal_terminal.json (100%) create mode 100644 api/src/main/resources/assets/ae2/textures/wtlib/guis/icons.png create mode 100644 api/src/main/resources/assets/ae2wtlib_api/lang/de_de.json create mode 100644 api/src/main/resources/assets/ae2wtlib_api/lang/en_ud.json create mode 100644 api/src/main/resources/assets/ae2wtlib_api/lang/en_us.json create mode 100644 api/src/main/resources/icon.png create mode 100644 src/main/java/de/mari_023/ae2wtlib/AE2wtlibAPIImplementation.java create mode 100644 src/main/java/de/mari_023/ae2wtlib/AE2wtlibAdditionalComponents.java rename src/main/java/de/mari_023/ae2wtlib/{terminal => wct}/ArmorSlot.java (96%) rename src/main/java/de/mari_023/ae2wtlib/{terminal => wct}/WrappedPlayerInventory.java (95%) delete mode 100644 src/main/resources/assets/ae2/textures/wtlib/guis/crafting-REF-FULL.png delete mode 100644 src/main/resources/assets/ae2/textures/wtlib/guis/crafting-REF.png delete mode 100644 src/main/resources/assets/ae2/textures/wtlib/guis/icons.png delete mode 100644 src/main/resources/assets/ae2/textures/wtlib/guis/magnet-REF.png create mode 100644 src/main/resources/texture_references/crafting-REF-FULL.png create mode 100644 src/main/resources/texture_references/magnet-REF.png diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 55f0378a..9d5e3c7e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -21,10 +21,13 @@ jobs: with: cache-read-only: true - - name: Build with Gradle - run: gradle build + - name: Build and publish with Gradle + run: gradle build publishAllPublicationsToModmavenRepository env: TAG: ${{ github.event.release.tag_name }} + MODMAVEN_USER: ${{ secrets.MODMAVEN_USER }} + MODMAVEN_PASSWORD: ${{ secrets.MODMAVEN_PASSWORD }} + ORG_GRADLE_PROJECT_runtimeItemlistMod: none - name: Upload a neoforge build uses: actions/upload-artifact@v4 diff --git a/CHANGELOG.md b/CHANGELOG.md index e69de29b..6d97803e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -0,0 +1,2 @@ +- new API for addons +- updated the mod icon diff --git a/README.md b/README.md index 6cb0726e..0214291a 100644 --- a/README.md +++ b/README.md @@ -36,3 +36,55 @@ It also adds a wireless universal terminal which has all wireless terminals in o * Text and Translations - [![License](https://img.shields.io/badge/License-No%20Restriction-green.svg?style=flat-square)](https://creativecommons.org/publicdomain/zero/1.0/) + +## API + +Like ae2, ae2wtlib is available on modmaven +``` +repositories { + maven { + url = uri("https://modmaven.dev/") + content { + includeGroup "appeng" + includeGroup "de.mari_023" + } + } +} +``` + +ae2wtlib has an api, which is what you should compile against when making integrations with ae2wtlib +``` +dependencies { + implementation("de.mari_023:ae2wtlib_api:VERSION") + runtimeOnly("de.mari_023:ae2wtlib:VERSION") +} +``` + +If you want to add your own terminals, you should jar-in-jar ae2wtlib_api +``` +dependencies { + jarJar(implementation("de.mari_023:ae2wtlib_api:VERSION")) + runtimeOnly("de.mari_023:ae2wtlib:VERSION") +} +``` + +If you want to add upgrades to ae2wtlib terminals, you can use `UpgradeHelper#addUpgradeToAllTerminals` +```java +addUpgradeToAllTerminals(upgradeCard, maxSupported); +// use 0 to add the maximum amount of upgrades the terminal can fit +addUpgradeToAllTerminals(upgradeCard, 0); +``` + +### Adding terminals + +For a simple example of a wireless terminal, you can look at the Wireless Pattern Access Terminal. +The related classes are `ItemWAT`, `WATMenu`, `WATMenuHost` and `WATScreen` + +For registration, you need to listen to the `AddTerminalEvent` (it isn't actually an EventBus event) +```java +AddTerminalEvent.register(event -> event.builder( + ... +).addTerminal()) +``` + +The builder has some additional methods for overriding properties that are inferred from other attributes, like `WTDefinitionBuilder#translationKey` diff --git a/api/build.gradle.kts b/api/build.gradle.kts new file mode 100644 index 00000000..336e3e4b --- /dev/null +++ b/api/build.gradle.kts @@ -0,0 +1,111 @@ +plugins { + id("net.neoforged.moddev") + id("com.diffplug.spotless") + id("maven-publish") + java + idea +} + +val ae2Version: String by project +val neoforgeVersion: String by project +val mavenGroup: String by project +val modID: String by project + + +version = "0.0.0-SNAPSHOT" + +val pr = System.getenv("PR_NUMBER") ?: "" +if (pr != "") { + version = "0.0.0-pr$pr" +} + +val tag = System.getenv("TAG") ?: "" +if (tag != "") { + version = tag +} + +val artifactVersion = version + +java.toolchain.languageVersion = JavaLanguageVersion.of(21) + +dependencies { + implementation("appeng:appliedenergistics2:${ae2Version}") + compileOnly("com.google.code.findbugs:jsr305:3.0.2") +} + +tasks { + processResources { + // Ensure the resources get re-evaluate when the version changes + inputs.property("version", version) + inputs.property("ae2_version", ae2Version) + + val replaceProperties = mapOf( + "version" to version as String, "ae2_version" to ae2Version + ) + + inputs.properties(replaceProperties) + filesMatching("META-INF/neoforge.mods.toml") { + expand(replaceProperties) + } + } + withType { + options.encoding = "UTF-8" + } +} + +neoForge { + version = neoforgeVersion + mods { + create(modID) { + sourceSet(sourceSets.main.get()) + } + } + runs { + configureEach { + gameDirectory.file("run") + systemProperty("forge.logging.console.level", "debug") + } + + create("api_client") { + client() + } + create("api_server") { + server() + } + } +} + +publishing { + publications { + create(modID) { + groupId = mavenGroup + artifactId = modID + version = artifactVersion.toString() + + from(components["java"]) + } + } + repositories { + maven { + credentials { + username = System.getenv("MODMAVEN_USER") + password = System.getenv("MODMAVEN_PASSWORD") + } + name = "modmaven" + url = uri("https://modmaven.dev/artifactory/local-releases/") + } + } +} + +spotless { + java { + target("/src/**/java/**/*.java") + + endWithNewline() + indentWithSpaces() + removeUnusedImports() + toggleOffOn() + eclipse().configFile("../codeformat/codeformat.xml") + importOrderFile("../codeformat/ae2wtlib.importorder") + } +} \ No newline at end of file diff --git a/api/gradle.properties b/api/gradle.properties new file mode 100644 index 00000000..6c29adcc --- /dev/null +++ b/api/gradle.properties @@ -0,0 +1 @@ +modID=ae2wtlib_api \ No newline at end of file diff --git a/api/src/main/java/de/mari_023/ae2wtlib/api/AE2wtlibAPI.java b/api/src/main/java/de/mari_023/ae2wtlib/api/AE2wtlibAPI.java new file mode 100644 index 00000000..fef42983 --- /dev/null +++ b/api/src/main/java/de/mari_023/ae2wtlib/api/AE2wtlibAPI.java @@ -0,0 +1,76 @@ +package de.mari_023.ae2wtlib.api; + +import java.util.function.Supplier; + +import com.mojang.datafixers.util.Unit; + +import org.jetbrains.annotations.ApiStatus; + +import net.minecraft.core.component.DataComponentType; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.neoforged.fml.ModList; + +import appeng.api.upgrades.IUpgradeInventory; +import appeng.menu.locator.ItemMenuHostLocator; + +import de.mari_023.ae2wtlib.api.terminal.ItemWUT; + +public class AE2wtlibAPI { + public static final String MOD_NAME = "ae2wtlib"; + public static final String API_MOD_NAME = "ae2wtlib_api"; + + private AE2wtlibAPI() {} + + public static ResourceLocation id(String name) { + return ResourceLocation.fromNamespaceAndPath(MOD_NAME, name); + } + + public static boolean isModPresent(String mod) { + return ModList.get().isLoaded(mod); + } + + public static boolean hasQuantumBridgeCard(Supplier upgrades) { + return AE2wtlibAPIImpl.instance().hasQuantumBridgeCard(upgrades); + } + + public static boolean isUniversalTerminal(Item item) { + return AE2wtlibAPIImpl.instance().isUniversalTerminal(item); + } + + public static boolean isUniversalTerminal(ItemStack stack) { + return isUniversalTerminal(stack.getItem()); + } + + public static ItemStack makeWUT(DataComponentType componentType) { + if (!(getWUT() instanceof ItemWUT wutItem)) + return ItemStack.EMPTY; + ItemStack wut = new ItemStack(wutItem); + + wut.set(componentType, Unit.INSTANCE); + return wut; + } + + public static Item getWUT() { + return AE2wtlibAPIImpl.instance().getWUT(); + } + + @ApiStatus.Internal + public static void cycleTerminal(boolean isHandlingRightClick) { + AE2wtlibAPIImpl.instance().cycleTerminal(isHandlingRightClick); + } + + /** + * Sends an update to the client about the current terminal. This is only relevant for Universal Terminals, and only + * sent when ae2wtlib is present. + * + * @param player The server player. + * @param locator The menu locator. + * @param stack The compound tag containing terminal data. + */ + public static void updateClientTerminal(ServerPlayer player, ItemMenuHostLocator locator, ItemStack stack) { + AE2wtlibAPIImpl.instance().updateClientTerminal(player, locator, stack); + } +} diff --git a/api/src/main/java/de/mari_023/ae2wtlib/api/AE2wtlibAPIEntrypoint.java b/api/src/main/java/de/mari_023/ae2wtlib/api/AE2wtlibAPIEntrypoint.java new file mode 100644 index 00000000..6c25fd68 --- /dev/null +++ b/api/src/main/java/de/mari_023/ae2wtlib/api/AE2wtlibAPIEntrypoint.java @@ -0,0 +1,26 @@ +package de.mari_023.ae2wtlib.api; + +import net.minecraft.core.Registry; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.core.registries.Registries; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.fml.common.Mod; +import net.neoforged.neoforge.registries.RegisterEvent; + +import de.mari_023.ae2wtlib.api.registration.AddTerminalEvent; +import de.mari_023.ae2wtlib.api.registration.UpgradeHelper; + +@Mod(AE2wtlibAPI.API_MOD_NAME) +public class AE2wtlibAPIEntrypoint { + public AE2wtlibAPIEntrypoint(IEventBus modEventBus) { + modEventBus.addListener((RegisterEvent event) -> { + if (!event.getRegistryKey().equals(Registries.ITEM)) { + return; + } + AddTerminalEvent.run(); + UpgradeHelper.addUpgrades(); + for (var entry : AE2wtlibComponents.DR.entrySet()) + Registry.register(BuiltInRegistries.DATA_COMPONENT_TYPE, entry.getKey(), entry.getValue()); + }); + } +} diff --git a/api/src/main/java/de/mari_023/ae2wtlib/api/AE2wtlibAPIImpl.java b/api/src/main/java/de/mari_023/ae2wtlib/api/AE2wtlibAPIImpl.java new file mode 100644 index 00000000..95b9fc98 --- /dev/null +++ b/api/src/main/java/de/mari_023/ae2wtlib/api/AE2wtlibAPIImpl.java @@ -0,0 +1,53 @@ +package de.mari_023.ae2wtlib.api; + +import java.util.Objects; +import java.util.function.Supplier; + +import org.jetbrains.annotations.ApiStatus; +import org.jetbrains.annotations.Nullable; + +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.Items; + +import appeng.api.upgrades.IUpgradeInventory; +import appeng.menu.locator.ItemMenuHostLocator; + +@ApiStatus.Internal +public class AE2wtlibAPIImpl { + @Nullable + private static AE2wtlibAPIImpl instance; + + protected AE2wtlibAPIImpl() { + if (instance != null) + throw new IllegalStateException("Already initialized"); + instance = this; + } + + public static AE2wtlibAPIImpl instance() { + return Objects.requireNonNull(instance); + } + + static { + if (!AE2wtlibAPI.isModPresent("ae2wtlib")) + new AE2wtlibAPIImpl(); + } + + public boolean hasQuantumBridgeCard(Supplier upgrades) { + return false; + } + + public boolean isUniversalTerminal(Item item) { + return false; + } + + public Item getWUT() { + return Items.AIR; + } + + @ApiStatus.Internal + public void cycleTerminal(boolean isHandlingRightClick) {} + + public void updateClientTerminal(ServerPlayer player, ItemMenuHostLocator locator, ItemStack stack) {} +} diff --git a/src/main/java/de/mari_023/ae2wtlib/AE2wtlibComponents.java b/api/src/main/java/de/mari_023/ae2wtlib/api/AE2wtlibComponents.java similarity index 78% rename from src/main/java/de/mari_023/ae2wtlib/AE2wtlibComponents.java rename to api/src/main/java/de/mari_023/ae2wtlib/api/AE2wtlibComponents.java index 09801cea..c9f16bbc 100644 --- a/src/main/java/de/mari_023/ae2wtlib/AE2wtlibComponents.java +++ b/api/src/main/java/de/mari_023/ae2wtlib/api/AE2wtlibComponents.java @@ -1,12 +1,10 @@ -package de.mari_023.ae2wtlib; +package de.mari_023.ae2wtlib.api; import java.util.HashMap; import java.util.Map; import java.util.function.Consumer; -import java.util.function.Supplier; import com.mojang.serialization.Codec; -import com.mojang.serialization.DataResult; import net.minecraft.core.component.DataComponentType; import net.minecraft.nbt.CompoundTag; @@ -14,19 +12,15 @@ import net.minecraft.network.codec.ByteBufCodecs; import net.minecraft.network.codec.StreamCodec; import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.component.ItemContainerContents; -import net.neoforged.neoforge.attachment.AttachmentType; import net.neoforged.neoforge.network.codec.NeoForgeStreamCodecs; import appeng.api.config.IncludeExclude; import appeng.menu.locator.ItemMenuHostLocator; import appeng.menu.locator.MenuLocators; -import de.mari_023.ae2wtlib.wct.CraftingTerminalHandler; -import de.mari_023.ae2wtlib.wct.magnet_card.MagnetMode; -import de.mari_023.ae2wtlib.wut.WTDefinition; +import de.mari_023.ae2wtlib.api.registration.WTDefinition; public class AE2wtlibComponents { private static final Consumer> COMPOUND_TAG_CODECS = builder -> builder @@ -51,10 +45,6 @@ public class AE2wtlibComponents { builder -> builder.persistent(ItemContainerContents.CODEC) .networkSynchronized(ItemContainerContents.STREAM_CODEC)); - public static final DataComponentType MAGNET_SETTINGS = register("magnet_settings", - builder -> builder.persistent(Codec.BYTE.comapFlatMap(b -> DataResult.success(MagnetMode.fromByte(b)), - MagnetMode::getId)) - .networkSynchronized(NeoForgeStreamCodecs.enumCodec(MagnetMode.class))); public static final DataComponentType PICKUP_CONFIG = register("pickup_config", COMPOUND_TAG_CODECS); public static final DataComponentType INSERT_CONFIG = register("insert_config", COMPOUND_TAG_CODECS); public static final DataComponentType PICKUP_MODE = register("pickup_mode", INCLUDE_EXCLUDE_CODECS); @@ -65,15 +55,11 @@ public class AE2wtlibComponents { public static final DataComponentType PATTERN_ENCODING_LOGIC = register("pattern_encoding_logic", COMPOUND_TAG_CODECS); - public static final Supplier> CT_HANDLER = AE2wtlib.ATTACHMENT_TYPES - .register("ct_handler", - () -> AttachmentType.builder((player) -> new CraftingTerminalHandler((Player) player)).build()); - public static DataComponentType register(String name, Consumer> customizer) { var builder = DataComponentType.builder(); customizer.accept(builder); var componentType = builder.build(); - DR.put(AE2wtlib.id(name), componentType); + DR.put(AE2wtlibAPI.id(name), componentType); return componentType; } diff --git a/src/main/java/de/mari_023/ae2wtlib/TextConstants.java b/api/src/main/java/de/mari_023/ae2wtlib/api/TextConstants.java similarity index 98% rename from src/main/java/de/mari_023/ae2wtlib/TextConstants.java rename to api/src/main/java/de/mari_023/ae2wtlib/api/TextConstants.java index 093fcea1..3d3d8a2b 100644 --- a/src/main/java/de/mari_023/ae2wtlib/TextConstants.java +++ b/api/src/main/java/de/mari_023/ae2wtlib/api/TextConstants.java @@ -1,4 +1,4 @@ -package de.mari_023.ae2wtlib; +package de.mari_023.ae2wtlib.api; import net.minecraft.ChatFormatting; import net.minecraft.network.chat.Component; @@ -7,7 +7,7 @@ import appeng.api.config.IncludeExclude; -import de.mari_023.ae2wtlib.wut.WTDefinition; +import de.mari_023.ae2wtlib.api.registration.WTDefinition; public final class TextConstants { private TextConstants() {} diff --git a/src/main/java/de/mari_023/ae2wtlib/AE2wtlibSlotSemantics.java b/api/src/main/java/de/mari_023/ae2wtlib/api/gui/AE2wtlibSlotSemantics.java similarity index 96% rename from src/main/java/de/mari_023/ae2wtlib/AE2wtlibSlotSemantics.java rename to api/src/main/java/de/mari_023/ae2wtlib/api/gui/AE2wtlibSlotSemantics.java index f63a7cdf..d9e6a88b 100644 --- a/src/main/java/de/mari_023/ae2wtlib/AE2wtlibSlotSemantics.java +++ b/api/src/main/java/de/mari_023/ae2wtlib/api/gui/AE2wtlibSlotSemantics.java @@ -1,4 +1,4 @@ -package de.mari_023.ae2wtlib; +package de.mari_023.ae2wtlib.api.gui; import appeng.menu.SlotSemantic; import appeng.menu.SlotSemantics; diff --git a/src/main/java/de/mari_023/ae2wtlib/terminal/Icon.java b/api/src/main/java/de/mari_023/ae2wtlib/api/gui/Icon.java similarity index 98% rename from src/main/java/de/mari_023/ae2wtlib/terminal/Icon.java rename to api/src/main/java/de/mari_023/ae2wtlib/api/gui/Icon.java index 3d108bf1..e5be9c7b 100644 --- a/src/main/java/de/mari_023/ae2wtlib/terminal/Icon.java +++ b/api/src/main/java/de/mari_023/ae2wtlib/api/gui/Icon.java @@ -1,4 +1,4 @@ -package de.mari_023.ae2wtlib.terminal; +package de.mari_023.ae2wtlib.api.gui; import net.minecraft.resources.ResourceLocation; diff --git a/src/main/java/de/mari_023/ae2wtlib/terminal/IconButton.java b/api/src/main/java/de/mari_023/ae2wtlib/api/gui/IconButton.java similarity index 98% rename from src/main/java/de/mari_023/ae2wtlib/terminal/IconButton.java rename to api/src/main/java/de/mari_023/ae2wtlib/api/gui/IconButton.java index 60c5caba..6bdc4593 100644 --- a/src/main/java/de/mari_023/ae2wtlib/terminal/IconButton.java +++ b/api/src/main/java/de/mari_023/ae2wtlib/api/gui/IconButton.java @@ -1,4 +1,4 @@ -package de.mari_023.ae2wtlib.terminal; +package de.mari_023.ae2wtlib.api.gui; import java.util.Collections; import java.util.List; diff --git a/src/main/java/de/mari_023/ae2wtlib/terminal/ScrollingUpgradesPanel.java b/api/src/main/java/de/mari_023/ae2wtlib/api/gui/ScrollingUpgradesPanel.java similarity index 97% rename from src/main/java/de/mari_023/ae2wtlib/terminal/ScrollingUpgradesPanel.java rename to api/src/main/java/de/mari_023/ae2wtlib/api/gui/ScrollingUpgradesPanel.java index 719e2e9f..da0ed502 100644 --- a/src/main/java/de/mari_023/ae2wtlib/terminal/ScrollingUpgradesPanel.java +++ b/api/src/main/java/de/mari_023/ae2wtlib/api/gui/ScrollingUpgradesPanel.java @@ -1,4 +1,4 @@ -package de.mari_023.ae2wtlib.terminal; +package de.mari_023.ae2wtlib.api.gui; import java.util.List; import java.util.function.Consumer; @@ -22,7 +22,7 @@ import appeng.core.localization.GuiText; import appeng.menu.slot.AppEngSlot; -import de.mari_023.ae2wtlib.AE2wtlibItems; +import de.mari_023.ae2wtlib.api.AE2wtlibAPI; public class ScrollingUpgradesPanel implements ICompositeWidget { private static final int SLOT_SIZE = 18; @@ -58,7 +58,7 @@ public ScrollingUpgradesPanel(List slots, IUpgradeableObject upgradeableOb private boolean singularitySlotHidden() { return isDisabledSlotEmpty((AppEngSlot) slots.getFirst()) - && !upgrades.get().isInstalled(AE2wtlibItems.QUANTUM_BRIDGE_CARD); + && !AE2wtlibAPI.hasQuantumBridgeCard(upgrades); } private boolean isDisabledSlotEmpty(AppEngSlot slot) { diff --git a/src/main/java/de/mari_023/ae2wtlib/terminal/UpgradeBackground.java b/api/src/main/java/de/mari_023/ae2wtlib/api/gui/UpgradeBackground.java similarity index 93% rename from src/main/java/de/mari_023/ae2wtlib/terminal/UpgradeBackground.java rename to api/src/main/java/de/mari_023/ae2wtlib/api/gui/UpgradeBackground.java index ff1452cc..f5ab70d2 100644 --- a/src/main/java/de/mari_023/ae2wtlib/terminal/UpgradeBackground.java +++ b/api/src/main/java/de/mari_023/ae2wtlib/api/gui/UpgradeBackground.java @@ -1,4 +1,4 @@ -package de.mari_023.ae2wtlib.terminal; +package de.mari_023.ae2wtlib.api.gui; public record UpgradeBackground(Icon top, Icon middle, Icon bottom) { diff --git a/src/main/java/de/mari_023/ae2wtlib/terminal/package-info.java b/api/src/main/java/de/mari_023/ae2wtlib/api/gui/package-info.java similarity index 86% rename from src/main/java/de/mari_023/ae2wtlib/terminal/package-info.java rename to api/src/main/java/de/mari_023/ae2wtlib/api/gui/package-info.java index 6936041d..7b1a8b7b 100644 --- a/src/main/java/de/mari_023/ae2wtlib/terminal/package-info.java +++ b/api/src/main/java/de/mari_023/ae2wtlib/api/gui/package-info.java @@ -1,7 +1,7 @@ @FieldsAreNonnullByDefault @ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault -package de.mari_023.ae2wtlib.terminal; +package de.mari_023.ae2wtlib.api.gui; import javax.annotation.ParametersAreNonnullByDefault; diff --git a/src/main/java/de/mari_023/ae2wtlib/terminal/results/package-info.java b/api/src/main/java/de/mari_023/ae2wtlib/api/package-info.java similarity index 83% rename from src/main/java/de/mari_023/ae2wtlib/terminal/results/package-info.java rename to api/src/main/java/de/mari_023/ae2wtlib/api/package-info.java index 438daa3c..d77201ef 100644 --- a/src/main/java/de/mari_023/ae2wtlib/terminal/results/package-info.java +++ b/api/src/main/java/de/mari_023/ae2wtlib/api/package-info.java @@ -1,7 +1,7 @@ @FieldsAreNonnullByDefault @ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault -package de.mari_023.ae2wtlib.terminal.results; +package de.mari_023.ae2wtlib.api; import javax.annotation.ParametersAreNonnullByDefault; diff --git a/src/main/java/de/mari_023/ae2wtlib/wut/AddTerminalEvent.java b/api/src/main/java/de/mari_023/ae2wtlib/api/registration/AddTerminalEvent.java similarity index 92% rename from src/main/java/de/mari_023/ae2wtlib/wut/AddTerminalEvent.java rename to api/src/main/java/de/mari_023/ae2wtlib/api/registration/AddTerminalEvent.java index 6a6d178f..e21074f8 100644 --- a/src/main/java/de/mari_023/ae2wtlib/wut/AddTerminalEvent.java +++ b/api/src/main/java/de/mari_023/ae2wtlib/api/registration/AddTerminalEvent.java @@ -1,4 +1,4 @@ -package de.mari_023.ae2wtlib.wut; +package de.mari_023.ae2wtlib.api.registration; import java.util.ArrayList; import java.util.List; @@ -9,8 +9,8 @@ import net.minecraft.world.inventory.MenuType; -import de.mari_023.ae2wtlib.terminal.Icon; -import de.mari_023.ae2wtlib.terminal.ItemWT; +import de.mari_023.ae2wtlib.api.gui.Icon; +import de.mari_023.ae2wtlib.api.terminal.ItemWT; public final class AddTerminalEvent { private AddTerminalEvent() {} diff --git a/src/main/java/de/mari_023/ae2wtlib/UpgradeHelper.java b/api/src/main/java/de/mari_023/ae2wtlib/api/registration/UpgradeHelper.java similarity index 73% rename from src/main/java/de/mari_023/ae2wtlib/UpgradeHelper.java rename to api/src/main/java/de/mari_023/ae2wtlib/api/registration/UpgradeHelper.java index fa35d7de..a3567566 100644 --- a/src/main/java/de/mari_023/ae2wtlib/UpgradeHelper.java +++ b/api/src/main/java/de/mari_023/ae2wtlib/api/registration/UpgradeHelper.java @@ -1,27 +1,25 @@ -package de.mari_023.ae2wtlib; +package de.mari_023.ae2wtlib.api.registration; import java.util.HashMap; import java.util.Map; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.Items; import net.minecraft.world.level.ItemLike; import appeng.api.upgrades.Upgrades; import appeng.core.definitions.AEItems; import appeng.core.localization.GuiText; -import de.mari_023.ae2wtlib.wut.WTDefinition; -import de.mari_023.ae2wtlib.wut.WUTHandler; +import de.mari_023.ae2wtlib.api.AE2wtlibAPI; +import de.mari_023.ae2wtlib.api.terminal.WUTHandler; public class UpgradeHelper { private static volatile boolean readyForUpgrades = false; private static final Map upgrades = new HashMap<>(); - static synchronized void addUpgrades() { + public static synchronized void addUpgrades() { addUpgradeToAllTerminals(AEItems.ENERGY_CARD, 0); - addUpgradeToAllTerminals(AE2wtlibItems.QUANTUM_BRIDGE_CARD, 1); - - Upgrades.add(AE2wtlibItems.MAGNET_CARD, AEItems.WIRELESS_CRAFTING_TERMINAL, 1); - Upgrades.add(AE2wtlibItems.MAGNET_CARD, AE2wtlibItems.UNIVERSAL_TERMINAL, 1); readyForUpgrades = true; for (var upgrade : upgrades.entrySet()) { @@ -49,11 +47,11 @@ public static synchronized void addUpgradeToAllTerminals(ItemLike upgradeCard, i Upgrades.add(upgradeCard, terminal.item(), Math.min(maxSupported, max), GuiText.WirelessTerminals.getTranslationKey()); } - Upgrades.add(upgradeCard, AE2wtlibItems.UNIVERSAL_TERMINAL, maxSupported); + addUpgradesToUniversalTerminal(upgradeCard, maxSupported); } private static void addMaxUpgradesToAllTerminals(ItemLike upgradeCard) { - Upgrades.add(upgradeCard, AE2wtlibItems.UNIVERSAL_TERMINAL, WUTHandler.getUpgradeCardCount()); + addUpgradesToUniversalTerminal(upgradeCard, WUTHandler.getUpgradeCardCount()); for (var terminal : WTDefinition.wirelessTerminals()) { int max = terminal.upgradeCount(); if (max == 0) @@ -61,4 +59,10 @@ private static void addMaxUpgradesToAllTerminals(ItemLike upgradeCard) { Upgrades.add(upgradeCard, terminal.item(), max, GuiText.WirelessTerminals.getTranslationKey()); } } + + private static void addUpgradesToUniversalTerminal(ItemLike upgradeCard, int maxSupported) { + Item wut = AE2wtlibAPI.getWUT(); + if (wut != Items.AIR) + Upgrades.add(upgradeCard, wut, maxSupported); + } } diff --git a/src/main/java/de/mari_023/ae2wtlib/wut/WTDefinition.java b/api/src/main/java/de/mari_023/ae2wtlib/api/registration/WTDefinition.java similarity index 89% rename from src/main/java/de/mari_023/ae2wtlib/wut/WTDefinition.java rename to api/src/main/java/de/mari_023/ae2wtlib/api/registration/WTDefinition.java index adc0fb42..16435fd4 100644 --- a/src/main/java/de/mari_023/ae2wtlib/wut/WTDefinition.java +++ b/api/src/main/java/de/mari_023/ae2wtlib/api/registration/WTDefinition.java @@ -1,4 +1,4 @@ -package de.mari_023.ae2wtlib.wut; +package de.mari_023.ae2wtlib.api.registration; import java.util.*; import java.util.function.BiConsumer; @@ -7,6 +7,7 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.DataResult; +import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.Nullable; import io.netty.buffer.ByteBuf; @@ -22,10 +23,11 @@ import appeng.menu.ISubMenu; import appeng.menu.locator.ItemMenuHostLocator; -import de.mari_023.ae2wtlib.AE2wtlibComponents; -import de.mari_023.ae2wtlib.terminal.Icon; -import de.mari_023.ae2wtlib.terminal.ItemWT; -import de.mari_023.ae2wtlib.terminal.WTMenuHost; +import de.mari_023.ae2wtlib.api.AE2wtlibComponents; +import de.mari_023.ae2wtlib.api.gui.Icon; +import de.mari_023.ae2wtlib.api.terminal.ItemWT; +import de.mari_023.ae2wtlib.api.terminal.ItemWUT; +import de.mari_023.ae2wtlib.api.terminal.WTMenuHost; public record WTDefinition(String terminalName, ContainerOpener containerOpener, WTMenuHostFactory wTMenuHostFactory, MenuType menuType, ItemWT item, ItemStack universalTerminal, MutableComponent formattedName, @@ -43,7 +45,8 @@ WTMenuHost create(ItemWT item, Player player, ItemMenuHostLocator locator, } private static final Map wirelessTerminals = new HashMap<>(); - static final List wirelessTerminalList = new ArrayList<>(); + @ApiStatus.Internal + public static final List wirelessTerminalList = new ArrayList<>(); public static final Codec CODEC = Codec.STRING.comapFlatMap(s -> { var terminal = wirelessTerminals.get(s); @@ -72,7 +75,7 @@ public static Collection wirelessTerminals() { return wirelessTerminals.values(); } - static WTDefinition of(String name) { + public static WTDefinition of(String name) { return Objects.requireNonNull(wirelessTerminals.get(name)); } diff --git a/src/main/java/de/mari_023/ae2wtlib/wut/WTDefinitionBuilder.java b/api/src/main/java/de/mari_023/ae2wtlib/api/registration/WTDefinitionBuilder.java similarity index 87% rename from src/main/java/de/mari_023/ae2wtlib/wut/WTDefinitionBuilder.java rename to api/src/main/java/de/mari_023/ae2wtlib/api/registration/WTDefinitionBuilder.java index 17e8ea9d..5a92499b 100644 --- a/src/main/java/de/mari_023/ae2wtlib/wut/WTDefinitionBuilder.java +++ b/api/src/main/java/de/mari_023/ae2wtlib/api/registration/WTDefinitionBuilder.java @@ -1,4 +1,4 @@ -package de.mari_023.ae2wtlib.wut; +package de.mari_023.ae2wtlib.api.registration; import com.mojang.datafixers.util.Unit; import com.mojang.serialization.Codec; @@ -8,17 +8,16 @@ import net.minecraft.core.component.DataComponentType; import net.minecraft.world.inventory.MenuType; -import net.minecraft.world.item.ItemStack; import net.neoforged.neoforge.network.codec.NeoForgeStreamCodecs; import appeng.hotkeys.HotkeyActions; -import de.mari_023.ae2wtlib.AE2wtlibComponents; -import de.mari_023.ae2wtlib.AE2wtlibItems; -import de.mari_023.ae2wtlib.TextConstants; -import de.mari_023.ae2wtlib.hotkeys.Ae2wtlibLocatingService; -import de.mari_023.ae2wtlib.terminal.Icon; -import de.mari_023.ae2wtlib.terminal.ItemWT; +import de.mari_023.ae2wtlib.api.AE2wtlibAPI; +import de.mari_023.ae2wtlib.api.AE2wtlibComponents; +import de.mari_023.ae2wtlib.api.TextConstants; +import de.mari_023.ae2wtlib.api.gui.Icon; +import de.mari_023.ae2wtlib.api.terminal.Ae2wtlibLocatingService; +import de.mari_023.ae2wtlib.api.terminal.ItemWT; public class WTDefinitionBuilder { private final AddTerminalEvent event; @@ -60,9 +59,7 @@ public void addTerminal() { if (WTDefinition.exists(name)) throw new IllegalStateException("Trying to register terminal with name " + name + " but it already exists"); - ItemStack wut = new ItemStack(AE2wtlibItems.UNIVERSAL_TERMINAL); - - wut.set(componentType, Unit.INSTANCE); + var wut = AE2wtlibAPI.makeWUT(componentType); WTDefinition wtDefinition = new WTDefinition(name, item::tryOpen, wTMenuHostFactory, menuType, item, wut, TextConstants.formatTerminalName(translationKey), translationKey, hotkeyName, componentType, diff --git a/api/src/main/java/de/mari_023/ae2wtlib/api/registration/package-info.java b/api/src/main/java/de/mari_023/ae2wtlib/api/registration/package-info.java new file mode 100644 index 00000000..58133808 --- /dev/null +++ b/api/src/main/java/de/mari_023/ae2wtlib/api/registration/package-info.java @@ -0,0 +1,9 @@ +@FieldsAreNonnullByDefault +@ParametersAreNonnullByDefault +@MethodsReturnNonnullByDefault +package de.mari_023.ae2wtlib.api.registration; + +import javax.annotation.ParametersAreNonnullByDefault; + +import net.minecraft.FieldsAreNonnullByDefault; +import net.minecraft.MethodsReturnNonnullByDefault; diff --git a/src/main/java/de/mari_023/ae2wtlib/terminal/results/ActionHostResult.java b/api/src/main/java/de/mari_023/ae2wtlib/api/results/ActionHostResult.java similarity index 90% rename from src/main/java/de/mari_023/ae2wtlib/terminal/results/ActionHostResult.java rename to api/src/main/java/de/mari_023/ae2wtlib/api/results/ActionHostResult.java index 48063eb3..c89e35e7 100644 --- a/src/main/java/de/mari_023/ae2wtlib/terminal/results/ActionHostResult.java +++ b/api/src/main/java/de/mari_023/ae2wtlib/api/results/ActionHostResult.java @@ -1,4 +1,4 @@ -package de.mari_023.ae2wtlib.terminal.results; +package de.mari_023.ae2wtlib.api.results; import org.jetbrains.annotations.Nullable; diff --git a/src/main/java/de/mari_023/ae2wtlib/terminal/results/LongResult.java b/api/src/main/java/de/mari_023/ae2wtlib/api/results/LongResult.java similarity index 85% rename from src/main/java/de/mari_023/ae2wtlib/terminal/results/LongResult.java rename to api/src/main/java/de/mari_023/ae2wtlib/api/results/LongResult.java index 9a9ca19d..b48c0992 100644 --- a/src/main/java/de/mari_023/ae2wtlib/terminal/results/LongResult.java +++ b/api/src/main/java/de/mari_023/ae2wtlib/api/results/LongResult.java @@ -1,4 +1,4 @@ -package de.mari_023.ae2wtlib.terminal.results; +package de.mari_023.ae2wtlib.api.results; public record LongResult(long result, Status status) implements Result { public static LongResult valid(long result) { diff --git a/src/main/java/de/mari_023/ae2wtlib/terminal/results/Result.java b/api/src/main/java/de/mari_023/ae2wtlib/api/results/Result.java similarity index 80% rename from src/main/java/de/mari_023/ae2wtlib/terminal/results/Result.java rename to api/src/main/java/de/mari_023/ae2wtlib/api/results/Result.java index a2dadcca..6277d968 100644 --- a/src/main/java/de/mari_023/ae2wtlib/terminal/results/Result.java +++ b/api/src/main/java/de/mari_023/ae2wtlib/api/results/Result.java @@ -1,4 +1,4 @@ -package de.mari_023.ae2wtlib.terminal.results; +package de.mari_023.ae2wtlib.api.results; public interface Result { Status status(); diff --git a/src/main/java/de/mari_023/ae2wtlib/terminal/results/Status.java b/api/src/main/java/de/mari_023/ae2wtlib/api/results/Status.java similarity index 93% rename from src/main/java/de/mari_023/ae2wtlib/terminal/results/Status.java rename to api/src/main/java/de/mari_023/ae2wtlib/api/results/Status.java index be0db2ac..a4ba82ef 100644 --- a/src/main/java/de/mari_023/ae2wtlib/terminal/results/Status.java +++ b/api/src/main/java/de/mari_023/ae2wtlib/api/results/Status.java @@ -1,4 +1,4 @@ -package de.mari_023.ae2wtlib.terminal.results; +package de.mari_023.ae2wtlib.api.results; import javax.annotation.Nullable; @@ -7,7 +7,7 @@ import appeng.api.storage.ILinkStatus; import appeng.core.localization.PlayerMessages; -import de.mari_023.ae2wtlib.TextConstants; +import de.mari_023.ae2wtlib.api.TextConstants; public enum Status { // Generic results diff --git a/api/src/main/java/de/mari_023/ae2wtlib/api/results/package-info.java b/api/src/main/java/de/mari_023/ae2wtlib/api/results/package-info.java new file mode 100644 index 00000000..2b609cbf --- /dev/null +++ b/api/src/main/java/de/mari_023/ae2wtlib/api/results/package-info.java @@ -0,0 +1,9 @@ +@FieldsAreNonnullByDefault +@ParametersAreNonnullByDefault +@MethodsReturnNonnullByDefault +package de.mari_023.ae2wtlib.api.results; + +import javax.annotation.ParametersAreNonnullByDefault; + +import net.minecraft.FieldsAreNonnullByDefault; +import net.minecraft.MethodsReturnNonnullByDefault; diff --git a/src/main/java/de/mari_023/ae2wtlib/hotkeys/Ae2wtlibLocatingService.java b/api/src/main/java/de/mari_023/ae2wtlib/api/terminal/Ae2wtlibLocatingService.java similarity index 83% rename from src/main/java/de/mari_023/ae2wtlib/hotkeys/Ae2wtlibLocatingService.java rename to api/src/main/java/de/mari_023/ae2wtlib/api/terminal/Ae2wtlibLocatingService.java index 452db582..24535b8a 100644 --- a/src/main/java/de/mari_023/ae2wtlib/hotkeys/Ae2wtlibLocatingService.java +++ b/api/src/main/java/de/mari_023/ae2wtlib/api/terminal/Ae2wtlibLocatingService.java @@ -1,4 +1,4 @@ -package de.mari_023.ae2wtlib.hotkeys; +package de.mari_023.ae2wtlib.api.terminal; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; @@ -6,8 +6,7 @@ import appeng.api.features.HotkeyAction; import appeng.menu.locator.ItemMenuHostLocator; -import de.mari_023.ae2wtlib.wut.WTDefinition; -import de.mari_023.ae2wtlib.wut.WUTHandler; +import de.mari_023.ae2wtlib.api.registration.WTDefinition; public record Ae2wtlibLocatingService(WTDefinition terminal) implements HotkeyAction { @Override diff --git a/src/main/java/de/mari_023/ae2wtlib/wut/IUniversalTerminalCapable.java b/api/src/main/java/de/mari_023/ae2wtlib/api/terminal/IUniversalTerminalCapable.java similarity index 84% rename from src/main/java/de/mari_023/ae2wtlib/wut/IUniversalTerminalCapable.java rename to api/src/main/java/de/mari_023/ae2wtlib/api/terminal/IUniversalTerminalCapable.java index 067bc3a0..e62c61a1 100644 --- a/src/main/java/de/mari_023/ae2wtlib/wut/IUniversalTerminalCapable.java +++ b/api/src/main/java/de/mari_023/ae2wtlib/api/terminal/IUniversalTerminalCapable.java @@ -1,4 +1,4 @@ -package de.mari_023.ae2wtlib.wut; +package de.mari_023.ae2wtlib.api.terminal; import java.util.ArrayList; import java.util.List; @@ -13,17 +13,17 @@ import appeng.menu.AEBaseMenu; import appeng.menu.SlotSemantics; -import de.mari_023.ae2wtlib.AE2wtlibSlotSemantics; -import de.mari_023.ae2wtlib.TextConstants; -import de.mari_023.ae2wtlib.networking.CycleTerminalPacket; -import de.mari_023.ae2wtlib.terminal.IconButton; -import de.mari_023.ae2wtlib.terminal.ScrollingUpgradesPanel; -import de.mari_023.ae2wtlib.terminal.WTMenuHost; +import de.mari_023.ae2wtlib.api.AE2wtlibAPI; +import de.mari_023.ae2wtlib.api.TextConstants; +import de.mari_023.ae2wtlib.api.gui.AE2wtlibSlotSemantics; +import de.mari_023.ae2wtlib.api.gui.IconButton; +import de.mari_023.ae2wtlib.api.gui.ScrollingUpgradesPanel; +import de.mari_023.ae2wtlib.api.registration.WTDefinition; public interface IUniversalTerminalCapable { default void cycleTerminal() { storeState(); - PacketDistributor.sendToServer(new CycleTerminalPacket(isHandlingRightClick())); + AE2wtlibAPI.cycleTerminal(isHandlingRightClick()); } WTMenuHost getHost(); diff --git a/src/main/java/de/mari_023/ae2wtlib/terminal/ItemWT.java b/api/src/main/java/de/mari_023/ae2wtlib/api/terminal/ItemWT.java similarity index 90% rename from src/main/java/de/mari_023/ae2wtlib/terminal/ItemWT.java rename to api/src/main/java/de/mari_023/ae2wtlib/api/terminal/ItemWT.java index f4db1549..077d62b8 100644 --- a/src/main/java/de/mari_023/ae2wtlib/terminal/ItemWT.java +++ b/api/src/main/java/de/mari_023/ae2wtlib/api/terminal/ItemWT.java @@ -1,4 +1,4 @@ -package de.mari_023.ae2wtlib.terminal; +package de.mari_023.ae2wtlib.api.terminal; import org.jetbrains.annotations.Nullable; @@ -19,8 +19,8 @@ import appeng.menu.locator.ItemMenuHostLocator; import appeng.menu.locator.MenuLocators; -import de.mari_023.ae2wtlib.AE2wtlibItems; -import de.mari_023.ae2wtlib.wut.WTDefinition; +import de.mari_023.ae2wtlib.api.AE2wtlibAPI; +import de.mari_023.ae2wtlib.api.registration.WTDefinition; public abstract class ItemWT extends WirelessTerminalItem { public ItemWT() { @@ -42,7 +42,7 @@ public boolean tryOpen(Player player, ItemMenuHostLocator locator, boolean retur protected boolean checkPreconditions(ItemStack item) { return !item.isEmpty() - && (item.getItem() == this || item.getItem() == AE2wtlibItems.UNIVERSAL_TERMINAL); + && (item.getItem() == this || AE2wtlibAPI.isUniversalTerminal(item.getItem())); } @Override diff --git a/src/main/java/de/mari_023/ae2wtlib/wut/ItemWUT.java b/api/src/main/java/de/mari_023/ae2wtlib/api/terminal/ItemWUT.java similarity index 96% rename from src/main/java/de/mari_023/ae2wtlib/wut/ItemWUT.java rename to api/src/main/java/de/mari_023/ae2wtlib/api/terminal/ItemWUT.java index d015a918..db37ecb3 100644 --- a/src/main/java/de/mari_023/ae2wtlib/wut/ItemWUT.java +++ b/api/src/main/java/de/mari_023/ae2wtlib/api/terminal/ItemWUT.java @@ -1,4 +1,4 @@ -package de.mari_023.ae2wtlib.wut; +package de.mari_023.ae2wtlib.api.terminal; import java.util.List; import java.util.function.Supplier; @@ -23,8 +23,8 @@ import appeng.core.definitions.AEItems; import appeng.menu.locator.ItemMenuHostLocator; -import de.mari_023.ae2wtlib.TextConstants; -import de.mari_023.ae2wtlib.terminal.ItemWT; +import de.mari_023.ae2wtlib.api.TextConstants; +import de.mari_023.ae2wtlib.api.registration.WTDefinition; public class ItemWUT extends ItemWT { @Override diff --git a/src/main/java/de/mari_023/ae2wtlib/terminal/WTMenuHost.java b/api/src/main/java/de/mari_023/ae2wtlib/api/terminal/WTMenuHost.java similarity index 95% rename from src/main/java/de/mari_023/ae2wtlib/terminal/WTMenuHost.java rename to api/src/main/java/de/mari_023/ae2wtlib/api/terminal/WTMenuHost.java index 30f03bf2..1d252cf9 100644 --- a/src/main/java/de/mari_023/ae2wtlib/terminal/WTMenuHost.java +++ b/api/src/main/java/de/mari_023/ae2wtlib/api/terminal/WTMenuHost.java @@ -1,4 +1,4 @@ -package de.mari_023.ae2wtlib.terminal; +package de.mari_023.ae2wtlib.api.terminal; import java.util.function.BiConsumer; @@ -35,13 +35,12 @@ import appeng.util.inv.InternalInventoryHost; import appeng.util.inv.SupplierInternalInventory; -import de.mari_023.ae2wtlib.AE2wtlib; -import de.mari_023.ae2wtlib.AE2wtlibComponents; -import de.mari_023.ae2wtlib.AE2wtlibItems; -import de.mari_023.ae2wtlib.terminal.results.ActionHostResult; -import de.mari_023.ae2wtlib.terminal.results.LongResult; -import de.mari_023.ae2wtlib.terminal.results.Status; -import de.mari_023.ae2wtlib.wut.WTDefinition; +import de.mari_023.ae2wtlib.api.AE2wtlibAPI; +import de.mari_023.ae2wtlib.api.AE2wtlibComponents; +import de.mari_023.ae2wtlib.api.registration.WTDefinition; +import de.mari_023.ae2wtlib.api.results.ActionHostResult; +import de.mari_023.ae2wtlib.api.results.LongResult; +import de.mari_023.ae2wtlib.api.results.Status; public abstract class WTMenuHost extends WirelessTerminalMenuHost implements ISegmentedInventory { @@ -49,7 +48,7 @@ public abstract class WTMenuHost extends WirelessTerminalMenuHost private final SupplierInternalInventory viewCellInventory; @Nullable private IActionHost quantumBridge; - public static final ResourceLocation INV_SINGULARITY = AE2wtlib.id("singularity"); + public static final ResourceLocation INV_SINGULARITY = AE2wtlibAPI.id("singularity"); private final MEStorage storage; @UnknownNullability private ILinkStatus linkStatus; @@ -150,7 +149,7 @@ public LongResult getQEFrequency() { private ILinkStatus isQuantumLinked() { Status status = Status.Valid; - if (!getUpgrades().isInstalled(AE2wtlibItems.QUANTUM_BRIDGE_CARD)) + if (!AE2wtlibAPI.hasQuantumBridgeCard(this::getUpgrades)) status = Status.NoUpgrade; LongResult f = getQEFrequency(); if (!f.valid()) { diff --git a/src/main/java/de/mari_023/ae2wtlib/wut/WUTHandler.java b/api/src/main/java/de/mari_023/ae2wtlib/api/terminal/WUTHandler.java similarity index 85% rename from src/main/java/de/mari_023/ae2wtlib/wut/WUTHandler.java rename to api/src/main/java/de/mari_023/ae2wtlib/api/terminal/WUTHandler.java index 8ec49096..a8900459 100644 --- a/src/main/java/de/mari_023/ae2wtlib/wut/WUTHandler.java +++ b/api/src/main/java/de/mari_023/ae2wtlib/api/terminal/WUTHandler.java @@ -1,4 +1,4 @@ -package de.mari_023.ae2wtlib.wut; +package de.mari_023.ae2wtlib.api.terminal; import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.Nullable; @@ -6,15 +6,15 @@ import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; -import net.neoforged.neoforge.network.PacketDistributor; import appeng.integration.modules.curios.CuriosIntegration; import appeng.menu.locator.ItemMenuHostLocator; import appeng.menu.locator.MenuLocators; -import de.mari_023.ae2wtlib.AE2wtlibComponents; -import de.mari_023.ae2wtlib.TextConstants; -import de.mari_023.ae2wtlib.networking.UpdateWUTPackage; +import de.mari_023.ae2wtlib.api.AE2wtlibAPI; +import de.mari_023.ae2wtlib.api.AE2wtlibComponents; +import de.mari_023.ae2wtlib.api.TextConstants; +import de.mari_023.ae2wtlib.api.registration.WTDefinition; /** * This class handles functionalities related to the Wireless Universal Terminal (WUT). It provides methods to get and @@ -98,7 +98,7 @@ public static WTDefinition nextTerminal(ItemStack stack, boolean reverse) { * @param stack The compound tag containing terminal data. */ public static void updateClientTerminal(ServerPlayer player, ItemMenuHostLocator locator, ItemStack stack) { - PacketDistributor.sendToPlayer(player, new UpdateWUTPackage(locator, stack)); + AE2wtlibAPI.updateClientTerminal(player, locator, stack); } /** @@ -127,20 +127,35 @@ public static boolean open(final Player player, final ItemMenuHostLocator locato */ @Nullable public static ItemMenuHostLocator findTerminal(Player player, WTDefinition terminal) { + ItemMenuHostLocator locator = null; + var cap = player.getCapability(CuriosIntegration.ITEM_HANDLER); if (cap != null) { for (int i = 0; i < cap.getSlots(); i++) { - if (hasTerminal(cap.getStackInSlot(i), terminal)) { + var stack = cap.getStackInSlot(i); + if (!hasTerminal(stack, terminal)) + continue; + + if (AE2wtlibAPI.isUniversalTerminal(stack)) { return MenuLocators.forCurioSlot(i); + } else if (locator == null) { + locator = MenuLocators.forCurioSlot(i); } } } for (int i = 0; i < player.getInventory().getContainerSize(); i++) { - if (hasTerminal(player.getInventory().getItem(i), terminal)) + var stack = player.getInventory().getItem(i); + if (!hasTerminal(stack, terminal)) + continue; + + if (AE2wtlibAPI.isUniversalTerminal(stack)) { return MenuLocators.forInventorySlot(i); + } else if (locator == null) { + locator = MenuLocators.forInventorySlot(i); + } } - return null; + return locator; } /** diff --git a/api/src/main/java/de/mari_023/ae2wtlib/api/terminal/package-info.java b/api/src/main/java/de/mari_023/ae2wtlib/api/terminal/package-info.java new file mode 100644 index 00000000..3d5eaa61 --- /dev/null +++ b/api/src/main/java/de/mari_023/ae2wtlib/api/terminal/package-info.java @@ -0,0 +1,9 @@ +@FieldsAreNonnullByDefault +@ParametersAreNonnullByDefault +@MethodsReturnNonnullByDefault +package de.mari_023.ae2wtlib.api.terminal; + +import javax.annotation.ParametersAreNonnullByDefault; + +import net.minecraft.FieldsAreNonnullByDefault; +import net.minecraft.MethodsReturnNonnullByDefault; diff --git a/api/src/main/resources/META-INF/accesstransformer.cfg b/api/src/main/resources/META-INF/accesstransformer.cfg new file mode 100644 index 00000000..1836e8d3 --- /dev/null +++ b/api/src/main/resources/META-INF/accesstransformer.cfg @@ -0,0 +1,3 @@ +public net.minecraft.world.entity.item.ItemEntity target +public-f net.minecraft.world.inventory.Slot x +public-f net.minecraft.world.inventory.Slot y \ No newline at end of file diff --git a/api/src/main/resources/META-INF/neoforge.mods.toml b/api/src/main/resources/META-INF/neoforge.mods.toml new file mode 100644 index 00000000..cd04198f --- /dev/null +++ b/api/src/main/resources/META-INF/neoforge.mods.toml @@ -0,0 +1,44 @@ +modLoader = "javafml" +loaderVersion = "[1,)" +issueTrackerURL = "https://github.com/Mari023/AE2WirelessTerminalLibrary/issues" +license = "MIT" + +[[mods]] +modId = "ae2wtlib_api" +version = "${version}" +displayName = "AE2WTLib API" +authors = "mari_023, Ridanisaurus" +description = ''' +API for adding wireless terminals with easy integration with AE2wtlib. +''' +logoFile = "icon.png" +logoBlur=false + +[[dependencies.ae2wtlib_api]] +modId = "neoforge" +type="REQUIRED" +versionRange = "*" +ordering = "NONE" +side = "BOTH" + +[[dependencies.ae2wtlib_api]] +modId = "minecraft" +type="REQUIRED" +versionRange = "*" +ordering = "NONE" +side = "BOTH" + +[[dependencies.ae2wtlib_api]] +modId = "ae2" +type="REQUIRED" +versionRange = "[${ae2_version},20.0.0)" +ordering = "AFTER" +side = "BOTH" + +[[dependencies.ae2wtlib]] +modId = "ae2wtlib" +type="INCOMPATIBLE" +versionRange = "(,19.1.0-alpha)" +ordering = "NONE" +side = "BOTH" +reason = "breaking changes in the ae2wtlib api" \ No newline at end of file diff --git a/api/src/main/resources/assets/ae2/screens/wtlib/schema.json b/api/src/main/resources/assets/ae2/screens/wtlib/schema.json new file mode 100644 index 00000000..e854fb22 --- /dev/null +++ b/api/src/main/resources/assets/ae2/screens/wtlib/schema.json @@ -0,0 +1,505 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "https://appliedenergistics.github.io/screen_style", + "type": "object", + "title": "AE2 Screen Style", + "description": "Provides styling information for an AE2 UI screen", + "required": [], + "definitions": { + "position": { + "$comment": "Used to position an element in relationship to the size of the current dialog", + "$id": "Position", + "type": "object", + "properties": { + "left": { + "type": "number", + "description": "Positions the content to the right (positive) or left (negative) of the left screen edge." + }, + "top": { + "type": "number", + "description": "Positions the content to the bottom (positive) or top (negative) of the top screen edge." + }, + "right": { + "type": "number", + "description": "Positions the content to the left (positive) or right (negative) of the right screen edge." + }, + "bottom": { + "type": "number", + "description": "Positions the content to the top (positive) or bottom (negative) of the bottom screen edge." + } + } + }, + "color": { + "$comment": "Definition of a color using a fake HTML notation", + "type": "string", + "pattern": "^#([0-9a-fA-F]{2}){3,4}$" + }, + "text": { + "$comment": "JSON schema definition of Minecraft text https://minecraft.fandom.com/wiki/Raw_JSON_text_format", + "type": "object", + "properties": { + "extra": { + "description": "Text that is displayed after this text, but that inherits this texts properties.", + "type": "array", + "items": { + "$ref": "#/definitions/text" + } + }, + "color": { + "type": "string", + "pattern": "^#([0-9a-fA-F]{6})$" + }, + "font": { + "type": "string", + "default": "minecraft:default", + "description": "Font in assets//font" + }, + "bold": { + "type": "boolean", + "default": false + }, + "italic": { + "type": "boolean", + "default": false + }, + "underlined": { + "type": "boolean", + "default": false + }, + "strikethrough": { + "type": "boolean", + "default": false + }, + "obfuscated": { + "type": "boolean", + "default": false + }, + "insertion": { + "type": "string", + "description": "When shift-clicked while the chat is open, the text of this property will be inserted." + }, + "clickEvent": { + "type": "object", + "properties": { + "action": { + "type": "string", + "enum": [ + "open_url", + "open_file", + "run_command", + "suggest_command", + "change_page", + "copy_to_clipboard" + ] + }, + "value": { + "type": "string" + } + }, + "required": ["action", "value"] + }, + "hoverEvent": { + "type": "object", + "oneOf": [ + { + "properties": { + "action": { + "const": "show_text" + }, + "contents": { + "$ref": "#/definitions/text" + } + } + }, + { + "properties": { + "action": { + "const": "show_item" + }, + "contents": { + "type": "object", + "properties": { + "id": { + "type": "string", + "default": "minecraft:air", + "description": "The item to show" + }, + "count": { + "type": "integer", + "default": 1, + "description": "The item stack size" + }, + "tag": { + "type": "string", + "description": "NBT of the item, serialized as string. See https://minecraft.fandom.com/wiki/Player.dat_format#Item_structure" + } + }, + "required": ["id"] + } + } + }, + { + "properties": { + "action": { + "const": "show_entity" + }, + "contents": { + "type": "object", + "properties": { + "name": { + "$ref": "#/definitions/text" + }, + "type": { + "type": "string", + "default": "minecraft:pig", + "description": "The entity type id to show" + }, + "id": { + "type": "string", + "description": "UUID of the entity to show" + } + } + } + } + } + ] + } + }, + "oneOf": [ + { + "properties": { + "text": { + "description": "Display simple text", + "type": "string" + } + }, + "required": ["text"] + }, + { + "properties": { + "translate": { + "description": "The ID of a translation key", + "type": "string" + }, + "with": { + "type": "array", + "items": { + "$ref": "#/definitions/text" + } + } + }, + "required": ["translate"] + }, + { + "properties": { + "keybind": { + "type": "string", + "description": "A keybind identifier" + } + }, + "required": ["keybind"] + } + ] + }, + "rect": { + "oneOf": [ + { + "type": "array", + "items": [ + { + "type": "integer", + "description": "x" + }, + { + "type": "integer", + "description": "y" + }, + { + "type": "integer", + "description": "width" + }, + { + "type": "integer", + "description": "height" + } + ], + "additionalItems": false + }, + { + "type": "object", + "properties": { + "x": { + "type": "integer" + }, + "y": { + "type": "integer" + }, + "width": { + "type": "integer" + }, + "height": { + "type": "integer" + } + }, + "additionalProperties": false + } + ] + }, + "blitter": { + "type": "object", + "properties": { + "texture": { + "type": "string" + }, + "textureWidth": { + "type": "integer", + "default": 256 + }, + "textureHeight": { + "type": "integer", + "default": 256 + }, + "srcRect": { + "$ref": "#/definitions/rect" + } + }, + "required": ["texture"] + } + }, + "properties": { + "includes": { + "description": "Relative path to other files to include before processing this one.", + "type": "array", + "items": { + "type": "string" + } + }, + "palette": { + "$comment": "See PaletteColor enum", + "type": "object", + "description": "Defines colors used through the UI screen", + "properties": { + "TEXT_HEADLINE": { + "$ref": "#/definitions/color" + } + } + }, + "background": { + "$ref": "#/definitions/blitter" + }, + "slots": { + "type": "object", + "description": "Defines positions for slots and their grid alignment", + "additionalProperties": { + "type": "object", + "allOf": [ + { + "properties": { + "grid": { + "$comment": "Configures the slots with this semantic in a grid", + "enum": [ + "IO_BUS_CONFIG", + "BREAK_AFTER_9COLS", + "BREAK_AFTER_2COLS", + "BREAK_AFTER_3COLS", + "HORIZONTAL", + "VERTICAL" + ] + } + } + }, + { + "$ref": "#/definitions/position" + } + ] + }, + "propertyNames": { + "$comment": "List SlotSemantic names here", + "enum": [ + "NONE", + "STORAGE", + "PLAYER_INVENTORY", + "PLAYER_HOTBAR", + "TOOLBOX", + "CONFIG", + "UPGRADE", + "STORAGE_CELL", + "INSCRIBER_PLATE_TOP", + "INSCRIBER_PLATE_BOTTOM", + "MACHINE_INPUT", + "MACHINE_PROCESSING", + "MACHINE_OUTPUT", + "MACHINE_CRAFTING_GRID", + "BLANK_PATTERN", + "ENCODED_PATTERN", + "VIEW_CELL", + "CRAFTING_GRID", + "CRAFTING_RESULT", + "PROCESSING_PRIMARY_RESULT", + "PROCESSING_FIRST_OPTIONAL_RESULT", + "PROCESSING_SECOND_OPTIONAL_RESULT", + "BIOMETRIC_CARD", + "READONLY_STACKS", + "AE2WTLIB_HELMET", + "AE2WTLIB_CHESTPLATE", + "AE2WTLIB_LEGGINGS", + "AE2WTLIB_BOOTS", + "AE2WTLIB_OFFHAND", + "AE2WTLIB_TRASH", + "AE2WTLIB_MAGNET_CARD", + "AE2WTLIB_INFINITY_BOOSTER_CARD", + "AE2WTLIB_PICKUP_CONFIG", + "AE2WTLIB_INSERT_CONFIG", + "AE2WTLIB_SINGULARITY" + ] + } + }, + "text": { + "description": "Defines text that will be shown on the UI, the property name is used to reference text from code", + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { + "text": { + "$ref": "#/definitions/text" + }, + "color": { + "$comment": "See enum PaletteColor", + "enum": ["DEFAULT_TEXT_COLOR"], + "default": "DEFAULT_TEXT_COLOR" + }, + "position": { + "$ref": "#/definitions/position" + }, + "centerHorizontally": { + "type": "boolean", + "default": false + } + } + } + }, + "tooltips": { + "description": "Defines areas that will show a tooltip on the screen. These areas are evaluated after everything else that could show a tooltip.", + "type": "object", + "additionalProperties": { + "allOf": [ + { + "type": "object", + "properties": { + "tooltip": { + "type": "array", + "items": { + "$ref": "#/definitions/text" + } + }, + "width": { + "type": "integer" + }, + "height": { + "type": "integer" + } + }, + "required": ["tooltip", "width", "height"] + }, + { + "$ref": "#/definitions/position" + } + ] + } + }, + "images": { + "description": "Additional screen-specific images", + "additionalProperties": { + "$ref": "#/definitions/blitter" + } + }, + "terminalStyle": { + "description": "If this screen is a terminal, this defines required properties to display it properly", + "type": "object", + "additionalProperties": false, + "properties": { + "header": { + "description": "The top of the terminal background right up to the first row of content.", + "$ref": "#/definitions/blitter" + }, + "firstRow": { + "description": "The area to draw for the first row in the terminal. Usually this includes the top of the scrollbar.", + "$ref": "#/definitions/blitter" + }, + "row": { + "description": "The area to repeat for every row in the terminal. Should be 16px for the item + 2px for the border in size.", + "$ref": "#/definitions/blitter" + }, + "lastRow": { + "description": "The area to draw for the last row in the terminal. Usually this includes the top of the scrollbar.", + "$ref": "#/definitions/blitter" + }, + "bottom": { + "description": "The area to draw at the bottom of the terminal (i.e. includes the player inventory).", + "$ref": "#/definitions/blitter" + }, + "maxRows": { + "description": "If specified, limits the terminal to at most this many rows rather than using up available space.", + "type": "integer", + "minimum": 3 + }, + "slotsPerRow": { + "description": "The number of slots per row on the background image.", + "type": "integer", + "minimum": 1 + }, + "searchFieldRect": { + "description": "The bounding box of the search field in the background.", + "$ref": "#/definitions/rect" + }, + "sortable": { + "description": "Defines if this terminal has a sort by button.", + "type": "boolean", + "default": true + }, + "supportsAutoCrafting": { + "description": "Defines if this terminal supports auto-crafting. If not, the button to show only craftable items is hidden.", + "type": "boolean", + "default": false + }, + "stackSizeStyle": { + "description": "The type of stack size rendering to use.", + "type": "string", + "default": "ITEMS", + "enum": ["ITEMS", "FLUIDS"] + }, + "showTooltipsWithItemInHand": { + "type": "boolean", + "default": false, + "description": "Should the terminal show item tooltips for the network inventory even if the player has an item in their hand? Useful for showing fluid tooltips when the player has a bucket in hand." + } + } + }, + "widgets": { + "description": "Defines properties of various widgets that are positioned on the screen. The properties are widget-dependant. Which widget is placed is decided in code.", + "type": "object", + "additionalProperties": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/position" + }, + { + "properties": { + "width": { + "type": "integer" + }, + "height": { + "type": "integer" + }, + "hideEdge": { + "description": "Used to hide the border around TabButtons", + "type": "boolean" + } + } + } + ] + } + } + } +} diff --git a/src/main/resources/assets/ae2/screens/wtlib/universal_terminal.json b/api/src/main/resources/assets/ae2/screens/wtlib/universal_terminal.json similarity index 100% rename from src/main/resources/assets/ae2/screens/wtlib/universal_terminal.json rename to api/src/main/resources/assets/ae2/screens/wtlib/universal_terminal.json diff --git a/api/src/main/resources/assets/ae2/textures/wtlib/guis/icons.png b/api/src/main/resources/assets/ae2/textures/wtlib/guis/icons.png new file mode 100644 index 0000000000000000000000000000000000000000..ef1209043ace909c0cf1efabfee7f3b5408701f2 GIT binary patch literal 913 zcmV;C18)3@P)C0000;P)t-s00000 z0000000000000000022wsLarJA3#oYViRAuFx0 z#KA&K%gof*K0@06|MK$k#JD_900001bW%=J06^y0W&i*J_en%SRCwC$nr&OFFbszK zNz2Zt$4$-u|EIR4@1*0UDdYoe%;Ptf{0Wn2@4!|U!{*3^GcK7m9 zjexoRv1<-kfAt)&;U9ax3(6``L|`1__6UH%*MXs1A&MC2i~2f1(hD$vTPTFL_GXl} zHskPLV!L|*B|vdZ53ryI%42dpu+_-h@g4xBVn0UPZ(jfvE1~iLgYJe9y6+r_5V>^n^pv(ss{)KlJjd5AOWyWMNJQA zZ4H3U+;#(mp9+9GhHg2q1fW+W?}ohrhOGBZg5=N$h^+V7`M|LeSk?nXDYy=xw;osq z=-iB^HsG28>w&))fgb_jlW+^bp@oP67yxrmD9Kb{2m^}caj5Z6B+2}wTqQH2RRl!+ z*x$Ji!P@_$(*to*Z~yv*rC2_&%0*fLsGAg()06-obpu&BO{xc40g^%aIT6^~jvu6e zcHwpsyEp?to);{8jokpsMKqq>PGT2J0Bl;m;;th=nZ_9aa*+Z+y4f)a05&aO5dwKO zfH)lh$N*Lht1$rS2u=gg1oAup+t4J{610u$DFFPJSk41zX+}f<`}II8K(jHx`2aJ) zlL85pfbS00S@p126ysup(kb#7W2i48Q;kzyJ*J1OSZ>t(vX%u^j{SNPC>mSZ4>tcHL{ch`2_=MhRu`HW&x=@$F2r#!aWZeQfKUHYina;k}Q0GZm(sr$dL?h@6$K9QjTo7yLWaWi%yZQ zxE51N4x>?xLr`!7PyU1?gXHh$<{CTld@oYaU^I$|X*j@`BF@6V5Lu)rwEd6#VvvoV Lu6{1-oD!M> ATTACHMENT_TYPES = DeferredRegister - .create(NeoForgeRegistries.ATTACHMENT_TYPES, MOD_NAME); + .create(NeoForgeRegistries.ATTACHMENT_TYPES, AE2wtlibAPI.MOD_NAME); public static void onAe2Initialized() { AddTerminalEvent.register((event -> { @@ -50,23 +52,24 @@ public static void onAe2Initialized() { .addTerminal(); })); - AddTerminalEvent.run(); + UpgradeHelper.addUpgradeToAllTerminals(AE2wtlibItems.QUANTUM_BRIDGE_CARD, 1); + Upgrades.add(AE2wtlibItems.MAGNET_CARD, AEItems.WIRELESS_CRAFTING_TERMINAL, 1); + Upgrades.add(AE2wtlibItems.MAGNET_CARD, AE2wtlibItems.UNIVERSAL_TERMINAL, 1); - Registry.register(BuiltInRegistries.RECIPE_SERIALIZER, id(UpgradeSerializer.NAME), Upgrade.serializer); - Registry.register(BuiltInRegistries.RECIPE_SERIALIZER, id(CombineSerializer.NAME), Combine.serializer); + Registry.register(BuiltInRegistries.RECIPE_SERIALIZER, AE2wtlibAPI.id(UpgradeSerializer.NAME), + Upgrade.serializer); + Registry.register(BuiltInRegistries.RECIPE_SERIALIZER, AE2wtlibAPI.id(CombineSerializer.NAME), + Combine.serializer); HotkeyActions.register(new RestockHotkeyAction(), "ae2wtlib_restock"); HotkeyActions.register(new MagnetHotkeyAction(), "ae2wtlib_magnet"); - - UpgradeHelper.addUpgrades(); } static void addToCreativeTab() { if (AE2wtlibCreativeTab.registrationHappened()) return; - AE2wtlibCreativeTab.addTerminal(AEItems.WIRELESS_CRAFTING_TERMINAL.asItem()); - AE2wtlibCreativeTab.addTerminal(AE2wtlibItems.PATTERN_ENCODING_TERMINAL); - AE2wtlibCreativeTab.addTerminal(AE2wtlibItems.PATTERN_ACCESS_TERMINAL); + for (var t : WTDefinition.wirelessTerminals()) + AE2wtlibCreativeTab.addTerminal(t.item()); AE2wtlibCreativeTab.addUniversalTerminal(AE2wtlibItems.UNIVERSAL_TERMINAL); AE2wtlibCreativeTab.add(AE2wtlibItems.QUANTUM_BRIDGE_CARD); AE2wtlibCreativeTab.add(AE2wtlibItems.MAGNET_CARD); @@ -93,8 +96,4 @@ public static void registerScreens(RegisterMenuScreensEvent event) { InitScreens.register(event, MagnetMenu.TYPE, MagnetScreen::new, "/screens/wtlib/magnet.json"); InitScreens.register(event, TrashMenu.TYPE, TrashScreen::new, "/screens/wtlib/trash.json"); } - - public static ResourceLocation id(String name) { - return ResourceLocation.fromNamespaceAndPath(MOD_NAME, name); - } } diff --git a/src/main/java/de/mari_023/ae2wtlib/AE2wtlibAPIImplementation.java b/src/main/java/de/mari_023/ae2wtlib/AE2wtlibAPIImplementation.java new file mode 100644 index 00000000..6e190736 --- /dev/null +++ b/src/main/java/de/mari_023/ae2wtlib/AE2wtlibAPIImplementation.java @@ -0,0 +1,42 @@ +package de.mari_023.ae2wtlib; + +import java.util.function.Supplier; + +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.neoforged.neoforge.network.PacketDistributor; + +import appeng.api.upgrades.IUpgradeInventory; +import appeng.menu.locator.ItemMenuHostLocator; + +import de.mari_023.ae2wtlib.api.AE2wtlibAPIImpl; +import de.mari_023.ae2wtlib.networking.CycleTerminalPacket; +import de.mari_023.ae2wtlib.networking.UpdateWUTPackage; + +public class AE2wtlibAPIImplementation extends AE2wtlibAPIImpl { + @Override + public boolean hasQuantumBridgeCard(Supplier upgrades) { + return upgrades.get().isInstalled(AE2wtlibItems.QUANTUM_BRIDGE_CARD); + } + + @Override + public boolean isUniversalTerminal(Item item) { + return item == AE2wtlibItems.UNIVERSAL_TERMINAL; + } + + @Override + public void cycleTerminal(boolean isHandlingRightClick) { + PacketDistributor.sendToServer(new CycleTerminalPacket(isHandlingRightClick)); + } + + @Override + public void updateClientTerminal(ServerPlayer player, ItemMenuHostLocator locator, ItemStack stack) { + PacketDistributor.sendToPlayer(player, new UpdateWUTPackage(locator, stack)); + } + + @Override + public Item getWUT() { + return AE2wtlibItems.UNIVERSAL_TERMINAL; + } +} diff --git a/src/main/java/de/mari_023/ae2wtlib/AE2wtlibAdditionalComponents.java b/src/main/java/de/mari_023/ae2wtlib/AE2wtlibAdditionalComponents.java new file mode 100644 index 00000000..bcd0d3d6 --- /dev/null +++ b/src/main/java/de/mari_023/ae2wtlib/AE2wtlibAdditionalComponents.java @@ -0,0 +1,28 @@ +package de.mari_023.ae2wtlib; + +import java.util.function.Supplier; + +import com.mojang.serialization.Codec; +import com.mojang.serialization.DataResult; + +import net.minecraft.core.component.DataComponentType; +import net.minecraft.world.entity.player.Player; +import net.neoforged.neoforge.attachment.AttachmentType; +import net.neoforged.neoforge.network.codec.NeoForgeStreamCodecs; + +import de.mari_023.ae2wtlib.api.AE2wtlibComponents; +import de.mari_023.ae2wtlib.wct.CraftingTerminalHandler; +import de.mari_023.ae2wtlib.wct.magnet_card.MagnetMode; + +public class AE2wtlibAdditionalComponents { + public static final DataComponentType MAGNET_SETTINGS = AE2wtlibComponents.register("magnet_settings", + builder -> builder.persistent(Codec.BYTE.comapFlatMap(b -> DataResult.success(MagnetMode.fromByte(b)), + MagnetMode::getId)) + .networkSynchronized(NeoForgeStreamCodecs.enumCodec(MagnetMode.class))); + + public static final Supplier> CT_HANDLER = AE2wtlib.ATTACHMENT_TYPES + .register("ct_handler", + () -> AttachmentType.builder((player) -> new CraftingTerminalHandler((Player) player)).build()); + + public static void init() {} +} diff --git a/src/main/java/de/mari_023/ae2wtlib/AE2wtlibCreativeTab.java b/src/main/java/de/mari_023/ae2wtlib/AE2wtlibCreativeTab.java index 0dc35380..d80a83bf 100644 --- a/src/main/java/de/mari_023/ae2wtlib/AE2wtlibCreativeTab.java +++ b/src/main/java/de/mari_023/ae2wtlib/AE2wtlibCreativeTab.java @@ -12,8 +12,10 @@ import appeng.api.config.Actionable; import appeng.items.tools.powered.WirelessTerminalItem; -import de.mari_023.ae2wtlib.wut.ItemWUT; -import de.mari_023.ae2wtlib.wut.WTDefinition; +import de.mari_023.ae2wtlib.api.AE2wtlibAPI; +import de.mari_023.ae2wtlib.api.TextConstants; +import de.mari_023.ae2wtlib.api.registration.WTDefinition; +import de.mari_023.ae2wtlib.api.terminal.ItemWUT; import de.mari_023.ae2wtlib.wut.recipe.Common; public class AE2wtlibCreativeTab { @@ -30,7 +32,7 @@ public static void init() { }) .displayItems(AE2wtlibCreativeTab::buildDisplayItems) .build(); - Registry.register(BuiltInRegistries.CREATIVE_MODE_TAB, AE2wtlib.id("main"), tab); + Registry.register(BuiltInRegistries.CREATIVE_MODE_TAB, AE2wtlibAPI.id("main"), tab); } public static boolean registrationHappened() { diff --git a/src/main/java/de/mari_023/ae2wtlib/AE2wtlibEvents.java b/src/main/java/de/mari_023/ae2wtlib/AE2wtlibEvents.java index a0713407..7cdac35a 100644 --- a/src/main/java/de/mari_023/ae2wtlib/AE2wtlibEvents.java +++ b/src/main/java/de/mari_023/ae2wtlib/AE2wtlibEvents.java @@ -15,6 +15,7 @@ import appeng.api.stacks.AEItemKey; import appeng.me.helpers.PlayerSource; +import de.mari_023.ae2wtlib.api.AE2wtlibComponents; import de.mari_023.ae2wtlib.networking.UpdateRestockPacket; import de.mari_023.ae2wtlib.wct.CraftingTerminalHandler; import de.mari_023.ae2wtlib.wct.magnet_card.MagnetHandler; diff --git a/src/main/java/de/mari_023/ae2wtlib/AE2wtlibForge.java b/src/main/java/de/mari_023/ae2wtlib/AE2wtlibForge.java index c9216d3b..15436253 100644 --- a/src/main/java/de/mari_023/ae2wtlib/AE2wtlibForge.java +++ b/src/main/java/de/mari_023/ae2wtlib/AE2wtlibForge.java @@ -1,7 +1,5 @@ package de.mari_023.ae2wtlib; -import net.minecraft.core.Registry; -import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.core.registries.Registries; import net.minecraft.network.RegistryFriendlyByteBuf; import net.minecraft.network.codec.StreamCodec; @@ -11,7 +9,7 @@ import net.neoforged.bus.api.EventPriority; import net.neoforged.bus.api.IEventBus; import net.neoforged.bus.api.SubscribeEvent; -import net.neoforged.fml.ModLoadingContext; +import net.neoforged.fml.ModContainer; import net.neoforged.fml.common.EventBusSubscriber; import net.neoforged.fml.common.Mod; import net.neoforged.fml.config.ModConfig; @@ -30,34 +28,33 @@ import appeng.items.tools.powered.powersink.PoweredItemCapabilities; +import de.mari_023.ae2wtlib.api.AE2wtlibAPI; +import de.mari_023.ae2wtlib.api.terminal.ItemWT; import de.mari_023.ae2wtlib.networking.AE2wtlibPacket; import de.mari_023.ae2wtlib.networking.CycleTerminalPacket; import de.mari_023.ae2wtlib.networking.RestockAmountPacket; import de.mari_023.ae2wtlib.networking.UpdateRestockPacket; import de.mari_023.ae2wtlib.networking.UpdateWUTPackage; -import de.mari_023.ae2wtlib.terminal.ItemWT; -@Mod(AE2wtlib.MOD_NAME) +@Mod(AE2wtlibAPI.MOD_NAME) @EventBusSubscriber public class AE2wtlibForge { - public AE2wtlibForge(IEventBus modEventBus) { + public AE2wtlibForge(IEventBus modEventBus, ModContainer modContainer) { + new AE2wtlibAPIImplementation(); CommonHooks.markComponentClassAsValid(ItemStack.class);// TODO figure out if there is a better way AE2wtlib.registerMenus(); - ModLoadingContext.get().getActiveContainer().registerConfig(ModConfig.Type.COMMON, AE2wtlibConfig.SPEC, - AE2wtlib.MOD_NAME + ".toml"); + modContainer.registerConfig(ModConfig.Type.COMMON, AE2wtlibConfig.SPEC, + AE2wtlibAPI.MOD_NAME + ".toml"); modEventBus.addListener((RegisterEvent e) -> { if (!e.getRegistryKey().equals(Registries.ITEM)) return; AE2wtlibItems.init(); AE2wtlib.onAe2Initialized(); AE2wtlibCreativeTab.init(); - - for (var entry : AE2wtlibComponents.DR.entrySet()) - Registry.register(BuiltInRegistries.DATA_COMPONENT_TYPE, entry.getKey(), entry.getValue()); }); modEventBus.addListener((BuildCreativeModeTabContentsEvent e) -> AE2wtlib.addToCreativeTab()); modEventBus.addListener((RegisterPayloadHandlersEvent event) -> { - PayloadRegistrar registrar = event.registrar(AE2wtlib.MOD_NAME); + PayloadRegistrar registrar = event.registrar(AE2wtlibAPI.MOD_NAME); registerPacket(registrar, CycleTerminalPacket.ID, CycleTerminalPacket.STREAM_CODEC); registerPacket(registrar, UpdateWUTPackage.ID, UpdateWUTPackage.STREAM_CODEC); registerPacket(registrar, UpdateRestockPacket.ID, UpdateRestockPacket.STREAM_CODEC); @@ -69,6 +66,7 @@ public AE2wtlibForge(IEventBus modEventBus) { registerPowerStorageItem(event, AE2wtlibItems.PATTERN_ACCESS_TERMINAL); registerPowerStorageItem(event, AE2wtlibItems.PATTERN_ENCODING_TERMINAL); }); + AE2wtlibAdditionalComponents.init(); AE2wtlib.ATTACHMENT_TYPES.register(modEventBus); } diff --git a/src/main/java/de/mari_023/ae2wtlib/AE2wtlibItems.java b/src/main/java/de/mari_023/ae2wtlib/AE2wtlibItems.java index 895c9507..de36a8b6 100644 --- a/src/main/java/de/mari_023/ae2wtlib/AE2wtlibItems.java +++ b/src/main/java/de/mari_023/ae2wtlib/AE2wtlibItems.java @@ -1,6 +1,6 @@ package de.mari_023.ae2wtlib; -import static de.mari_023.ae2wtlib.AE2wtlib.id; +import static de.mari_023.ae2wtlib.api.AE2wtlibAPI.id; import net.minecraft.core.Registry; import net.minecraft.core.registries.BuiltInRegistries; @@ -11,10 +11,10 @@ import appeng.core.definitions.AEItems; import appeng.items.tools.powered.WirelessTerminalItem; +import de.mari_023.ae2wtlib.api.terminal.ItemWUT; import de.mari_023.ae2wtlib.wat.ItemWAT; import de.mari_023.ae2wtlib.wct.ItemWCT; import de.mari_023.ae2wtlib.wet.ItemWET; -import de.mari_023.ae2wtlib.wut.ItemWUT; public final class AE2wtlibItems { private AE2wtlibItems() {} diff --git a/src/main/java/de/mari_023/ae2wtlib/AE2wtlibTestPlots.java b/src/main/java/de/mari_023/ae2wtlib/AE2wtlibTestPlots.java index 3601c8a9..07e8972d 100644 --- a/src/main/java/de/mari_023/ae2wtlib/AE2wtlibTestPlots.java +++ b/src/main/java/de/mari_023/ae2wtlib/AE2wtlibTestPlots.java @@ -17,7 +17,7 @@ import appeng.server.testplots.TestPlotClass; import appeng.server.testworld.PlotBuilder; -import de.mari_023.ae2wtlib.wut.WTDefinition; +import de.mari_023.ae2wtlib.api.registration.WTDefinition; import de.mari_023.ae2wtlib.wut.recipe.Common; @TestPlotClass diff --git a/src/main/java/de/mari_023/ae2wtlib/hotkeys/MagnetHotkeyAction.java b/src/main/java/de/mari_023/ae2wtlib/hotkeys/MagnetHotkeyAction.java index 2feec557..d6965e12 100644 --- a/src/main/java/de/mari_023/ae2wtlib/hotkeys/MagnetHotkeyAction.java +++ b/src/main/java/de/mari_023/ae2wtlib/hotkeys/MagnetHotkeyAction.java @@ -5,7 +5,7 @@ import appeng.api.features.HotkeyAction; -import de.mari_023.ae2wtlib.TextConstants; +import de.mari_023.ae2wtlib.api.TextConstants; import de.mari_023.ae2wtlib.wct.CraftingTerminalHandler; import de.mari_023.ae2wtlib.wct.magnet_card.MagnetHandler; import de.mari_023.ae2wtlib.wct.magnet_card.MagnetMode; diff --git a/src/main/java/de/mari_023/ae2wtlib/hotkeys/RestockHotkeyAction.java b/src/main/java/de/mari_023/ae2wtlib/hotkeys/RestockHotkeyAction.java index 878ec0e1..1b50e872 100644 --- a/src/main/java/de/mari_023/ae2wtlib/hotkeys/RestockHotkeyAction.java +++ b/src/main/java/de/mari_023/ae2wtlib/hotkeys/RestockHotkeyAction.java @@ -7,11 +7,11 @@ import appeng.api.features.HotkeyAction; import appeng.menu.locator.ItemMenuHostLocator; -import de.mari_023.ae2wtlib.AE2wtlibComponents; -import de.mari_023.ae2wtlib.TextConstants; -import de.mari_023.ae2wtlib.terminal.ItemWT; +import de.mari_023.ae2wtlib.api.AE2wtlibComponents; +import de.mari_023.ae2wtlib.api.TextConstants; +import de.mari_023.ae2wtlib.api.terminal.ItemWT; +import de.mari_023.ae2wtlib.api.terminal.WUTHandler; import de.mari_023.ae2wtlib.wct.CraftingTerminalHandler; -import de.mari_023.ae2wtlib.wut.WUTHandler; public class RestockHotkeyAction implements HotkeyAction { @Override diff --git a/src/main/java/de/mari_023/ae2wtlib/mixin/RestockRender.java b/src/main/java/de/mari_023/ae2wtlib/mixin/RestockRender.java index 047cd074..a0fcc06c 100644 --- a/src/main/java/de/mari_023/ae2wtlib/mixin/RestockRender.java +++ b/src/main/java/de/mari_023/ae2wtlib/mixin/RestockRender.java @@ -15,7 +15,7 @@ import appeng.util.ReadableNumberConverter; -import de.mari_023.ae2wtlib.AE2wtlibComponents; +import de.mari_023.ae2wtlib.api.AE2wtlibComponents; import de.mari_023.ae2wtlib.wct.CraftingTerminalHandler; @Mixin(value = GuiGraphics.class, remap = false) diff --git a/src/main/java/de/mari_023/ae2wtlib/networking/CycleTerminalPacket.java b/src/main/java/de/mari_023/ae2wtlib/networking/CycleTerminalPacket.java index b9a83018..114e516a 100644 --- a/src/main/java/de/mari_023/ae2wtlib/networking/CycleTerminalPacket.java +++ b/src/main/java/de/mari_023/ae2wtlib/networking/CycleTerminalPacket.java @@ -12,12 +12,12 @@ import appeng.menu.AEBaseMenu; import appeng.menu.locator.ItemMenuHostLocator; -import de.mari_023.ae2wtlib.AE2wtlib; -import de.mari_023.ae2wtlib.wut.ItemWUT; -import de.mari_023.ae2wtlib.wut.WUTHandler; +import de.mari_023.ae2wtlib.api.AE2wtlibAPI; +import de.mari_023.ae2wtlib.api.terminal.ItemWUT; +import de.mari_023.ae2wtlib.api.terminal.WUTHandler; public record CycleTerminalPacket(boolean isRightClick) implements AE2wtlibPacket { - public static final Type ID = new Type<>(AE2wtlib.id("cycle_terminal")); + public static final Type ID = new Type<>(AE2wtlibAPI.id("cycle_terminal")); public static final StreamCodec STREAM_CODEC = ByteBufCodecs.BOOL .map(CycleTerminalPacket::new, CycleTerminalPacket::isRightClick); diff --git a/src/main/java/de/mari_023/ae2wtlib/networking/RestockAmountPacket.java b/src/main/java/de/mari_023/ae2wtlib/networking/RestockAmountPacket.java index 4fa20c8e..7f276e37 100644 --- a/src/main/java/de/mari_023/ae2wtlib/networking/RestockAmountPacket.java +++ b/src/main/java/de/mari_023/ae2wtlib/networking/RestockAmountPacket.java @@ -13,11 +13,11 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.Item; -import de.mari_023.ae2wtlib.AE2wtlib; +import de.mari_023.ae2wtlib.api.AE2wtlibAPI; import de.mari_023.ae2wtlib.wct.CraftingTerminalHandler; public record RestockAmountPacket(HashMap, Long> items) implements AE2wtlibPacket { - public static final Type ID = new Type<>(AE2wtlib.id("restock_amounts")); + public static final Type ID = new Type<>(AE2wtlibAPI.id("restock_amounts")); public static final StreamCodec STREAM_CODEC = ByteBufCodecs .map(Maps::newHashMapWithExpectedSize, ByteBufCodecs.holderRegistry(Registries.ITEM), ByteBufCodecs.VAR_LONG) diff --git a/src/main/java/de/mari_023/ae2wtlib/networking/UpdateRestockPacket.java b/src/main/java/de/mari_023/ae2wtlib/networking/UpdateRestockPacket.java index becde846..aa306568 100644 --- a/src/main/java/de/mari_023/ae2wtlib/networking/UpdateRestockPacket.java +++ b/src/main/java/de/mari_023/ae2wtlib/networking/UpdateRestockPacket.java @@ -8,10 +8,10 @@ import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.entity.player.Player; -import de.mari_023.ae2wtlib.AE2wtlib; +import de.mari_023.ae2wtlib.api.AE2wtlibAPI; public record UpdateRestockPacket(int slot, int amount) implements AE2wtlibPacket { - public static final Type ID = new Type<>(AE2wtlib.id("update_restock")); + public static final Type ID = new Type<>(AE2wtlibAPI.id("update_restock")); public static final StreamCodec STREAM_CODEC = StreamCodec.composite( ByteBufCodecs.INT, UpdateRestockPacket::slot, ByteBufCodecs.INT, UpdateRestockPacket::amount, diff --git a/src/main/java/de/mari_023/ae2wtlib/networking/UpdateWUTPackage.java b/src/main/java/de/mari_023/ae2wtlib/networking/UpdateWUTPackage.java index 0b17bc95..4f336f2c 100644 --- a/src/main/java/de/mari_023/ae2wtlib/networking/UpdateWUTPackage.java +++ b/src/main/java/de/mari_023/ae2wtlib/networking/UpdateWUTPackage.java @@ -9,12 +9,12 @@ import appeng.menu.locator.ItemMenuHostLocator; -import de.mari_023.ae2wtlib.AE2wtlib; -import de.mari_023.ae2wtlib.AE2wtlibComponents; -import de.mari_023.ae2wtlib.terminal.WTMenuHost; +import de.mari_023.ae2wtlib.api.AE2wtlibAPI; +import de.mari_023.ae2wtlib.api.AE2wtlibComponents; +import de.mari_023.ae2wtlib.api.terminal.WTMenuHost; public record UpdateWUTPackage(ItemMenuHostLocator locator, DataComponentPatch patch) implements AE2wtlibPacket { - public static final Type ID = new Type<>(AE2wtlib.id("update_wut")); + public static final Type ID = new Type<>(AE2wtlibAPI.id("update_wut")); public static final StreamCodec STREAM_CODEC = StreamCodec .composite(AE2wtlibComponents.MENU_HOST_LOCATOR_STREAM_CODEC, UpdateWUTPackage::locator, DataComponentPatch.STREAM_CODEC, UpdateWUTPackage::patch, diff --git a/src/main/java/de/mari_023/ae2wtlib/recipeviewer/JEIPlugin.java b/src/main/java/de/mari_023/ae2wtlib/recipeviewer/JEIPlugin.java index 2e637e1f..fde22eba 100644 --- a/src/main/java/de/mari_023/ae2wtlib/recipeviewer/JEIPlugin.java +++ b/src/main/java/de/mari_023/ae2wtlib/recipeviewer/JEIPlugin.java @@ -11,13 +11,13 @@ import appeng.api.config.Actionable; -import de.mari_023.ae2wtlib.AE2wtlib; import de.mari_023.ae2wtlib.AE2wtlibItems; +import de.mari_023.ae2wtlib.api.AE2wtlibAPI; import de.mari_023.ae2wtlib.wut.WTDefinitions; @JeiPlugin public class JEIPlugin implements IModPlugin { - private static final ResourceLocation ID = AE2wtlib.id("core"); + private static final ResourceLocation ID = AE2wtlibAPI.id("core"); @Override public ResourceLocation getPluginUid() { diff --git a/src/main/java/de/mari_023/ae2wtlib/recipeviewer/REIPlugin.java b/src/main/java/de/mari_023/ae2wtlib/recipeviewer/REIPlugin.java index ca9b614e..3c6abf15 100644 --- a/src/main/java/de/mari_023/ae2wtlib/recipeviewer/REIPlugin.java +++ b/src/main/java/de/mari_023/ae2wtlib/recipeviewer/REIPlugin.java @@ -10,15 +10,15 @@ import appeng.api.config.Actionable; -import de.mari_023.ae2wtlib.AE2wtlib; import de.mari_023.ae2wtlib.AE2wtlibItems; +import de.mari_023.ae2wtlib.api.AE2wtlibAPI; import de.mari_023.ae2wtlib.wut.WTDefinitions; @REIPluginClient public class REIPlugin implements REIClientPlugin { @Override public String getPluginProviderName() { - return AE2wtlib.MOD_NAME; + return AE2wtlibAPI.MOD_NAME; } @Override diff --git a/src/main/java/de/mari_023/ae2wtlib/wat/ItemWAT.java b/src/main/java/de/mari_023/ae2wtlib/wat/ItemWAT.java index 39fd2902..fa4b9e51 100644 --- a/src/main/java/de/mari_023/ae2wtlib/wat/ItemWAT.java +++ b/src/main/java/de/mari_023/ae2wtlib/wat/ItemWAT.java @@ -11,7 +11,7 @@ import appeng.api.util.IConfigManager; import appeng.menu.locator.ItemMenuHostLocator; -import de.mari_023.ae2wtlib.terminal.ItemWT; +import de.mari_023.ae2wtlib.api.terminal.ItemWT; public class ItemWAT extends ItemWT { @Override diff --git a/src/main/java/de/mari_023/ae2wtlib/wat/WATMenu.java b/src/main/java/de/mari_023/ae2wtlib/wat/WATMenu.java index 7bb6d4ca..97118df5 100644 --- a/src/main/java/de/mari_023/ae2wtlib/wat/WATMenu.java +++ b/src/main/java/de/mari_023/ae2wtlib/wat/WATMenu.java @@ -11,9 +11,9 @@ import appeng.menu.implementations.PatternAccessTermMenu; import appeng.menu.slot.RestrictedInputSlot; -import de.mari_023.ae2wtlib.AE2wtlibSlotSemantics; -import de.mari_023.ae2wtlib.terminal.WTMenuHost; -import de.mari_023.ae2wtlib.wut.ItemWUT; +import de.mari_023.ae2wtlib.api.gui.AE2wtlibSlotSemantics; +import de.mari_023.ae2wtlib.api.terminal.ItemWUT; +import de.mari_023.ae2wtlib.api.terminal.WTMenuHost; public class WATMenu extends PatternAccessTermMenu { public static final String ID = "wireless_pattern_access_terminal"; diff --git a/src/main/java/de/mari_023/ae2wtlib/wat/WATMenuHost.java b/src/main/java/de/mari_023/ae2wtlib/wat/WATMenuHost.java index a4aa326a..515e78e7 100644 --- a/src/main/java/de/mari_023/ae2wtlib/wat/WATMenuHost.java +++ b/src/main/java/de/mari_023/ae2wtlib/wat/WATMenuHost.java @@ -11,8 +11,8 @@ import appeng.menu.ISubMenu; import appeng.menu.locator.ItemMenuHostLocator; -import de.mari_023.ae2wtlib.terminal.ItemWT; -import de.mari_023.ae2wtlib.terminal.WTMenuHost; +import de.mari_023.ae2wtlib.api.terminal.ItemWT; +import de.mari_023.ae2wtlib.api.terminal.WTMenuHost; public class WATMenuHost extends WTMenuHost implements IPatternAccessTermMenuHost { public WATMenuHost(ItemWT item, Player player, ItemMenuHostLocator locator, diff --git a/src/main/java/de/mari_023/ae2wtlib/wat/WATScreen.java b/src/main/java/de/mari_023/ae2wtlib/wat/WATScreen.java index aee601c7..6b799b83 100644 --- a/src/main/java/de/mari_023/ae2wtlib/wat/WATScreen.java +++ b/src/main/java/de/mari_023/ae2wtlib/wat/WATScreen.java @@ -7,9 +7,9 @@ import appeng.client.gui.style.ScreenStyle; import appeng.client.gui.widgets.ToolboxPanel; -import de.mari_023.ae2wtlib.terminal.ScrollingUpgradesPanel; -import de.mari_023.ae2wtlib.terminal.WTMenuHost; -import de.mari_023.ae2wtlib.wut.IUniversalTerminalCapable; +import de.mari_023.ae2wtlib.api.gui.ScrollingUpgradesPanel; +import de.mari_023.ae2wtlib.api.terminal.IUniversalTerminalCapable; +import de.mari_023.ae2wtlib.api.terminal.WTMenuHost; public class WATScreen extends PatternAccessTermScreen implements IUniversalTerminalCapable { private final ScrollingUpgradesPanel upgradesPanel; diff --git a/src/main/java/de/mari_023/ae2wtlib/terminal/ArmorSlot.java b/src/main/java/de/mari_023/ae2wtlib/wct/ArmorSlot.java similarity index 96% rename from src/main/java/de/mari_023/ae2wtlib/terminal/ArmorSlot.java rename to src/main/java/de/mari_023/ae2wtlib/wct/ArmorSlot.java index d3691735..8f83f992 100644 --- a/src/main/java/de/mari_023/ae2wtlib/terminal/ArmorSlot.java +++ b/src/main/java/de/mari_023/ae2wtlib/wct/ArmorSlot.java @@ -1,4 +1,4 @@ -package de.mari_023.ae2wtlib.terminal; +package de.mari_023.ae2wtlib.wct; import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.entity.player.Inventory; @@ -8,6 +8,8 @@ import appeng.menu.slot.AppEngSlot; +import de.mari_023.ae2wtlib.api.gui.Icon; + public class ArmorSlot extends AppEngSlot { private final Inventory playerInventory; private final Armor armor; diff --git a/src/main/java/de/mari_023/ae2wtlib/wct/CraftingTerminalHandler.java b/src/main/java/de/mari_023/ae2wtlib/wct/CraftingTerminalHandler.java index d37a9bc7..83924b6c 100644 --- a/src/main/java/de/mari_023/ae2wtlib/wct/CraftingTerminalHandler.java +++ b/src/main/java/de/mari_023/ae2wtlib/wct/CraftingTerminalHandler.java @@ -13,11 +13,11 @@ import appeng.api.networking.IGridNode; import appeng.menu.locator.ItemMenuHostLocator; -import de.mari_023.ae2wtlib.AE2wtlibComponents; -import de.mari_023.ae2wtlib.terminal.WTMenuHost; +import de.mari_023.ae2wtlib.AE2wtlibAdditionalComponents; +import de.mari_023.ae2wtlib.api.terminal.WTMenuHost; +import de.mari_023.ae2wtlib.api.terminal.WUTHandler; import de.mari_023.ae2wtlib.wct.magnet_card.MagnetHost; import de.mari_023.ae2wtlib.wut.WTDefinitions; -import de.mari_023.ae2wtlib.wut.WUTHandler; public class CraftingTerminalHandler { public final Player player; @@ -35,7 +35,7 @@ public CraftingTerminalHandler(Player player) { } public static CraftingTerminalHandler getCraftingTerminalHandler(Player player) { - return player.getData(AE2wtlibComponents.CT_HANDLER); + return player.getData(AE2wtlibAdditionalComponents.CT_HANDLER); } private void invalidateCache() { diff --git a/src/main/java/de/mari_023/ae2wtlib/wct/ItemWCT.java b/src/main/java/de/mari_023/ae2wtlib/wct/ItemWCT.java index 8a8df63c..a6f97950 100644 --- a/src/main/java/de/mari_023/ae2wtlib/wct/ItemWCT.java +++ b/src/main/java/de/mari_023/ae2wtlib/wct/ItemWCT.java @@ -9,7 +9,7 @@ import appeng.menu.locator.ItemMenuHostLocator; -import de.mari_023.ae2wtlib.terminal.ItemWT; +import de.mari_023.ae2wtlib.api.terminal.ItemWT; import de.mari_023.ae2wtlib.wct.magnet_card.MagnetHandler; public class ItemWCT extends ItemWT { diff --git a/src/main/java/de/mari_023/ae2wtlib/wct/TrashMenu.java b/src/main/java/de/mari_023/ae2wtlib/wct/TrashMenu.java index a97c4f7e..b3ca2978 100644 --- a/src/main/java/de/mari_023/ae2wtlib/wct/TrashMenu.java +++ b/src/main/java/de/mari_023/ae2wtlib/wct/TrashMenu.java @@ -9,7 +9,7 @@ import appeng.menu.implementations.MenuTypeBuilder; import appeng.menu.slot.AppEngSlot; -import de.mari_023.ae2wtlib.AE2wtlibSlotSemantics; +import de.mari_023.ae2wtlib.api.gui.AE2wtlibSlotSemantics; public class TrashMenu extends AEBaseMenu implements ISubMenu { public static final String ID = "trash"; diff --git a/src/main/java/de/mari_023/ae2wtlib/wct/WCTMenu.java b/src/main/java/de/mari_023/ae2wtlib/wct/WCTMenu.java index 7c34c524..9b12c24e 100644 --- a/src/main/java/de/mari_023/ae2wtlib/wct/WCTMenu.java +++ b/src/main/java/de/mari_023/ae2wtlib/wct/WCTMenu.java @@ -13,13 +13,12 @@ import appeng.menu.me.items.CraftingTermMenu; import appeng.menu.slot.RestrictedInputSlot; -import de.mari_023.ae2wtlib.AE2wtlibSlotSemantics; -import de.mari_023.ae2wtlib.terminal.ArmorSlot; -import de.mari_023.ae2wtlib.terminal.WTMenuHost; +import de.mari_023.ae2wtlib.api.gui.AE2wtlibSlotSemantics; +import de.mari_023.ae2wtlib.api.terminal.ItemWUT; +import de.mari_023.ae2wtlib.api.terminal.WTMenuHost; import de.mari_023.ae2wtlib.wct.magnet_card.MagnetHandler; import de.mari_023.ae2wtlib.wct.magnet_card.MagnetMenu; import de.mari_023.ae2wtlib.wct.magnet_card.MagnetMode; -import de.mari_023.ae2wtlib.wut.ItemWUT; public class WCTMenu extends CraftingTermMenu { public static final String ID = "wireless_crafting_terminal"; diff --git a/src/main/java/de/mari_023/ae2wtlib/wct/WCTMenuHost.java b/src/main/java/de/mari_023/ae2wtlib/wct/WCTMenuHost.java index 6b9c5f34..e19a21c2 100644 --- a/src/main/java/de/mari_023/ae2wtlib/wct/WCTMenuHost.java +++ b/src/main/java/de/mari_023/ae2wtlib/wct/WCTMenuHost.java @@ -17,14 +17,14 @@ import appeng.util.inv.AppEngInternalInventory; import appeng.util.inv.SupplierInternalInventory; -import de.mari_023.ae2wtlib.AE2wtlib; -import de.mari_023.ae2wtlib.terminal.ItemWT; -import de.mari_023.ae2wtlib.terminal.WTMenuHost; +import de.mari_023.ae2wtlib.api.AE2wtlibAPI; +import de.mari_023.ae2wtlib.api.terminal.ItemWT; +import de.mari_023.ae2wtlib.api.terminal.WTMenuHost; public class WCTMenuHost extends WTMenuHost implements IViewCellStorage { private final SupplierInternalInventory craftingGrid; private final AppEngInternalInventory trash = new AppEngInternalInventory(27); - public static final ResourceLocation INV_TRASH = AE2wtlib.id("wct_trash"); + public static final ResourceLocation INV_TRASH = AE2wtlibAPI.id("wct_trash"); public WCTMenuHost(ItemWT item, Player player, ItemMenuHostLocator locator, BiConsumer returnToMainMenu) { diff --git a/src/main/java/de/mari_023/ae2wtlib/wct/WCTScreen.java b/src/main/java/de/mari_023/ae2wtlib/wct/WCTScreen.java index 98fa0f68..7c3d7ada 100644 --- a/src/main/java/de/mari_023/ae2wtlib/wct/WCTScreen.java +++ b/src/main/java/de/mari_023/ae2wtlib/wct/WCTScreen.java @@ -11,10 +11,13 @@ import appeng.client.gui.me.items.CraftingTermScreen; import appeng.client.gui.style.ScreenStyle; -import de.mari_023.ae2wtlib.TextConstants; -import de.mari_023.ae2wtlib.terminal.*; +import de.mari_023.ae2wtlib.api.TextConstants; +import de.mari_023.ae2wtlib.api.gui.Icon; +import de.mari_023.ae2wtlib.api.gui.IconButton; +import de.mari_023.ae2wtlib.api.gui.ScrollingUpgradesPanel; +import de.mari_023.ae2wtlib.api.terminal.IUniversalTerminalCapable; +import de.mari_023.ae2wtlib.api.terminal.WTMenuHost; import de.mari_023.ae2wtlib.wct.magnet_card.MagnetMode; -import de.mari_023.ae2wtlib.wut.IUniversalTerminalCapable; public class WCTScreen extends CraftingTermScreen implements IUniversalTerminalCapable { private final IconButton magnetCardToggleButton; diff --git a/src/main/java/de/mari_023/ae2wtlib/terminal/WrappedPlayerInventory.java b/src/main/java/de/mari_023/ae2wtlib/wct/WrappedPlayerInventory.java similarity index 95% rename from src/main/java/de/mari_023/ae2wtlib/terminal/WrappedPlayerInventory.java rename to src/main/java/de/mari_023/ae2wtlib/wct/WrappedPlayerInventory.java index cd0ccd4f..1832901a 100644 --- a/src/main/java/de/mari_023/ae2wtlib/terminal/WrappedPlayerInventory.java +++ b/src/main/java/de/mari_023/ae2wtlib/wct/WrappedPlayerInventory.java @@ -1,4 +1,4 @@ -package de.mari_023.ae2wtlib.terminal; +package de.mari_023.ae2wtlib.wct; import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.item.ItemStack; diff --git a/src/main/java/de/mari_023/ae2wtlib/wct/magnet_card/MagnetHandler.java b/src/main/java/de/mari_023/ae2wtlib/wct/magnet_card/MagnetHandler.java index 798cd511..6b44f2bb 100644 --- a/src/main/java/de/mari_023/ae2wtlib/wct/magnet_card/MagnetHandler.java +++ b/src/main/java/de/mari_023/ae2wtlib/wct/magnet_card/MagnetHandler.java @@ -21,9 +21,10 @@ import appeng.api.upgrades.IUpgradeableItem; import appeng.api.upgrades.Upgrades; -import de.mari_023.ae2wtlib.AE2wtlibComponents; +import de.mari_023.ae2wtlib.AE2wtlibAdditionalComponents; import de.mari_023.ae2wtlib.AE2wtlibConfig; import de.mari_023.ae2wtlib.AE2wtlibItems; +import de.mari_023.ae2wtlib.api.AE2wtlibComponents; import de.mari_023.ae2wtlib.networking.RestockAmountPacket; import de.mari_023.ae2wtlib.wct.CraftingTerminalHandler; @@ -124,14 +125,14 @@ public static void saveMagnetMode(ItemStack terminal, MagnetMode magnetSettings) return; if (!upgradeableItem.getUpgrades(terminal).isInstalled(AE2wtlibItems.MAGNET_CARD)) return; - terminal.set(AE2wtlibComponents.MAGNET_SETTINGS, magnetSettings); + terminal.set(AE2wtlibAdditionalComponents.MAGNET_SETTINGS, magnetSettings); } public static MagnetMode getMagnetMode(ItemStack terminal) { if (terminal.getItem() instanceof IUpgradeableItem upgradeableItem && Upgrades.getMaxInstallable(AE2wtlibItems.MAGNET_CARD, upgradeableItem) != 0) { if (upgradeableItem.getUpgrades(terminal).isInstalled(AE2wtlibItems.MAGNET_CARD)) - return terminal.getOrDefault(AE2wtlibComponents.MAGNET_SETTINGS, MagnetMode.OFF); + return terminal.getOrDefault(AE2wtlibAdditionalComponents.MAGNET_SETTINGS, MagnetMode.OFF); return MagnetMode.NO_CARD; } return MagnetMode.INVALID; diff --git a/src/main/java/de/mari_023/ae2wtlib/wct/magnet_card/MagnetHost.java b/src/main/java/de/mari_023/ae2wtlib/wct/magnet_card/MagnetHost.java index 1ed9cb32..d71e10b7 100644 --- a/src/main/java/de/mari_023/ae2wtlib/wct/magnet_card/MagnetHost.java +++ b/src/main/java/de/mari_023/ae2wtlib/wct/magnet_card/MagnetHost.java @@ -9,7 +9,7 @@ import appeng.util.ConfigInventory; import appeng.util.prioritylist.IPartitionList; -import de.mari_023.ae2wtlib.AE2wtlibComponents; +import de.mari_023.ae2wtlib.api.AE2wtlibComponents; import de.mari_023.ae2wtlib.wct.CraftingTerminalHandler; public class MagnetHost { diff --git a/src/main/java/de/mari_023/ae2wtlib/wct/magnet_card/MagnetMenu.java b/src/main/java/de/mari_023/ae2wtlib/wct/magnet_card/MagnetMenu.java index fd76ddca..bd5bde33 100644 --- a/src/main/java/de/mari_023/ae2wtlib/wct/magnet_card/MagnetMenu.java +++ b/src/main/java/de/mari_023/ae2wtlib/wct/magnet_card/MagnetMenu.java @@ -14,7 +14,7 @@ import appeng.util.ConfigInventory; import appeng.util.ConfigMenuInventory; -import de.mari_023.ae2wtlib.AE2wtlibSlotSemantics; +import de.mari_023.ae2wtlib.api.gui.AE2wtlibSlotSemantics; import de.mari_023.ae2wtlib.wct.CraftingTerminalHandler; import de.mari_023.ae2wtlib.wct.WCTMenuHost; diff --git a/src/main/java/de/mari_023/ae2wtlib/wct/magnet_card/MagnetScreen.java b/src/main/java/de/mari_023/ae2wtlib/wct/magnet_card/MagnetScreen.java index 9d79654e..5fd92ddb 100644 --- a/src/main/java/de/mari_023/ae2wtlib/wct/magnet_card/MagnetScreen.java +++ b/src/main/java/de/mari_023/ae2wtlib/wct/magnet_card/MagnetScreen.java @@ -8,9 +8,9 @@ import appeng.client.gui.implementations.AESubScreen; import appeng.client.gui.style.ScreenStyle; -import de.mari_023.ae2wtlib.TextConstants; -import de.mari_023.ae2wtlib.terminal.Icon; -import de.mari_023.ae2wtlib.terminal.IconButton; +import de.mari_023.ae2wtlib.api.TextConstants; +import de.mari_023.ae2wtlib.api.gui.Icon; +import de.mari_023.ae2wtlib.api.gui.IconButton; public class MagnetScreen extends AEBaseScreen { public MagnetScreen(MagnetMenu menu, Inventory playerInventory, Component title, ScreenStyle style) { diff --git a/src/main/java/de/mari_023/ae2wtlib/wet/ItemWET.java b/src/main/java/de/mari_023/ae2wtlib/wet/ItemWET.java index 53fc3308..a3cd8c4e 100644 --- a/src/main/java/de/mari_023/ae2wtlib/wet/ItemWET.java +++ b/src/main/java/de/mari_023/ae2wtlib/wet/ItemWET.java @@ -5,7 +5,7 @@ import appeng.menu.locator.ItemMenuHostLocator; -import de.mari_023.ae2wtlib.terminal.ItemWT; +import de.mari_023.ae2wtlib.api.terminal.ItemWT; public class ItemWET extends ItemWT { @Override diff --git a/src/main/java/de/mari_023/ae2wtlib/wet/WETMenu.java b/src/main/java/de/mari_023/ae2wtlib/wet/WETMenu.java index 471d9ead..193be2b7 100644 --- a/src/main/java/de/mari_023/ae2wtlib/wet/WETMenu.java +++ b/src/main/java/de/mari_023/ae2wtlib/wet/WETMenu.java @@ -8,9 +8,9 @@ import appeng.menu.me.items.PatternEncodingTermMenu; import appeng.menu.slot.RestrictedInputSlot; -import de.mari_023.ae2wtlib.AE2wtlibSlotSemantics; -import de.mari_023.ae2wtlib.terminal.WTMenuHost; -import de.mari_023.ae2wtlib.wut.ItemWUT; +import de.mari_023.ae2wtlib.api.gui.AE2wtlibSlotSemantics; +import de.mari_023.ae2wtlib.api.terminal.ItemWUT; +import de.mari_023.ae2wtlib.api.terminal.WTMenuHost; public class WETMenu extends PatternEncodingTermMenu { public static final String ID = "wireless_pattern_encoding_terminal"; diff --git a/src/main/java/de/mari_023/ae2wtlib/wet/WETMenuHost.java b/src/main/java/de/mari_023/ae2wtlib/wet/WETMenuHost.java index 9e067e85..ed333492 100644 --- a/src/main/java/de/mari_023/ae2wtlib/wet/WETMenuHost.java +++ b/src/main/java/de/mari_023/ae2wtlib/wet/WETMenuHost.java @@ -13,9 +13,9 @@ import appeng.menu.locator.ItemMenuHostLocator; import appeng.parts.encoding.PatternEncodingLogic; -import de.mari_023.ae2wtlib.AE2wtlibComponents; -import de.mari_023.ae2wtlib.terminal.ItemWT; -import de.mari_023.ae2wtlib.terminal.WTMenuHost; +import de.mari_023.ae2wtlib.api.AE2wtlibComponents; +import de.mari_023.ae2wtlib.api.terminal.ItemWT; +import de.mari_023.ae2wtlib.api.terminal.WTMenuHost; public class WETMenuHost extends WTMenuHost implements IViewCellStorage, IPatternTerminalMenuHost, IPatternTerminalLogicHost { diff --git a/src/main/java/de/mari_023/ae2wtlib/wet/WETScreen.java b/src/main/java/de/mari_023/ae2wtlib/wet/WETScreen.java index 513394d3..8e3a919f 100644 --- a/src/main/java/de/mari_023/ae2wtlib/wet/WETScreen.java +++ b/src/main/java/de/mari_023/ae2wtlib/wet/WETScreen.java @@ -6,9 +6,9 @@ import appeng.client.gui.me.items.PatternEncodingTermScreen; import appeng.client.gui.style.ScreenStyle; -import de.mari_023.ae2wtlib.terminal.ScrollingUpgradesPanel; -import de.mari_023.ae2wtlib.terminal.WTMenuHost; -import de.mari_023.ae2wtlib.wut.IUniversalTerminalCapable; +import de.mari_023.ae2wtlib.api.gui.ScrollingUpgradesPanel; +import de.mari_023.ae2wtlib.api.terminal.IUniversalTerminalCapable; +import de.mari_023.ae2wtlib.api.terminal.WTMenuHost; public class WETScreen extends PatternEncodingTermScreen implements IUniversalTerminalCapable { private final ScrollingUpgradesPanel upgradesPanel; diff --git a/src/main/java/de/mari_023/ae2wtlib/wut/WTDefinitions.java b/src/main/java/de/mari_023/ae2wtlib/wut/WTDefinitions.java index 4a282f08..4fc80baa 100644 --- a/src/main/java/de/mari_023/ae2wtlib/wut/WTDefinitions.java +++ b/src/main/java/de/mari_023/ae2wtlib/wut/WTDefinitions.java @@ -1,5 +1,8 @@ package de.mari_023.ae2wtlib.wut; +import de.mari_023.ae2wtlib.api.registration.AddTerminalEvent; +import de.mari_023.ae2wtlib.api.registration.WTDefinition; + /** * Holds links to AE2wtlib wireless terminal definition. *

@@ -18,17 +21,17 @@ private WTDefinitions() {} *

* Don't access until terminal registration happened, or it WILL crash. */ - public static WTDefinition CRAFTING = WTDefinition.of("crafting"); + public static final WTDefinition CRAFTING = WTDefinition.of("crafting"); /** * Wireless Pattern Encoding Terminal *

* Don't access until terminal registration happened, or it WILL crash. */ - public static WTDefinition PATTERN_ENCODING = WTDefinition.of("pattern_encoding"); + public static final WTDefinition PATTERN_ENCODING = WTDefinition.of("pattern_encoding"); /** * Wireless Pattern Access Terminal *

* Don't access until terminal registration happened, or it WILL crash. */ - public static WTDefinition PATTERN_ACCESS = WTDefinition.of("pattern_access"); + public static final WTDefinition PATTERN_ACCESS = WTDefinition.of("pattern_access"); } diff --git a/src/main/java/de/mari_023/ae2wtlib/wut/recipe/Combine.java b/src/main/java/de/mari_023/ae2wtlib/wut/recipe/Combine.java index 4ad800ea..8043c132 100644 --- a/src/main/java/de/mari_023/ae2wtlib/wut/recipe/Combine.java +++ b/src/main/java/de/mari_023/ae2wtlib/wut/recipe/Combine.java @@ -10,7 +10,7 @@ import net.minecraft.world.item.crafting.RecipeSerializer; import net.minecraft.world.level.Level; -import de.mari_023.ae2wtlib.wut.WTDefinition; +import de.mari_023.ae2wtlib.api.registration.WTDefinition; public class Combine extends Common { public static final CombineSerializer serializer = new CombineSerializer(); diff --git a/src/main/java/de/mari_023/ae2wtlib/wut/recipe/CombineSerializer.java b/src/main/java/de/mari_023/ae2wtlib/wut/recipe/CombineSerializer.java index 57645ace..ebe8ad56 100644 --- a/src/main/java/de/mari_023/ae2wtlib/wut/recipe/CombineSerializer.java +++ b/src/main/java/de/mari_023/ae2wtlib/wut/recipe/CombineSerializer.java @@ -7,7 +7,7 @@ import net.minecraft.network.codec.StreamCodec; import net.minecraft.world.item.crafting.Ingredient; -import de.mari_023.ae2wtlib.wut.WTDefinition; +import de.mari_023.ae2wtlib.api.registration.WTDefinition; public class CombineSerializer implements net.minecraft.world.item.crafting.RecipeSerializer { public static final String NAME = "combine"; diff --git a/src/main/java/de/mari_023/ae2wtlib/wut/recipe/Common.java b/src/main/java/de/mari_023/ae2wtlib/wut/recipe/Common.java index 977acdf1..034a1c61 100644 --- a/src/main/java/de/mari_023/ae2wtlib/wut/recipe/Common.java +++ b/src/main/java/de/mari_023/ae2wtlib/wut/recipe/Common.java @@ -14,9 +14,9 @@ import appeng.api.upgrades.IUpgradeInventory; import de.mari_023.ae2wtlib.AE2wtlibItems; -import de.mari_023.ae2wtlib.terminal.ItemWT; -import de.mari_023.ae2wtlib.wut.ItemWUT; -import de.mari_023.ae2wtlib.wut.WTDefinition; +import de.mari_023.ae2wtlib.api.registration.WTDefinition; +import de.mari_023.ae2wtlib.api.terminal.ItemWT; +import de.mari_023.ae2wtlib.api.terminal.ItemWUT; public abstract class Common implements CraftingRecipe { protected final ItemStack outputStack = new ItemStack(AE2wtlibItems.UNIVERSAL_TERMINAL); diff --git a/src/main/java/de/mari_023/ae2wtlib/wut/recipe/Upgrade.java b/src/main/java/de/mari_023/ae2wtlib/wut/recipe/Upgrade.java index 4b15f323..75e452f7 100644 --- a/src/main/java/de/mari_023/ae2wtlib/wut/recipe/Upgrade.java +++ b/src/main/java/de/mari_023/ae2wtlib/wut/recipe/Upgrade.java @@ -10,7 +10,7 @@ import net.minecraft.world.item.crafting.RecipeSerializer; import net.minecraft.world.level.Level; -import de.mari_023.ae2wtlib.wut.WTDefinition; +import de.mari_023.ae2wtlib.api.registration.WTDefinition; public class Upgrade extends Common { public static final UpgradeSerializer serializer = new UpgradeSerializer(); diff --git a/src/main/java/de/mari_023/ae2wtlib/wut/recipe/UpgradeSerializer.java b/src/main/java/de/mari_023/ae2wtlib/wut/recipe/UpgradeSerializer.java index f5b85d03..29252139 100644 --- a/src/main/java/de/mari_023/ae2wtlib/wut/recipe/UpgradeSerializer.java +++ b/src/main/java/de/mari_023/ae2wtlib/wut/recipe/UpgradeSerializer.java @@ -7,7 +7,7 @@ import net.minecraft.network.codec.StreamCodec; import net.minecraft.world.item.crafting.Ingredient; -import de.mari_023.ae2wtlib.wut.WTDefinition; +import de.mari_023.ae2wtlib.api.registration.WTDefinition; public class UpgradeSerializer implements net.minecraft.world.item.crafting.RecipeSerializer { public static final String NAME = "upgrade"; diff --git a/src/main/java/de/mari_023/ae2wtlib/wut/select/WUTSelectScreen.java b/src/main/java/de/mari_023/ae2wtlib/wut/select/WUTSelectScreen.java index da73a395..d70079de 100644 --- a/src/main/java/de/mari_023/ae2wtlib/wut/select/WUTSelectScreen.java +++ b/src/main/java/de/mari_023/ae2wtlib/wut/select/WUTSelectScreen.java @@ -1,5 +1,6 @@ package de.mari_023.ae2wtlib.wut.select; +import java.awt.*; import java.util.ArrayList; import java.util.List; @@ -13,9 +14,7 @@ import net.minecraft.network.chat.Component; import net.minecraft.world.item.ItemStack; -import me.shedaniel.math.Color; - -import de.mari_023.ae2wtlib.wut.WTDefinition; +import de.mari_023.ae2wtlib.api.registration.WTDefinition; public class WUTSelectScreen extends Screen { private final List terminals = new ArrayList<>(); @@ -37,7 +36,7 @@ public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float partia for (int i = 0; i < terminals.size(); i++) drawSegment(guiGraphics.pose(), i * angle, (i + 1) * angle, hWidth, hHeight, 100, 50, - Color.ofRGB(125, 125, 125), + new Color(125, 125, 125), i == selected); super.render(guiGraphics, mouseX, mouseY, partialTicks); @@ -47,7 +46,7 @@ public static void drawSegment(PoseStack poseStack, int startingAngle, int endin float centerY, int outerRadius, int innerRadius, Color color, boolean selected) { if (selected) { outerRadius += 10; - color = color.darker(2); + color = color.darker(); } poseStack.pushPose(); diff --git a/src/main/resources/META-INF/neoforge.mods.toml b/src/main/resources/META-INF/neoforge.mods.toml index 1904c692..32101946 100644 --- a/src/main/resources/META-INF/neoforge.mods.toml +++ b/src/main/resources/META-INF/neoforge.mods.toml @@ -13,22 +13,16 @@ Adds Wireless versions of ae2 Terminals with infinite range capabilities. ''' updateJSONURL = "https://api.modrinth.com/updates/applied-energistics-2-wireless-terminals/forge_updates.json?neoforge=only" logoFile = "icon.png" +logoBlur=false [[mixins]] config="ae2wtlib.mixins.json" [[dependencies.ae2wtlib]] -modId = "neoforge" +modId = "ae2wtlib_api" type="REQUIRED" -versionRange = "*" -ordering = "NONE" -side = "BOTH" - -[[dependencies.ae2wtlib]] -modId = "minecraft" -type="REQUIRED" -versionRange = "*" -ordering = "NONE" +versionRange = "[${version}]" +ordering = "BEFORE" side = "BOTH" [[dependencies.ae2wtlib]] @@ -42,5 +36,21 @@ side = "BOTH" modId = "curios" type="OPTIONAL" versionRange = "*" -ordering = "AFTER" -side = "BOTH" \ No newline at end of file +ordering = "NONE" +side = "BOTH" + +[[dependencies.ae2wtlib]] +modId = "extendedae" +type="INCOMPATIBLE" +versionRange = "(,1.21-1.1.4-neoforge]" +ordering = "NONE" +side = "BOTH" +reason = "breaking changes in the ae2wtlib api" + +[[dependencies.ae2wtlib]] +modId = "megacells" +type="INCOMPATIBLE" +versionRange = "(0.0.0,4.0.0-alpha]" +ordering = "NONE" +side = "BOTH" +reason = "breaking changes in the ae2wtlib api" diff --git a/src/main/resources/assets/ae2/textures/wtlib/guis/crafting-REF-FULL.png b/src/main/resources/assets/ae2/textures/wtlib/guis/crafting-REF-FULL.png deleted file mode 100644 index 4e5c480d3e831199a2fba8ecde92312a642b636e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3543 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 N002ovPDHLkV1j{>kxKvo diff --git a/src/main/resources/assets/ae2/textures/wtlib/guis/magnet-REF.png b/src/main/resources/assets/ae2/textures/wtlib/guis/magnet-REF.png deleted file mode 100644 index 9fca23b0e6196d98bc36d89d66435640d1246134..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 615 zcmeAS@N?(olHy`uVBq!ia0y~yU<5K58CaNs)Vi3hp+HJ8z$e7@|NsAv_91@#ZdHfk z8@0{b`C>kP6;+%dttCNz!3+-1ZlnR(Up!qLLn>~)y=$0v z$Ux*+;kpACJWk&5l3|EvRJ_I~DREgz{3*j*R)J5q8WnRQm98#-lVGeOG)ebo;?lqS zPo8=te`JP#rI^k%r>z`oPj!XJ^Sy8ZxfBc(*a}uozHY}i;onzxrgbZsANuP!{C*|G zyNEG<-!2!B^FhGDM4?n+mVAQ?3xv<0AULrD%4FC%JM8A|vYpb?%U7*4{@$nmyZ)~2 z|FU+b(+e6o4%99HQ4fN%*V><2&}gzi_RfNY-aT!F-{#a7BgKu~khqI&N?5kxfr~Rf|KQDMw`SGYIw_iY z`P^vc-mR_dA!R%jf!POLci8@Ljrh7f`ofpw1GA$}GMYu@-zo8ZxGbA1wrBl|=j}Nz zm1T$C+-H54=r3vVV|K%x$^^aVobR6>V`qG)p3Y}dv|!?Mn2+C9-}!bML>KKgp9P$vH_*euQ9SWx{}frXCIvkrLKLoRN@~yC5$pt#I|LqOk0Fk#j1EtEw7$8jf^LgsrC2HytFOUcw$) z*B)(SgHAd)tZ%3wYG`a}p=51g5nyQ)@aYch-`2adC51=66NAxf&O` zUJZ1+=;d=Mz~@l>uU#<;4m1l7x|VV^6bQa^Clmm}ta0Hs5xC0=IH!aN5;4*$J}N#r zI`d(y)%iFp^|Q>^(j2{~%@>#AC?I&8A~Lw8e^e&?aQ zdi&}Xp}S|Ww{Lh@M}JKB(%9bK)b#As^q1L3Ulyk9e*OBjwzjshQEixR_406@thel} z>{-zB;{hxzTo=p?^&O%ne^P#X3v~&kD#TY<0-o*?uT;&NUj0-I%Xj0!OQOhZ-N ztkj1nI_|YRjRyL^0AKhAZbkj`R-+R6qoMx^GVErNefm~D*|{l zcw19rtx?zFA(w8Gd1XG7ij<*s$#w=Iw0MA_3s*(@h-*;GvLQ7nffG7fZiv07dWzP7saK#skusp!mv1B%)ok!ZojBK zro5JP8|>0uNVtlLX>=j;kA#qBh$2Yra3LkFfzeK4M5MReK6%3cL#k_7xV)<)d>{9Pre5nEiq+uuMA6@7UJc0pQB0cxGlZDkXSdBlN{V)|^( zT&%z+Nmk)iU!#`R3b(*Z+=e&(NhVyzNXSjx=eC4+B%q(w!p*g_^Jlk{LU7{_NSiXy z$o2U%-ag0)V?^|A(4tXeYZuXd;awcO1{CvQ;;|Ng@sypN>-^6d+n*O8(!I)-gJ?Q4 zDq39p6gS-X1b{xmsxo&A@eC^XJ~5>;)%Hmee@!kk&R+F?V)#K=o8(9I{d57d=J_CT z5j;n7(j&B3|2>Z6X`%Ve;7m10<#OH-@oucIGAfs^re>7l(mpFIwO z1dz2yEuR<$%A-1WOnKc>sX!&ElKO87X}r9l5B^TzVFS<-q%gE0lR2s!h>uF4 z2OHHJVdiy;M%iyDqf91BtH=61`+!b=1J~d>kDlstVAi}%vc{OxqJf9a=2NR>YGX2Z z$zLgxw?YaP0u2AIa@+tNE8(v138`&6E zvDwbqpAqWnuO96>HubJhbxK5PGRr5fSt;T{{+Zs-RAY-OJNb{!d=khm2Ci=E{ruWo zc7^z1J$D#axWjWw4vh+fnihVaqMCD8T?9yW!DEd9lvun|$=oFLqPD`mJ%FgUSKuIhgq-^E7ZWNW7rn zA|W*F*-z>jh_t|^v?c}t8w_d#8rexPEc;o zmDbhLI%k-kGasuaIWHUAG7$O+G%=Y8bECG+3=Nf*+AG9)=bdI%Y@hmTncy%5K zkEjSwktxoFZE}_8oR?I(cM~_VvB-&2VTz}qRn8t6kq35kBC$6~9!!u`U- zL(-5|B?&D*$q9rQg?e#X33-VZIN;>k@`xXg4!yRq8+)IBYxFW>5%(0V{Ec#6&^pQy ztH{#MI-R!6<37+Ns%=wt-0)M4DqRC1P<9hr-9Ul&!t|nQ%Zj2rMN#e(j1Lqq_!8c> znTMcXwX#_xxobDFr*USf3=+H3me^i$4=sUd5j36ubB7(%o+a0L;9|O`=hL}=qU}dW zjdy2!>`%dF^=-&xVX&CFB=O3hWWnP|-8{7X^O_uY>I)gfGnsmy%gdjy(-fM`&8rYT zRimHi^y#LLS;VfzSj9$;8;mqk_)Oc;<#2VkssaTc_3%dBKY(RnN63t^G|9zV0YIPK zKMwqwY1?G-MblGxWHIfA=zO?1icR0!Z9dc4HwrcO`Zd+L#w%g1A*uFw59Z;#6{ z<>zOvITA|mbms@a#2*nnaD<_};oZh;;-(Bh2UpZm^&yQ@Sy8tJu zVQZH{*WtAsjZu6-(5!zO5D{p)PLG{jH1G2)BVRkAzuf~_$aNepYF;ERU3pB%bquN% za%MxRWmfEp-sA*-2n|zQOsEdjK&2!1KHTsV#+pJ;s@Q5Gc~3swkbbgYWjL=YU0{tZ z)J#_yXy(!mSlncj8>hF}n?guk=?>9WTc}hEl!iYh0KUcsGOJ^t*oTG#5~4yOX2O=F zJkT$2IsIwny_O9iHwR0~OMX#7`rA%Y5k>GK<|j81kpXmLIjOCWY>l&^{sdHf&oZxkoSATq@xh_w#dmMBj{6d~vnODzEoz1okA4P6nq47Bi~ zihs6)c*M*EJYr^$Mok~bl_>qjG6u37?Q+I(w;wFQubcr_e*cbUNx--490q4ey=y;+ zPrg3_`Bf}2C5Bk=s(fsj)9?U+C<8pVwUgSd_cuYE>m!h3%sdXOTPtPeUy8*QWDU5Y zOiH11@i*eQf_pdOrc*?v;--tfGwLtwRL%Kq|1)z+eC_*=_W0jP+a-qWsQZ;}fpa}N zslT7qH$3K|)t~&#+A6TRl2Da0&WRBdGYMQ|r;+LrfevN`agGjDk{pDm@In+roQ}(C z@C!U0E2kN0hWPd;I4Le6;d<@K=wtT)yaE zZ`3w#?_WA={+6{HjvRFIK7HoOr%#_IR8(;Sb?)?ZaSW-r_4bZ!-XRBpw#0Q4l%~Bg znrOjL&DxR?ykkL0liCS(550y9+cY)ioa%sc(&V;HUS5{e@2BQZKY99!yzxI# z6C})9-_fz>`Q%x}4|jd`)h#uzd8%`x>xSavU2Gc~0H+Qs^Uz2N--}CN{gjt&0{$szl#y>u_Q|Cad^r7=< zg~tv?=N>+&eXCA$RT;L?Ww}ow5l|ox~eIae24ige~FoZtXqvf5r)Q)9Z}c zcl-ZW+rKZ-i{qH@S7gR@Q-g(#jVH;r-e`=6VLd zdi!?|pTzH}wx~2=WM*c*Z$78y&>}v}u;^@*o9q-M1u|#~n;%cMt<(37AuGjgBVHRG a-Tzv0e*46wNwa`4&fw|l=d#Wzp$P!)vhnW# literal 0 HcmV?d00001